Skip to content

Remove outdated SDK references #2693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3719,7 +3719,7 @@ public static long sum(long... summands) {
* Returns a {@link Drawable} for the given resource or throws a {@link
* Resources.NotFoundException} if not found.
*
* @param context The context to get the theme from starting with API 21.
* @param context The context to get the theme from.
* @param resources The resources to load the drawable from.
* @param drawableRes The drawable resource int.
* @return The loaded {@link Drawable}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@
import androidx.media3.test.utils.DataSourceContractTest;
import androidx.media3.test.utils.TestUtil;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SdkSuppress;
import com.google.common.collect.ImmutableList;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

/** {@link DataSource} contract tests for {@link MediaDataSourceAdapter}. */
@RunWith(AndroidJUnit4.class)
@SdkSuppress(minSdkVersion = 23)
public class MediaDataSourceAdapterContractTest extends DataSourceContractTest {

private static final byte[] DATA = TestUtil.buildTestData(20);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import androidx.media3.exoplayer.source.DefaultMediaSourceFactory;
import androidx.media3.exoplayer.text.TextOutput;
import androidx.media3.exoplayer.text.TextRenderer;
import androidx.test.filters.SdkSuppress;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import java.util.ArrayList;
Expand Down Expand Up @@ -109,8 +108,6 @@ public void subtitlesRespectClipping_singlePeriod() throws Exception {
}

@Test
// TODO: b/399815346 - This test is flaky on API 21 even when parsing subtitles during extraction.
@SdkSuppress(minSdkVersion = 22)
public void subtitlesRespectClipping_multiplePeriods() throws Exception {
// Parsing subtitles during rendering is flaky (see comment above), so restrict that
// configuration to a single API level to reduce the chance of seeing a flaky failure.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import androidx.media3.test.utils.TestUtil;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SdkSuppress;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand All @@ -36,7 +35,6 @@
* verifying that no binder calls happen on the ExoPlayer main thread.
*/
@RunWith(AndroidJUnit4.class)
@SdkSuppress(minSdkVersion = 23)
public class ExoPlayerBinderStressTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,6 @@ public void getPsshInfo_withMediaHavingPsshData_returnsCorrectPsshMap() throws I
}

@Test
@SdkSuppress(minSdkVersion = 23)
public void getTrackFormat_withProfileAndLevelInCodecString_returnsExpectedProfileAndLevel()
throws IOException {
fakeExtractor.addReadAction(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ public void setDataSource_withFileDescriptorOffsetAndLength_returnsCorrectTrackC
}

@Test
@SdkSuppress(minSdkVersion = 23)
public void setDataSource_withMediaDataSource_returnsCorrectTrackCount() throws IOException {
byte[] fileData = TestUtil.getByteArray(context, /* fileName= */ "media/mp4/sample.mp4");
MediaDataSource mediaDataSource =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import androidx.media3.test.utils.TestUtil;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SdkSuppress;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand All @@ -40,7 +39,6 @@
* main thread.
*/
@RunWith(AndroidJUnit4.class)
@SdkSuppress(minSdkVersion = 23)
public class DefaultPreloadManagerBinderStressTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1453,8 +1453,7 @@ void setMediaSources(
/**
* Sets the ID of the audio session to attach to the underlying {@link android.media.AudioTrack}.
*
* <p>The audio session ID can be generated using {@link Util#generateAudioSessionIdV21(Context)}
* for API 21+.
* <p>The audio session ID can be generated using {@link Util#generateAudioSessionIdV21(Context)}.
*
* @param audioSessionId The audio session ID, or {@link C#AUDIO_SESSION_ID_UNSET} if it should be
* generated by the framework.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ private static boolean isBluetoothConnected(
* AudioDeviceInfo#getType()}.
*
* <p>The types {@link AudioDeviceInfo#TYPE_BLUETOOTH_A2DP} and {@link
* AudioDeviceInfo#TYPE_BLUETOOTH_SCO} are included from API 23. And the types {@link
* AudioDeviceInfo#TYPE_BLUETOOTH_SCO} are included by default. And the types {@link
* AudioDeviceInfo#TYPE_BLE_HEADSET} and {@link AudioDeviceInfo#TYPE_BLE_SPEAKER} are added from
* API 31. And the type {@link AudioDeviceInfo#TYPE_BLE_BROADCAST} is added from API 33.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1547,8 +1547,6 @@ protected DecoderReuseEvaluation onInputFormatChanged(FormatHolder formatHolder)
/**
* Called immediately before an input buffer is queued into the codec.
*
* <p>In tunneling mode for pre Marshmallow, the buffer is treated as if immediately output.
*
* @param buffer The buffer to be queued.
* @throws ExoPlaybackException Thrown if an error occurs handling the input buffer.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ public void getCapabilities_returnsCapabilitiesFromDirectProfiles_onTvV33() {
.isFalse();
}

/** {@link AudioDeviceInfo#TYPE_BLUETOOTH_A2DP} is only supported from API 23. */
@Test
@Config(minSdk = Config.OLDEST_SDK)
public void getCapabilities_withBluetoothA2dpAndHdmiConnected_returnsDefaultCapabilities() {
Expand Down Expand Up @@ -292,7 +291,7 @@ public void getCapabilities_noBluetoothButHdmiConnected_returnsHdmiCapabilities(
}

@Test
@Config(minSdk = Config.OLDEST_SDK) // TYPE_BLUETOOTH_A2DP detection is supported from API 23.
@Config(minSdk = Config.OLDEST_SDK)
public void
getCapabilities_withBluetoothA2dpConnectedAndHdmiAsRoutedDeviceHint_returnsHdmiCapabilities() {
setOutputDevices(AudioDeviceInfo.TYPE_BLUETOOTH_A2DP, AudioDeviceInfo.TYPE_HDMI);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ public void audioSinkWithNullContext_audioCapabilitiesObtainedFromBuilder_defaul
}

@Test
@Config(minSdk = Config.OLDEST_SDK) // AudioManager.TYPE_BLUETOOTH_A2DP is supported from API 23.
@Config(minSdk = Config.OLDEST_SDK)
public void bluetoothDeviceAddedAndRemoved_audioCapabilitiesUpdated() {
// Set UI mode to TV.
getShadowUiModeManager().setCurrentModeType(Configuration.UI_MODE_TYPE_TELEVISION);
Expand Down Expand Up @@ -488,8 +488,7 @@ public void bluetoothDeviceAddedAndRemoved_audioCapabilitiesUpdated() {
}

@Test
@Config(
minSdk = Config.OLDEST_SDK) // AudioManager.ACTION_HDMI_AUDIO_PLUG is supported from API 21.
@Config(minSdk = Config.OLDEST_SDK)
public void hdmiDeviceAddedAndRemoved_audioCapabilitiesUpdated() {
// Set UI mode to TV.
getShadowUiModeManager().setCurrentModeType(Configuration.UI_MODE_TYPE_TELEVISION);
Expand Down Expand Up @@ -577,9 +576,7 @@ public void setAudioAttributes_audioCapabilitiesUpdated() {
// Adding the permission to the test AndroidManifest.xml doesn't work to appease lint.
@SuppressWarnings({"StickyBroadcast", "MissingPermission"})
@Test
@Config(
minSdk = Config.OLDEST_SDK,
maxSdk = 32) // AudioManager.TYPE_BLUETOOTH_A2DP is supported from API 23.
@Config(minSdk = Config.OLDEST_SDK, maxSdk = 32)
public void setPreferredDevice_audioCapabilitiesUpdated() {
// Initially setup the audio sink with Bluetooth and HDMI device connected.
AudioDeviceInfo hdmiDevice =
Expand Down Expand Up @@ -660,7 +657,7 @@ public void onRoutingChanged_onActiveAudioTrack_audioCapabilitiesUpdated() throw
}

@Test
@Config(minSdk = Config.OLDEST_SDK) // AudioManager.TYPE_BLUETOOTH_A2DP is supported from API 23.
@Config(minSdk = Config.OLDEST_SDK)
public void afterRelease_bluetoothDeviceAdded_audioCapabilitiesShouldNotBeUpdated() {
// Set UI mode to TV.
getShadowUiModeManager().setCurrentModeType(Configuration.UI_MODE_TYPE_TELEVISION);
Expand Down Expand Up @@ -691,8 +688,7 @@ public void afterRelease_bluetoothDeviceAdded_audioCapabilitiesShouldNotBeUpdate
}

@Test
@Config(
minSdk = Config.OLDEST_SDK) // AudioManager.ACTION_HDMI_AUDIO_PLUG is supported from API 21.
@Config(minSdk = Config.OLDEST_SDK)
public void afterRelease_hdmiDeviceAdded_audioCapabilitiesShouldNotBeUpdated() {
// Set UI mode to TV.
getShadowUiModeManager().setCurrentModeType(Configuration.UI_MODE_TYPE_TELEVISION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,9 @@ protected void onForegroundServiceStartNotAllowedException(
* Intent#ACTION_MEDIA_BUTTON}. If this happens on API 31+ and the app is in the background then
* an exception is thrown.
*
* <p>With the exception of devices that are running API 20 and below, a media button intent is
* only required to be sent to this receiver for a Bluetooth media button event that wants to
* restart the service. In such a case the app gets an exemption and is allowed to start the
* foreground service. In this case this method will never be called.
* <p>A media button intent is only required to be sent to this receiver for a Bluetooth media
* button event that wants to restart the service. In such a case the app gets an exemption and is
* allowed to start the foreground service. In this case this method will never be called.
*
* <p>In all other cases of attempting to start a Media3 service or to send a media button event,
* apps must use a {@link MediaBrowser} or {@link MediaController} to bind to the service instead
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@ public MediaSessionCompat.Token getSessionToken() {
* of this bundle may affect the information returned when browsing.
*
* <p>Note that this will return null when connected to {@link android.media.browse.MediaBrowser}
* and running on API 23 or lower.
* and running on API 23.
*
* @throws IllegalStateException If this method is called outside of {@link #onLoadChildren},
* {@link #onLoadItem} or {@link #onSearch}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import androidx.media3.test.session.common.TestUtils;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SdkSuppress;
import androidx.test.filters.SmallTest;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
Expand Down Expand Up @@ -628,7 +627,6 @@ public void decreaseDeviceVolume_forLocalPlayback_decreasesStreamVolume() throws
}

@Test
@SdkSuppress(minSdkVersion = 23)
public void setDeviceMuted_mute_forLocalPlayback_mutesStreamVolume() throws Exception {
if (audioManager.isVolumeFixed()) {
// This test is not eligible for this device.
Expand Down Expand Up @@ -657,7 +655,6 @@ public void setDeviceMuted_mute_forLocalPlayback_mutesStreamVolume() throws Exce
}

@Test
@SdkSuppress(minSdkVersion = 23)
public void setDeviceMuted_unmute_forLocalPlayback_unmutesStreamVolume() throws Exception {
if (audioManager.isVolumeFixed()) {
// This test is not eligible for this device.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ private static String getExpectedControllerPackageName(ControllerInfo controller
// API 24 - 27: KeyEvent from system service has the package name "android".
return "android";
} else {
// API 21 - 23: Fallback set by MediaSessionCompat#getCurrentControllerInfo
// API 23: Fallback set by MediaSessionCompat#getCurrentControllerInfo
return LEGACY_CONTROLLER;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
* {@linkplain MediaCodecSelector#PREFER_SOFTWARE software} or {@linkplain
* MediaCodecSelector#DEFAULT hardware} decoders across a wide range of devices.
* <li>Other inputs are likely to produce accurate output when using {@linkplain
* MediaCodecSelector#DEFAULT hardware} decoders on devices that are launched with API 13 or
* MediaCodecSelector#DEFAULT hardware} decoders on devices that are launched with API 33 or
* later.
* <li>HDR inputs will produce a {@link Bitmap} with {@link ColorSpace.Named#BT2020_HLG}. There
* are no guarantees that an HLG {@link Bitmap} displayed in {@link ImageView} and an HLG
Expand Down