Remove @DoNotInline annotations

This is no longer needed now our `compileSdk` implies a new-enough AGP
which does this out-lining automatically via R8. See also
https://issuetracker.google.com/345472586#comment7

There's no plan to remove the `ApiXXX` classes, but no new ones need
to be added.

PiperOrigin-RevId: 675940634
This commit is contained in:
ibaker 2024-09-18 04:45:15 -07:00 committed by Copybara-Service
parent 2951a2599c
commit 3e8ecbf564
38 changed files with 14 additions and 148 deletions

View File

@ -3,6 +3,20 @@
### Unreleased changes ### Unreleased changes
* Common Library: * Common Library:
* Remove `@DoNotInline` annotations from manually out-of-lined inner
classes designed to avoid
[runtime class verification failures](https://chromium.googlesource.com/chromium/src/+/HEAD/build/android/docs/class_verification_failures.md).
Recent versions of [R8](https://developer.android.com/build/shrink-code)
now automatically out-of-line calls like these to avoid the runtime
failures (so the manual out-of-lining is no longer required). All Gradle
users of the library must already be a using a version of the Android
Gradle Plugin that uses a version of R8 which does this,
[due to `compileSdk = 35`](https://issuetracker.google.com/345472586#comment7).
Users of the library with non-Gradle build systems will need to ensure
their R8-equivalent shrinking/obfuscating step does a similar automatic
out-of-lining process in order to avoid runtime class verification
failures. This change has
[already been done in other AndroidX libraries](http://r.android.com/3156141).
* ExoPlayer: * ExoPlayer:
* Fix `MediaCodec.CryptoException` sometimes being reported as an * Fix `MediaCodec.CryptoException` sometimes being reported as an
"unexpected runtime error" when `MediaCodec` is operated in asynchronous "unexpected runtime error" when `MediaCodec` is operated in asynchronous

View File

@ -45,7 +45,6 @@ import android.widget.ExpandableListView.OnChildClickListener;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.OptIn; import androidx.annotation.OptIn;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -667,7 +666,6 @@ public class SampleChooserActivity extends AppCompatActivity
@RequiresApi(33) @RequiresApi(33)
private static class Api33 { private static class Api33 {
@DoNotInline
public static String getPostNotificationPermissionString() { public static String getPostNotificationPermissionString() {
return Manifest.permission.POST_NOTIFICATIONS; return Manifest.permission.POST_NOTIFICATIONS;
} }

View File

@ -33,7 +33,6 @@ import android.view.Surface;
import android.view.SurfaceHolder; import android.view.SurfaceHolder;
import android.view.SurfaceView; import android.view.SurfaceView;
import android.view.TextureView; import android.view.TextureView;
import androidx.annotation.DoNotInline;
import androidx.annotation.IntRange; import androidx.annotation.IntRange;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -1586,7 +1585,6 @@ public final class CastPlayer extends BasePlayer {
} }
/** Acquires necessary resources and registers callbacks. */ /** Acquires necessary resources and registers callbacks. */
@DoNotInline
public void initialize() { public void initialize() {
mediaRouter2.registerTransferCallback(handler::post, transferCallback); mediaRouter2.registerTransferCallback(handler::post, transferCallback);
// We need at least one route callback registered in order to get transfer callback updates. // We need at least one route callback registered in order to get transfer callback updates.
@ -1601,7 +1599,6 @@ public final class CastPlayer extends BasePlayer {
* Releases any resources acquired in {@link #initialize()} and unregisters any registered * Releases any resources acquired in {@link #initialize()} and unregisters any registered
* callbacks. * callbacks.
*/ */
@DoNotInline
public void release() { public void release() {
mediaRouter2.unregisterTransferCallback(transferCallback); mediaRouter2.unregisterTransferCallback(transferCallback);
mediaRouter2.unregisterRouteCallback(emptyRouteCallback); mediaRouter2.unregisterRouteCallback(emptyRouteCallback);
@ -1609,7 +1606,6 @@ public final class CastPlayer extends BasePlayer {
} }
/** Updates the device info with an up-to-date value and notifies the listeners. */ /** Updates the device info with an up-to-date value and notifies the listeners. */
@DoNotInline
private void updateDeviceInfo() { private void updateDeviceInfo() {
DeviceInfo oldDeviceInfo = deviceInfo; DeviceInfo oldDeviceInfo = deviceInfo;
DeviceInfo newDeviceInfo = fetchDeviceInfo(); DeviceInfo newDeviceInfo = fetchDeviceInfo();
@ -1624,7 +1620,6 @@ public final class CastPlayer extends BasePlayer {
* Returns a {@link DeviceInfo} with the {@link RoutingController#getId() id} that corresponds * Returns a {@link DeviceInfo} with the {@link RoutingController#getId() id} that corresponds
* to the Cast session, or {@link #DEVICE_INFO_REMOTE_EMPTY} if not available. * to the Cast session, or {@link #DEVICE_INFO_REMOTE_EMPTY} if not available.
*/ */
@DoNotInline
public DeviceInfo fetchDeviceInfo() { public DeviceInfo fetchDeviceInfo() {
// TODO: b/364833997 - Fetch this information from the AndroidX MediaRouter selected route // TODO: b/364833997 - Fetch this information from the AndroidX MediaRouter selected route
// once the selected route id matches the controller id. // once the selected route id matches the controller id.

View File

@ -16,7 +16,6 @@
package androidx.media3.common; package androidx.media3.common;
import android.os.Bundle; import android.os.Bundle;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.media3.common.util.UnstableApi; import androidx.media3.common.util.UnstableApi;
@ -240,7 +239,6 @@ public final class AudioAttributes {
@RequiresApi(29) @RequiresApi(29)
private static final class Api29 { private static final class Api29 {
@DoNotInline
public static void setAllowedCapturePolicy( public static void setAllowedCapturePolicy(
android.media.AudioAttributes.Builder builder, android.media.AudioAttributes.Builder builder,
@C.AudioAllowedCapturePolicy int allowedCapturePolicy) { @C.AudioAllowedCapturePolicy int allowedCapturePolicy) {
@ -250,7 +248,6 @@ public final class AudioAttributes {
@RequiresApi(32) @RequiresApi(32)
private static final class Api32 { private static final class Api32 {
@DoNotInline
public static void setSpatializationBehavior( public static void setSpatializationBehavior(
android.media.AudioAttributes.Builder builder, android.media.AudioAttributes.Builder builder,
@C.SpatializationBehavior int spatializationBehavior) { @C.SpatializationBehavior int spatializationBehavior) {

View File

@ -80,7 +80,6 @@ import android.view.Display;
import android.view.SurfaceView; import android.view.SurfaceView;
import android.view.WindowManager; import android.view.WindowManager;
import androidx.annotation.ChecksSdkIntAtLeast; import androidx.annotation.ChecksSdkIntAtLeast;
import androidx.annotation.DoNotInline;
import androidx.annotation.DrawableRes; import androidx.annotation.DrawableRes;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -3918,7 +3917,6 @@ public final class Util {
@RequiresApi(29) @RequiresApi(29)
private static class Api29 { private static class Api29 {
@DoNotInline
public static void startForeground( public static void startForeground(
Service mediaSessionService, Service mediaSessionService,
int notificationId, int notificationId,

View File

@ -28,7 +28,6 @@ import android.text.Layout;
import android.text.SpannableString; import android.text.SpannableString;
import android.text.StaticLayout; import android.text.StaticLayout;
import android.text.TextPaint; import android.text.TextPaint;
import androidx.annotation.DoNotInline;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.media3.common.util.UnstableApi; import androidx.media3.common.util.UnstableApi;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@ -142,7 +141,6 @@ public abstract class TextOverlay extends BitmapOverlay {
@RequiresApi(23) @RequiresApi(23)
private static final class Api23 { private static final class Api23 {
@DoNotInline
public static StaticLayout getStaticLayout( public static StaticLayout getStaticLayout(
SpannableString text, TextPaint textPaint, int width) { SpannableString text, TextPaint textPaint, int width) {
return StaticLayout.Builder.obtain( return StaticLayout.Builder.obtain(

View File

@ -57,7 +57,6 @@ import android.view.Surface;
import android.view.SurfaceHolder; import android.view.SurfaceHolder;
import android.view.SurfaceView; import android.view.SurfaceView;
import android.view.TextureView; import android.view.TextureView;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.media3.common.AudioAttributes; import androidx.media3.common.AudioAttributes;
@ -3402,7 +3401,6 @@ import java.util.concurrent.TimeoutException;
private static final class Api31 { private static final class Api31 {
private Api31() {} private Api31() {}
@DoNotInline
public static PlayerId registerMediaMetricsListener( public static PlayerId registerMediaMetricsListener(
Context context, ExoPlayerImpl player, boolean usePlatformDiagnostics, String playerName) { Context context, ExoPlayerImpl player, boolean usePlatformDiagnostics, String playerName) {
@Nullable MediaMetricsListener listener = MediaMetricsListener.create(context); @Nullable MediaMetricsListener listener = MediaMetricsListener.create(context);
@ -3421,7 +3419,6 @@ import java.util.concurrent.TimeoutException;
private static final class Api23 { private static final class Api23 {
private Api23() {} private Api23() {}
@DoNotInline
public static boolean isSuitableExternalAudioOutputPresentInAudioDeviceInfoList( public static boolean isSuitableExternalAudioOutputPresentInAudioDeviceInfoList(
Context context, AudioDeviceInfo[] audioDeviceInfos) { Context context, AudioDeviceInfo[] audioDeviceInfos) {
if (!Util.isWear(context)) { if (!Util.isWear(context)) {
@ -3454,7 +3451,6 @@ import java.util.concurrent.TimeoutException;
return false; return false;
} }
@DoNotInline
public static void registerAudioDeviceCallback( public static void registerAudioDeviceCallback(
AudioManager audioManager, AudioDeviceCallback audioDeviceCallback, Handler handler) { AudioManager audioManager, AudioDeviceCallback audioDeviceCallback, Handler handler) {
audioManager.registerAudioDeviceCallback(audioDeviceCallback, handler); audioManager.registerAudioDeviceCallback(audioDeviceCallback, handler);

View File

@ -32,7 +32,6 @@ import android.net.Uri;
import android.provider.Settings.Global; import android.provider.Settings.Global;
import android.util.Pair; import android.util.Pair;
import android.util.SparseArray; import android.util.SparseArray;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
@ -544,7 +543,6 @@ public final class AudioCapabilities {
private static final class Api23 { private static final class Api23 {
private Api23() {} private Api23() {}
@DoNotInline
public static boolean isBluetoothConnected( public static boolean isBluetoothConnected(
AudioManager audioManager, @Nullable AudioDeviceInfoApi23 currentDevice) { AudioManager audioManager, @Nullable AudioDeviceInfoApi23 currentDevice) {
// Check the current device if known or all devices otherwise. // Check the current device if known or all devices otherwise.
@ -570,7 +568,6 @@ public final class AudioCapabilities {
* AudioDeviceInfo#TYPE_BLE_HEADSET} and {@link AudioDeviceInfo#TYPE_BLE_SPEAKER} are added from * 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. * API 31. And the type {@link AudioDeviceInfo#TYPE_BLE_BROADCAST} is added from API 33.
*/ */
@DoNotInline
private static ImmutableSet<Integer> getAllBluetoothDeviceTypes() { private static ImmutableSet<Integer> getAllBluetoothDeviceTypes() {
ImmutableSet.Builder<Integer> allBluetoothDeviceTypes = ImmutableSet.Builder<Integer> allBluetoothDeviceTypes =
new ImmutableSet.Builder<Integer>() new ImmutableSet.Builder<Integer>()
@ -591,7 +588,6 @@ public final class AudioCapabilities {
private Api29() {} private Api29() {}
@DoNotInline
public static ImmutableList<Integer> getDirectPlaybackSupportedEncodings( public static ImmutableList<Integer> getDirectPlaybackSupportedEncodings(
AudioAttributes audioAttributes) { AudioAttributes audioAttributes) {
ImmutableList.Builder<Integer> supportedEncodingsListBuilder = ImmutableList.builder(); ImmutableList.Builder<Integer> supportedEncodingsListBuilder = ImmutableList.builder();
@ -618,7 +614,6 @@ public final class AudioCapabilities {
* Returns the maximum number of channels supported for passthrough playback of audio in the * Returns the maximum number of channels supported for passthrough playback of audio in the
* given format, or {@code 0} if the format is unsupported. * given format, or {@code 0} if the format is unsupported.
*/ */
@DoNotInline
public static int getMaxSupportedChannelCountForPassthrough( public static int getMaxSupportedChannelCountForPassthrough(
@C.Encoding int encoding, int sampleRate, AudioAttributes audioAttributes) { @C.Encoding int encoding, int sampleRate, AudioAttributes audioAttributes) {
// TODO(internal b/234351617): Query supported channel masks directly once it's supported, // TODO(internal b/234351617): Query supported channel masks directly once it's supported,
@ -648,7 +643,6 @@ public final class AudioCapabilities {
private Api33() {} private Api33() {}
@DoNotInline
public static AudioCapabilities getCapabilitiesInternalForDirectPlayback( public static AudioCapabilities getCapabilitiesInternalForDirectPlayback(
AudioManager audioManager, AudioAttributes audioAttributes) { AudioManager audioManager, AudioAttributes audioAttributes) {
List<android.media.AudioProfile> directAudioProfiles = List<android.media.AudioProfile> directAudioProfiles =
@ -658,7 +652,6 @@ public final class AudioCapabilities {
} }
@Nullable @Nullable
@DoNotInline
public static AudioDeviceInfoApi23 getDefaultRoutedDeviceForAttributes( public static AudioDeviceInfoApi23 getDefaultRoutedDeviceForAttributes(
AudioManager audioManager, AudioAttributes audioAttributes) { AudioManager audioManager, AudioAttributes audioAttributes) {
List<AudioDeviceInfo> audioDevices; List<AudioDeviceInfo> audioDevices;

View File

@ -28,7 +28,6 @@ import android.media.AudioDeviceInfo;
import android.media.AudioManager; import android.media.AudioManager;
import android.net.Uri; import android.net.Uri;
import android.os.Handler; import android.os.Handler;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.media3.common.AudioAttributes; import androidx.media3.common.AudioAttributes;
@ -259,14 +258,12 @@ public final class AudioCapabilitiesReceiver {
@RequiresApi(23) @RequiresApi(23)
private static final class Api23 { private static final class Api23 {
@DoNotInline
public static void registerAudioDeviceCallback( public static void registerAudioDeviceCallback(
Context context, AudioDeviceCallback callback, Handler handler) { Context context, AudioDeviceCallback callback, Handler handler) {
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
checkNotNull(audioManager).registerAudioDeviceCallback(callback, handler); checkNotNull(audioManager).registerAudioDeviceCallback(callback, handler);
} }
@DoNotInline
public static void unregisterAudioDeviceCallback( public static void unregisterAudioDeviceCallback(
Context context, AudioDeviceCallback callback) { Context context, AudioDeviceCallback callback) {
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);

View File

@ -28,7 +28,6 @@ import android.media.AudioDeviceInfo;
import android.os.Handler; import android.os.Handler;
import android.os.SystemClock; import android.os.SystemClock;
import androidx.annotation.CallSuper; import androidx.annotation.CallSuper;
import androidx.annotation.DoNotInline;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -887,7 +886,6 @@ public abstract class DecoderAudioRenderer<
private static final class Api23 { private static final class Api23 {
private Api23() {} private Api23() {}
@DoNotInline
public static void setAudioSinkPreferredDevice( public static void setAudioSinkPreferredDevice(
AudioSink audioSink, @Nullable Object messagePayload) { AudioSink audioSink, @Nullable Object messagePayload) {
@Nullable AudioDeviceInfo audioDeviceInfo = (AudioDeviceInfo) messagePayload; @Nullable AudioDeviceInfo audioDeviceInfo = (AudioDeviceInfo) messagePayload;

View File

@ -20,7 +20,6 @@ import static androidx.media3.common.util.Assertions.checkNotNull;
import android.content.Context; import android.content.Context;
import android.media.AudioFormat; import android.media.AudioFormat;
import android.media.AudioManager; import android.media.AudioManager;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.media3.common.AudioAttributes; import androidx.media3.common.AudioAttributes;
@ -138,7 +137,6 @@ public final class DefaultAudioOffloadSupportProvider
private static final class Api29 { private static final class Api29 {
private Api29() {} private Api29() {}
@DoNotInline
public static AudioOffloadSupport getOffloadedPlaybackSupport( public static AudioOffloadSupport getOffloadedPlaybackSupport(
AudioFormat audioFormat, AudioFormat audioFormat,
android.media.AudioAttributes audioAttributes, android.media.AudioAttributes audioAttributes,
@ -157,7 +155,6 @@ public final class DefaultAudioOffloadSupportProvider
private static final class Api31 { private static final class Api31 {
private Api31() {} private Api31() {}
@DoNotInline
public static AudioOffloadSupport getOffloadedPlaybackSupport( public static AudioOffloadSupport getOffloadedPlaybackSupport(
AudioFormat audioFormat, AudioFormat audioFormat,
android.media.AudioAttributes audioAttributes, android.media.AudioAttributes audioAttributes,

View File

@ -37,7 +37,6 @@ import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.os.SystemClock; import android.os.SystemClock;
import android.util.Pair; import android.util.Pair;
import androidx.annotation.DoNotInline;
import androidx.annotation.GuardedBy; import androidx.annotation.GuardedBy;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@ -1914,13 +1913,11 @@ public final class DefaultAudioSink implements AudioSink {
audioTrack.addOnRoutingChangedListener(listener, handler); audioTrack.addOnRoutingChangedListener(listener, handler);
} }
@DoNotInline
public void release() { public void release() {
audioTrack.removeOnRoutingChangedListener(checkNotNull(listener)); audioTrack.removeOnRoutingChangedListener(checkNotNull(listener));
listener = null; listener = null;
} }
@DoNotInline
private void onRoutingChanged(AudioRouting router) { private void onRoutingChanged(AudioRouting router) {
if (listener == null) { if (listener == null) {
// Stale event. // Stale event.
@ -1984,12 +1981,10 @@ public final class DefaultAudioSink implements AudioSink {
}; };
} }
@DoNotInline
public void register(AudioTrack audioTrack) { public void register(AudioTrack audioTrack) {
audioTrack.registerStreamEventCallback(handler::post, callback); audioTrack.registerStreamEventCallback(handler::post, callback);
} }
@DoNotInline
public void unregister(AudioTrack audioTrack) { public void unregister(AudioTrack audioTrack) {
audioTrack.unregisterStreamEventCallback(callback); audioTrack.unregisterStreamEventCallback(callback);
handler.removeCallbacksAndMessages(/* token= */ null); handler.removeCallbacksAndMessages(/* token= */ null);
@ -2348,7 +2343,6 @@ public final class DefaultAudioSink implements AudioSink {
private static final class Api23 { private static final class Api23 {
private Api23() {} private Api23() {}
@DoNotInline
public static void setPreferredDeviceOnAudioTrack( public static void setPreferredDeviceOnAudioTrack(
AudioTrack audioTrack, @Nullable AudioDeviceInfoApi23 audioDeviceInfo) { AudioTrack audioTrack, @Nullable AudioDeviceInfoApi23 audioDeviceInfo) {
audioTrack.setPreferredDevice( audioTrack.setPreferredDevice(
@ -2360,7 +2354,6 @@ public final class DefaultAudioSink implements AudioSink {
private static final class Api31 { private static final class Api31 {
private Api31() {} private Api31() {}
@DoNotInline
public static void setLogSessionIdOnAudioTrack(AudioTrack audioTrack, PlayerId playerId) { public static void setLogSessionIdOnAudioTrack(AudioTrack audioTrack, PlayerId playerId) {
LogSessionId logSessionId = playerId.getLogSessionId(); LogSessionId logSessionId = playerId.getLogSessionId();
if (!logSessionId.equals(LogSessionId.LOG_SESSION_ID_NONE)) { if (!logSessionId.equals(LogSessionId.LOG_SESSION_ID_NONE)) {

View File

@ -31,7 +31,6 @@ import android.media.MediaFormat;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import androidx.annotation.CallSuper; import androidx.annotation.CallSuper;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.media3.common.AudioAttributes; import androidx.media3.common.AudioAttributes;
@ -1157,7 +1156,6 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
private static final class Api23 { private static final class Api23 {
private Api23() {} private Api23() {}
@DoNotInline
public static void setAudioSinkPreferredDevice( public static void setAudioSinkPreferredDevice(
AudioSink audioSink, @Nullable Object messagePayload) { AudioSink audioSink, @Nullable Object messagePayload) {
@Nullable AudioDeviceInfo audioDeviceInfo = (AudioDeviceInfo) messagePayload; @Nullable AudioDeviceInfo audioDeviceInfo = (AudioDeviceInfo) messagePayload;

View File

@ -26,7 +26,6 @@ import android.media.MediaDrm;
import android.media.MediaDrmResetException; import android.media.MediaDrmResetException;
import android.media.NotProvisionedException; import android.media.NotProvisionedException;
import android.media.ResourceBusyException; import android.media.ResourceBusyException;
import androidx.annotation.DoNotInline;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -221,7 +220,6 @@ public final class DrmUtil {
@RequiresApi(23) @RequiresApi(23)
private static final class Api23 { private static final class Api23 {
@DoNotInline
public static boolean isMediaDrmResetException(@Nullable Throwable throwable) { public static boolean isMediaDrmResetException(@Nullable Throwable throwable) {
return throwable instanceof MediaDrmResetException; return throwable instanceof MediaDrmResetException;
} }

View File

@ -28,7 +28,6 @@ import android.media.UnsupportedSchemeException;
import android.media.metrics.LogSessionId; import android.media.metrics.LogSessionId;
import android.os.PersistableBundle; import android.os.PersistableBundle;
import android.text.TextUtils; import android.text.TextUtils;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.media3.common.C; import androidx.media3.common.C;
@ -591,13 +590,11 @@ public final class FrameworkMediaDrm implements ExoMediaDrm {
private static class Api31 { private static class Api31 {
private Api31() {} private Api31() {}
@DoNotInline
public static boolean requiresSecureDecoder( public static boolean requiresSecureDecoder(
MediaDrm mediaDrm, String mimeType, int securityLevel) { MediaDrm mediaDrm, String mimeType, int securityLevel) {
return mediaDrm.requiresSecureDecoder(mimeType, securityLevel); return mediaDrm.requiresSecureDecoder(mimeType, securityLevel);
} }
@DoNotInline
public static void setLogSessionIdOnMediaDrmSession( public static void setLogSessionIdOnMediaDrmSession(
MediaDrm mediaDrm, byte[] drmSessionId, PlayerId playerId) { MediaDrm mediaDrm, byte[] drmSessionId, PlayerId playerId) {
LogSessionId logSessionId = playerId.getLogSessionId(); LogSessionId logSessionId = playerId.getLogSessionId();

View File

@ -21,7 +21,6 @@ import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
import android.media.LoudnessCodecController.OnLoudnessCodecUpdateListener; import android.media.LoudnessCodecController.OnLoudnessCodecUpdateListener;
import android.media.MediaCodec; import android.media.MediaCodec;
import android.os.Bundle; import android.os.Bundle;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.media3.common.util.UnstableApi; import androidx.media3.common.util.UnstableApi;
@ -74,7 +73,6 @@ public final class LoudnessCodecController {
* *
* @param audioSessionId The audio session ID. * @param audioSessionId The audio session ID.
*/ */
@DoNotInline
public void setAudioSessionId(int audioSessionId) { public void setAudioSessionId(int audioSessionId) {
if (loudnessCodecController != null) { if (loudnessCodecController != null) {
loudnessCodecController.close(); loudnessCodecController.close();
@ -104,7 +102,6 @@ public final class LoudnessCodecController {
* *
* @param mediaCodec A {@link MediaCodec}. * @param mediaCodec A {@link MediaCodec}.
*/ */
@DoNotInline
public void addMediaCodec(MediaCodec mediaCodec) { public void addMediaCodec(MediaCodec mediaCodec) {
if (loudnessCodecController != null && !loudnessCodecController.addMediaCodec(mediaCodec)) { if (loudnessCodecController != null && !loudnessCodecController.addMediaCodec(mediaCodec)) {
// Don't add codec if the existing loudness controller can't handle it. // Don't add codec if the existing loudness controller can't handle it.
@ -118,7 +115,6 @@ public final class LoudnessCodecController {
* *
* @param mediaCodec A {@link MediaCodec}. * @param mediaCodec A {@link MediaCodec}.
*/ */
@DoNotInline
public void removeMediaCodec(MediaCodec mediaCodec) { public void removeMediaCodec(MediaCodec mediaCodec) {
boolean removedCodec = mediaCodecs.remove(mediaCodec); boolean removedCodec = mediaCodecs.remove(mediaCodec);
if (removedCodec && loudnessCodecController != null) { if (removedCodec && loudnessCodecController != null) {
@ -127,7 +123,6 @@ public final class LoudnessCodecController {
} }
/** Releases the loudness controller. */ /** Releases the loudness controller. */
@DoNotInline
public void release() { public void release() {
mediaCodecs.clear(); mediaCodecs.clear();
if (loudnessCodecController != null) { if (loudnessCodecController != null) {

View File

@ -19,7 +19,6 @@ import static java.lang.annotation.ElementType.TYPE_USE;
import android.media.MediaCodecInfo.VideoCapabilities; import android.media.MediaCodecInfo.VideoCapabilities;
import android.media.MediaCodecInfo.VideoCapabilities.PerformancePoint; import android.media.MediaCodecInfo.VideoCapabilities.PerformancePoint;
import androidx.annotation.DoNotInline;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.media3.common.Format; import androidx.media3.common.Format;
@ -96,7 +95,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@RequiresApi(29) @RequiresApi(29)
private static final class Api29 { private static final class Api29 {
@DoNotInline
public static @PerformancePointCoverageResult int areResolutionAndFrameRateCovered( public static @PerformancePointCoverageResult int areResolutionAndFrameRateCovered(
VideoCapabilities videoCapabilities, int width, int height, double frameRate) { VideoCapabilities videoCapabilities, int width, int height, double frameRate) {
List<PerformancePoint> performancePointList = List<PerformancePoint> performancePointList =

View File

@ -43,7 +43,6 @@ import android.os.Bundle;
import android.os.SystemClock; import android.os.SystemClock;
import androidx.annotation.CallSuper; import androidx.annotation.CallSuper;
import androidx.annotation.CheckResult; import androidx.annotation.CheckResult;
import androidx.annotation.DoNotInline;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -2649,7 +2648,6 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
private static final class Api31 { private static final class Api31 {
private Api31() {} private Api31() {}
@DoNotInline
public static void setLogSessionIdToMediaCodecFormat( public static void setLogSessionIdToMediaCodecFormat(
MediaCodecAdapter.Configuration codecConfiguration, PlayerId playerId) { MediaCodecAdapter.Configuration codecConfiguration, PlayerId playerId) {
LogSessionId logSessionId = playerId.getLogSessionId(); LogSessionId logSessionId = playerId.getLogSessionId();

View File

@ -21,7 +21,6 @@ import android.annotation.SuppressLint;
import android.app.Notification; import android.app.Notification;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.Context; import android.content.Context;
import androidx.annotation.DoNotInline;
import androidx.annotation.DrawableRes; import androidx.annotation.DrawableRes;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -237,7 +236,6 @@ public final class DownloadNotificationHelper {
@RequiresApi(31) @RequiresApi(31)
private static final class Api31 { private static final class Api31 {
@SuppressLint("WrongConstant") // TODO(b/254277605): remove lint suppression @SuppressLint("WrongConstant") // TODO(b/254277605): remove lint suppression
@DoNotInline
public static void setForegroundServiceBehavior( public static void setForegroundServiceBehavior(
NotificationCompat.Builder notificationBuilder) { NotificationCompat.Builder notificationBuilder) {
notificationBuilder.setForegroundServiceBehavior(FOREGROUND_SERVICE_IMMEDIATE); notificationBuilder.setForegroundServiceBehavior(FOREGROUND_SERVICE_IMMEDIATE);

View File

@ -18,7 +18,6 @@ package androidx.media3.exoplayer.source.mediaparser;
import android.media.MediaFormat; import android.media.MediaFormat;
import android.media.MediaParser; import android.media.MediaParser;
import android.media.metrics.LogSessionId; import android.media.metrics.LogSessionId;
import androidx.annotation.DoNotInline;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.media3.common.Format; import androidx.media3.common.Format;
import androidx.media3.common.util.UnstableApi; import androidx.media3.common.util.UnstableApi;
@ -79,7 +78,6 @@ public final class MediaParserUtil {
private static final class Api31 { private static final class Api31 {
private Api31() {} private Api31() {}
@DoNotInline
public static void setLogSessionIdOnMediaParser(MediaParser mediaParser, PlayerId playerId) { public static void setLogSessionIdOnMediaParser(MediaParser mediaParser, PlayerId playerId) {
LogSessionId logSessionId = playerId.getLogSessionId(); LogSessionId logSessionId = playerId.getLogSessionId();
if (!logSessionId.equals(LogSessionId.LOG_SESSION_ID_NONE)) { if (!logSessionId.equals(LogSessionId.LOG_SESSION_ID_NONE)) {

View File

@ -43,7 +43,6 @@ import android.util.Pair;
import android.view.Display; import android.view.Display;
import android.view.Surface; import android.view.Surface;
import androidx.annotation.CallSuper; import androidx.annotation.CallSuper;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.media3.common.C; import androidx.media3.common.C;
@ -636,7 +635,6 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
@RequiresApi(26) @RequiresApi(26)
private static final class Api26 { private static final class Api26 {
@DoNotInline
public static boolean doesDisplaySupportDolbyVision(Context context) { public static boolean doesDisplaySupportDolbyVision(Context context) {
boolean supportsDolbyVision = false; boolean supportsDolbyVision = false;
DisplayManager displayManager = DisplayManager displayManager =

View File

@ -26,7 +26,6 @@ import android.view.Choreographer;
import android.view.Choreographer.FrameCallback; import android.view.Choreographer.FrameCallback;
import android.view.Display; import android.view.Display;
import android.view.Surface; import android.view.Surface;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.media3.common.C; import androidx.media3.common.C;
@ -428,7 +427,6 @@ public final class VideoFrameReleaseHelper {
@RequiresApi(30) @RequiresApi(30)
private static final class Api30 { private static final class Api30 {
@DoNotInline
public static void setSurfaceFrameRate(Surface surface, float frameRate) { public static void setSurfaceFrameRate(Surface surface, float frameRate) {
int compatibility = int compatibility =
frameRate == 0 frameRate == 0

View File

@ -32,7 +32,6 @@ import android.app.NotificationManager;
import android.content.Context; import android.content.Context;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.os.Bundle; import android.os.Bundle;
import androidx.annotation.DoNotInline;
import androidx.annotation.DrawableRes; import androidx.annotation.DrawableRes;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -682,7 +681,6 @@ public class DefaultMediaNotificationProvider implements MediaNotification.Provi
@RequiresApi(26) @RequiresApi(26)
private static class Api26 { private static class Api26 {
@DoNotInline
public static void createNotificationChannel( public static void createNotificationChannel(
NotificationManager notificationManager, String channelId, String channelName) { NotificationManager notificationManager, String channelId, String channelName) {
NotificationChannel channel = NotificationChannel channel =
@ -699,7 +697,6 @@ public class DefaultMediaNotificationProvider implements MediaNotification.Provi
@RequiresApi(31) @RequiresApi(31)
private static class Api31 { private static class Api31 {
@DoNotInline
public static void setForegroundServiceBehavior(NotificationCompat.Builder builder) { public static void setForegroundServiceBehavior(NotificationCompat.Builder builder) {
builder.setForegroundServiceBehavior(Notification.FOREGROUND_SERVICE_IMMEDIATE); builder.setForegroundServiceBehavior(Notification.FOREGROUND_SERVICE_IMMEDIATE);
} }

View File

@ -27,7 +27,6 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo;
import android.os.Build; import android.os.Build;
import android.view.KeyEvent; import android.view.KeyEvent;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
@ -257,7 +256,6 @@ public class MediaButtonReceiver extends BroadcastReceiver {
/** /**
* Returns true if the passed exception is a {@link ForegroundServiceStartNotAllowedException}. * Returns true if the passed exception is a {@link ForegroundServiceStartNotAllowedException}.
*/ */
@DoNotInline
public static boolean instanceOfForegroundServiceStartNotAllowedException( public static boolean instanceOfForegroundServiceStartNotAllowedException(
IllegalStateException e) { IllegalStateException e) {
return e instanceof ForegroundServiceStartNotAllowedException; return e instanceof ForegroundServiceStartNotAllowedException;
@ -267,7 +265,6 @@ public class MediaButtonReceiver extends BroadcastReceiver {
* Casts the {@link IllegalStateException} to a {@link * Casts the {@link IllegalStateException} to a {@link
* ForegroundServiceStartNotAllowedException} and throws an exception if the cast fails. * ForegroundServiceStartNotAllowedException} and throws an exception if the cast fails.
*/ */
@DoNotInline
public static ForegroundServiceStartNotAllowedException public static ForegroundServiceStartNotAllowedException
castToForegroundServiceStartNotAllowedException(IllegalStateException e) { castToForegroundServiceStartNotAllowedException(IllegalStateException e) {
return (ForegroundServiceStartNotAllowedException) e; return (ForegroundServiceStartNotAllowedException) e;

View File

@ -26,7 +26,6 @@ import android.content.pm.ServiceInfo;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.core.app.NotificationManagerCompat; import androidx.core.app.NotificationManagerCompat;
@ -384,7 +383,6 @@ import java.util.concurrent.TimeoutException;
@RequiresApi(24) @RequiresApi(24)
private static class Api24 { private static class Api24 {
@DoNotInline
public static void stopForeground(MediaSessionService service, boolean removeNotification) { public static void stopForeground(MediaSessionService service, boolean removeNotification) {
service.stopForeground(removeNotification ? STOP_FOREGROUND_REMOVE : STOP_FOREGROUND_DETACH); service.stopForeground(removeNotification ? STOP_FOREGROUND_REMOVE : STOP_FOREGROUND_DETACH);
} }

View File

@ -31,7 +31,6 @@ import android.os.IBinder;
import android.os.Looper; import android.os.Looper;
import android.os.RemoteException; import android.os.RemoteException;
import android.view.KeyEvent; import android.view.KeyEvent;
import androidx.annotation.DoNotInline;
import androidx.annotation.GuardedBy; import androidx.annotation.GuardedBy;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -2152,7 +2151,6 @@ public class MediaSession {
@RequiresApi(31) @RequiresApi(31)
private static final class Api31 { private static final class Api31 {
@DoNotInline
public static boolean isActivity(PendingIntent pendingIntent) { public static boolean isActivity(PendingIntent pendingIntent) {
return pendingIntent.isActivity(); return pendingIntent.isActivity();
} }

View File

@ -58,7 +58,6 @@ import android.os.RemoteException;
import android.os.ResultReceiver; import android.os.ResultReceiver;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.KeyEvent; import android.view.KeyEvent;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.core.util.ObjectsCompat; import androidx.core.util.ObjectsCompat;
@ -1482,7 +1481,6 @@ import org.checkerframework.checker.initialization.qual.Initialized;
@RequiresApi(31) @RequiresApi(31)
private static final class Api31 { private static final class Api31 {
@DoNotInline
public static void setMediaButtonBroadcastReceiver( public static void setMediaButtonBroadcastReceiver(
MediaSessionCompat mediaSessionCompat, ComponentName broadcastReceiver) { MediaSessionCompat mediaSessionCompat, ComponentName broadcastReceiver) {
((android.media.session.MediaSession) checkNotNull(mediaSessionCompat.getMediaSession())) ((android.media.session.MediaSession) checkNotNull(mediaSessionCompat.getMediaSession()))

View File

@ -34,7 +34,6 @@ import android.os.IBinder;
import android.os.Looper; import android.os.Looper;
import android.os.RemoteException; import android.os.RemoteException;
import androidx.annotation.CallSuper; import androidx.annotation.CallSuper;
import androidx.annotation.DoNotInline;
import androidx.annotation.GuardedBy; import androidx.annotation.GuardedBy;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -811,7 +810,6 @@ public abstract class MediaSessionService extends Service {
@RequiresApi(31) @RequiresApi(31)
private static final class Api31 { private static final class Api31 {
@DoNotInline
public static boolean instanceOfForegroundServiceStartNotAllowedException( public static boolean instanceOfForegroundServiceStartNotAllowedException(
IllegalStateException e) { IllegalStateException e) {
return e instanceof ForegroundServiceStartNotAllowedException; return e instanceof ForegroundServiceStartNotAllowedException;

View File

@ -25,7 +25,6 @@ import android.app.PendingIntent;
import android.os.Bundle; import android.os.Bundle;
import android.view.View; import android.view.View;
import android.widget.RemoteViews; import android.widget.RemoteViews;
import androidx.annotation.DoNotInline;
import androidx.annotation.DrawableRes; import androidx.annotation.DrawableRes;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -454,7 +453,6 @@ public class MediaStyleNotificationHelper {
private static class Api24Impl { private static class Api24Impl {
private Api24Impl() {} private Api24Impl() {}
@DoNotInline
public static Notification.DecoratedMediaCustomViewStyle createDecoratedMediaCustomViewStyle() { public static Notification.DecoratedMediaCustomViewStyle createDecoratedMediaCustomViewStyle() {
return new Notification.DecoratedMediaCustomViewStyle(); return new Notification.DecoratedMediaCustomViewStyle();
} }
@ -468,7 +466,6 @@ public class MediaStyleNotificationHelper {
// MEDIA_CONTENT_CONTROL permission is required by setRemotePlaybackInfo // MEDIA_CONTENT_CONTROL permission is required by setRemotePlaybackInfo
@CanIgnoreReturnValue @CanIgnoreReturnValue
@SuppressLint({"MissingPermission"}) @SuppressLint({"MissingPermission"})
@DoNotInline
public static Notification.MediaStyle setRemotePlaybackInfo( public static Notification.MediaStyle setRemotePlaybackInfo(
Notification.MediaStyle style, Notification.MediaStyle style,
CharSequence remoteDeviceName, CharSequence remoteDeviceName,

View File

@ -73,7 +73,6 @@ import android.os.RemoteException;
import android.support.v4.os.ResultReceiver; import android.support.v4.os.ResultReceiver;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import androidx.annotation.DoNotInline;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -2471,12 +2470,10 @@ public final class MediaBrowserCompat {
private static class Api21Impl { private static class Api21Impl {
private Api21Impl() {} private Api21Impl() {}
@DoNotInline
static MediaDescription getDescription(MediaBrowser.MediaItem item) { static MediaDescription getDescription(MediaBrowser.MediaItem item) {
return item.getDescription(); return item.getDescription();
} }
@DoNotInline
static int getFlags(MediaBrowser.MediaItem item) { static int getFlags(MediaBrowser.MediaItem item) {
return item.getFlags(); return item.getFlags();
} }

View File

@ -30,7 +30,6 @@ import android.content.pm.ResolveInfo;
import android.os.Build; import android.os.Build;
import android.util.Log; import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo; import androidx.annotation.RestrictTo;
@ -378,7 +377,6 @@ public class MediaButtonReceiver extends BroadcastReceiver {
/** /**
* Returns true if the passed exception is a {@link ForegroundServiceStartNotAllowedException}. * Returns true if the passed exception is a {@link ForegroundServiceStartNotAllowedException}.
*/ */
@DoNotInline
public static boolean instanceOfForegroundServiceStartNotAllowedException( public static boolean instanceOfForegroundServiceStartNotAllowedException(
IllegalStateException e) { IllegalStateException e) {
return e instanceof ForegroundServiceStartNotAllowedException; return e instanceof ForegroundServiceStartNotAllowedException;
@ -388,7 +386,6 @@ public class MediaButtonReceiver extends BroadcastReceiver {
* Casts the {@link IllegalStateException} to a {@link * Casts the {@link IllegalStateException} to a {@link
* ForegroundServiceStartNotAllowedException} and throws an exception if the cast fails. * ForegroundServiceStartNotAllowedException} and throws an exception if the cast fails.
*/ */
@DoNotInline
public static ForegroundServiceStartNotAllowedException public static ForegroundServiceStartNotAllowedException
castToForegroundServiceStartNotAllowedException(IllegalStateException e) { castToForegroundServiceStartNotAllowedException(IllegalStateException e) {
return (ForegroundServiceStartNotAllowedException) e; return (ForegroundServiceStartNotAllowedException) e;

View File

@ -27,7 +27,6 @@ import android.os.Bundle;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.text.TextUtils; import android.text.TextUtils;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo; import androidx.annotation.RestrictTo;
@ -550,89 +549,73 @@ public final class MediaDescriptionCompat implements Parcelable {
private static class Api21Impl { private static class Api21Impl {
private Api21Impl() {} private Api21Impl() {}
@DoNotInline
static MediaDescription.Builder createBuilder() { static MediaDescription.Builder createBuilder() {
return new MediaDescription.Builder(); return new MediaDescription.Builder();
} }
@DoNotInline
static void setMediaId(MediaDescription.Builder builder, @Nullable String mediaId) { static void setMediaId(MediaDescription.Builder builder, @Nullable String mediaId) {
builder.setMediaId(mediaId); builder.setMediaId(mediaId);
} }
@DoNotInline
static void setTitle(MediaDescription.Builder builder, @Nullable CharSequence title) { static void setTitle(MediaDescription.Builder builder, @Nullable CharSequence title) {
builder.setTitle(title); builder.setTitle(title);
} }
@DoNotInline
static void setSubtitle(MediaDescription.Builder builder, @Nullable CharSequence subtitle) { static void setSubtitle(MediaDescription.Builder builder, @Nullable CharSequence subtitle) {
builder.setSubtitle(subtitle); builder.setSubtitle(subtitle);
} }
@DoNotInline
static void setDescription( static void setDescription(
MediaDescription.Builder builder, @Nullable CharSequence description) { MediaDescription.Builder builder, @Nullable CharSequence description) {
builder.setDescription(description); builder.setDescription(description);
} }
@DoNotInline
static void setIconBitmap(MediaDescription.Builder builder, @Nullable Bitmap icon) { static void setIconBitmap(MediaDescription.Builder builder, @Nullable Bitmap icon) {
builder.setIconBitmap(icon); builder.setIconBitmap(icon);
} }
@DoNotInline
static void setIconUri(MediaDescription.Builder builder, @Nullable Uri iconUri) { static void setIconUri(MediaDescription.Builder builder, @Nullable Uri iconUri) {
builder.setIconUri(iconUri); builder.setIconUri(iconUri);
} }
@DoNotInline
static void setExtras(MediaDescription.Builder builder, @Nullable Bundle extras) { static void setExtras(MediaDescription.Builder builder, @Nullable Bundle extras) {
builder.setExtras(extras); builder.setExtras(extras);
} }
@DoNotInline
static MediaDescription build(MediaDescription.Builder builder) { static MediaDescription build(MediaDescription.Builder builder) {
return builder.build(); return builder.build();
} }
@DoNotInline
@Nullable @Nullable
static String getMediaId(MediaDescription description) { static String getMediaId(MediaDescription description) {
return description.getMediaId(); return description.getMediaId();
} }
@DoNotInline
@Nullable @Nullable
static CharSequence getTitle(MediaDescription description) { static CharSequence getTitle(MediaDescription description) {
return description.getTitle(); return description.getTitle();
} }
@DoNotInline
@Nullable @Nullable
static CharSequence getSubtitle(MediaDescription description) { static CharSequence getSubtitle(MediaDescription description) {
return description.getSubtitle(); return description.getSubtitle();
} }
@DoNotInline
@Nullable @Nullable
static CharSequence getDescription(MediaDescription description) { static CharSequence getDescription(MediaDescription description) {
return description.getDescription(); return description.getDescription();
} }
@DoNotInline
@Nullable @Nullable
static Bitmap getIconBitmap(MediaDescription description) { static Bitmap getIconBitmap(MediaDescription description) {
return description.getIconBitmap(); return description.getIconBitmap();
} }
@DoNotInline
@Nullable @Nullable
static Uri getIconUri(MediaDescription description) { static Uri getIconUri(MediaDescription description) {
return description.getIconUri(); return description.getIconUri();
} }
@DoNotInline
@Nullable @Nullable
static Bundle getExtras(MediaDescription description) { static Bundle getExtras(MediaDescription description) {
return description.getExtras(); return description.getExtras();
@ -643,12 +626,10 @@ public final class MediaDescriptionCompat implements Parcelable {
private static class Api23Impl { private static class Api23Impl {
private Api23Impl() {} private Api23Impl() {}
@DoNotInline
static void setMediaUri(MediaDescription.Builder builder, @Nullable Uri mediaUri) { static void setMediaUri(MediaDescription.Builder builder, @Nullable Uri mediaUri) {
builder.setMediaUri(mediaUri); builder.setMediaUri(mediaUri);
} }
@DoNotInline
@Nullable @Nullable
static Uri getMediaUri(MediaDescription description) { static Uri getMediaUri(MediaDescription description) {
return description.getMediaUri(); return description.getMediaUri();

View File

@ -61,7 +61,6 @@ import android.util.Log;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.ViewConfiguration; import android.view.ViewConfiguration;
import androidx.annotation.DoNotInline;
import androidx.annotation.GuardedBy; import androidx.annotation.GuardedBy;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@ -2136,17 +2135,14 @@ public class MediaSessionCompat {
private static class Api21Impl { private static class Api21Impl {
private Api21Impl() {} private Api21Impl() {}
@DoNotInline
static MediaSession.QueueItem createQueueItem(MediaDescription description, long id) { static MediaSession.QueueItem createQueueItem(MediaDescription description, long id) {
return new MediaSession.QueueItem(description, id); return new MediaSession.QueueItem(description, id);
} }
@DoNotInline
static MediaDescription getDescription(MediaSession.QueueItem queueItem) { static MediaDescription getDescription(MediaSession.QueueItem queueItem) {
return queueItem.getDescription(); return queueItem.getDescription();
} }
@DoNotInline
static long getQueueId(MediaSession.QueueItem queueItem) { static long getQueueId(MediaSession.QueueItem queueItem) {
return queueItem.getQueueId(); return queueItem.getQueueId();
} }

View File

@ -27,7 +27,6 @@ import android.os.Parcelable;
import android.os.SystemClock; import android.os.SystemClock;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.KeyEvent; import android.view.KeyEvent;
import androidx.annotation.DoNotInline;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.LongDef; import androidx.annotation.LongDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@ -1405,12 +1404,10 @@ public final class PlaybackStateCompat implements Parcelable {
private static class Api21Impl { private static class Api21Impl {
private Api21Impl() {} private Api21Impl() {}
@DoNotInline
static PlaybackState.Builder createBuilder() { static PlaybackState.Builder createBuilder() {
return new PlaybackState.Builder(); return new PlaybackState.Builder();
} }
@DoNotInline
static void setState( static void setState(
PlaybackState.Builder builder, PlaybackState.Builder builder,
int state, int state,
@ -1420,118 +1417,96 @@ public final class PlaybackStateCompat implements Parcelable {
builder.setState(state, position, playbackSpeed, updateTime); builder.setState(state, position, playbackSpeed, updateTime);
} }
@DoNotInline
static void setBufferedPosition(PlaybackState.Builder builder, long bufferedPosition) { static void setBufferedPosition(PlaybackState.Builder builder, long bufferedPosition) {
builder.setBufferedPosition(bufferedPosition); builder.setBufferedPosition(bufferedPosition);
} }
@DoNotInline
static void setActions(PlaybackState.Builder builder, long actions) { static void setActions(PlaybackState.Builder builder, long actions) {
builder.setActions(actions); builder.setActions(actions);
} }
@SuppressWarnings("argument.type.incompatible") // Platform class not annotated as nullable @SuppressWarnings("argument.type.incompatible") // Platform class not annotated as nullable
@DoNotInline
static void setErrorMessage(PlaybackState.Builder builder, @Nullable CharSequence error) { static void setErrorMessage(PlaybackState.Builder builder, @Nullable CharSequence error) {
builder.setErrorMessage(error); builder.setErrorMessage(error);
} }
@DoNotInline
static void addCustomAction( static void addCustomAction(
PlaybackState.Builder builder, PlaybackState.CustomAction customAction) { PlaybackState.Builder builder, PlaybackState.CustomAction customAction) {
builder.addCustomAction(customAction); builder.addCustomAction(customAction);
} }
@DoNotInline
static void setActiveQueueItemId(PlaybackState.Builder builder, long id) { static void setActiveQueueItemId(PlaybackState.Builder builder, long id) {
builder.setActiveQueueItemId(id); builder.setActiveQueueItemId(id);
} }
@DoNotInline
static List<PlaybackState.CustomAction> getCustomActions(PlaybackState state) { static List<PlaybackState.CustomAction> getCustomActions(PlaybackState state) {
return state.getCustomActions(); return state.getCustomActions();
} }
@DoNotInline
static PlaybackState build(PlaybackState.Builder builder) { static PlaybackState build(PlaybackState.Builder builder) {
return builder.build(); return builder.build();
} }
@DoNotInline
static int getState(PlaybackState state) { static int getState(PlaybackState state) {
return state.getState(); return state.getState();
} }
@DoNotInline
static long getPosition(PlaybackState state) { static long getPosition(PlaybackState state) {
return state.getPosition(); return state.getPosition();
} }
@DoNotInline
static long getBufferedPosition(PlaybackState state) { static long getBufferedPosition(PlaybackState state) {
return state.getBufferedPosition(); return state.getBufferedPosition();
} }
@DoNotInline
static float getPlaybackSpeed(PlaybackState state) { static float getPlaybackSpeed(PlaybackState state) {
return state.getPlaybackSpeed(); return state.getPlaybackSpeed();
} }
@DoNotInline
static long getActions(PlaybackState state) { static long getActions(PlaybackState state) {
return state.getActions(); return state.getActions();
} }
@Nullable @Nullable
@DoNotInline
static CharSequence getErrorMessage(PlaybackState state) { static CharSequence getErrorMessage(PlaybackState state) {
return state.getErrorMessage(); return state.getErrorMessage();
} }
@DoNotInline
static long getLastPositionUpdateTime(PlaybackState state) { static long getLastPositionUpdateTime(PlaybackState state) {
return state.getLastPositionUpdateTime(); return state.getLastPositionUpdateTime();
} }
@DoNotInline
static long getActiveQueueItemId(PlaybackState state) { static long getActiveQueueItemId(PlaybackState state) {
return state.getActiveQueueItemId(); return state.getActiveQueueItemId();
} }
@DoNotInline
static PlaybackState.CustomAction.Builder createCustomActionBuilder( static PlaybackState.CustomAction.Builder createCustomActionBuilder(
String action, CharSequence name, int icon) { String action, CharSequence name, int icon) {
return new PlaybackState.CustomAction.Builder(action, name, icon); return new PlaybackState.CustomAction.Builder(action, name, icon);
} }
@SuppressWarnings("argument.type.incompatible") // Platform class not annotated as nullable @SuppressWarnings("argument.type.incompatible") // Platform class not annotated as nullable
@DoNotInline
static void setExtras(PlaybackState.CustomAction.Builder builder, @Nullable Bundle extras) { static void setExtras(PlaybackState.CustomAction.Builder builder, @Nullable Bundle extras) {
builder.setExtras(extras); builder.setExtras(extras);
} }
@DoNotInline
static PlaybackState.CustomAction build(PlaybackState.CustomAction.Builder builder) { static PlaybackState.CustomAction build(PlaybackState.CustomAction.Builder builder) {
return builder.build(); return builder.build();
} }
@Nullable @Nullable
@DoNotInline
static Bundle getExtras(PlaybackState.CustomAction customAction) { static Bundle getExtras(PlaybackState.CustomAction customAction) {
return customAction.getExtras(); return customAction.getExtras();
} }
@DoNotInline
static String getAction(PlaybackState.CustomAction customAction) { static String getAction(PlaybackState.CustomAction customAction) {
return customAction.getAction(); return customAction.getAction();
} }
@DoNotInline
static CharSequence getName(PlaybackState.CustomAction customAction) { static CharSequence getName(PlaybackState.CustomAction customAction) {
return customAction.getName(); return customAction.getName();
} }
@DoNotInline
static int getIcon(PlaybackState.CustomAction customAction) { static int getIcon(PlaybackState.CustomAction customAction) {
return customAction.getIcon(); return customAction.getIcon();
} }
@ -1542,13 +1517,11 @@ public final class PlaybackStateCompat implements Parcelable {
private Api22Impl() {} private Api22Impl() {}
@SuppressWarnings("argument.type.incompatible") // Platform class not annotated as nullable @SuppressWarnings("argument.type.incompatible") // Platform class not annotated as nullable
@DoNotInline
static void setExtras(PlaybackState.Builder builder, @Nullable Bundle extras) { static void setExtras(PlaybackState.Builder builder, @Nullable Bundle extras) {
builder.setExtras(extras); builder.setExtras(extras);
} }
@Nullable @Nullable
@DoNotInline
static Bundle getExtras(PlaybackState state) { static Bundle getExtras(PlaybackState state) {
return state.getExtras(); return state.getExtras();
} }

View File

@ -19,7 +19,6 @@ import static androidx.annotation.RestrictTo.Scope.LIBRARY;
import android.media.VolumeProvider; import android.media.VolumeProvider;
import android.os.Build; import android.os.Build;
import androidx.annotation.DoNotInline;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -225,7 +224,6 @@ public abstract class VolumeProviderCompat {
private static class Api21Impl { private static class Api21Impl {
private Api21Impl() {} private Api21Impl() {}
@DoNotInline
static void setCurrentVolume(VolumeProvider volumeProvider, int currentVolume) { static void setCurrentVolume(VolumeProvider volumeProvider, int currentVolume) {
volumeProvider.setCurrentVolume(currentVolume); volumeProvider.setCurrentVolume(currentVolume);
} }

View File

@ -34,7 +34,6 @@ import android.media.MediaCodec.BufferInfo;
import android.media.MediaCrypto; import android.media.MediaCrypto;
import android.media.MediaFormat; import android.media.MediaFormat;
import android.view.Surface; import android.view.Surface;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
@ -524,7 +523,6 @@ public final class DefaultCodec implements Codec {
@RequiresApi(29) @RequiresApi(29)
private static final class Api29 { private static final class Api29 {
@DoNotInline
public static String getCanonicalName(MediaCodec mediaCodec) { public static String getCanonicalName(MediaCodec mediaCodec) {
return mediaCodec.getCanonicalName(); return mediaCodec.getCanonicalName();
} }

View File

@ -28,7 +28,6 @@ import android.media.MediaFormat;
import android.util.Pair; import android.util.Pair;
import android.util.Range; import android.util.Range;
import android.util.Size; import android.util.Size;
import androidx.annotation.DoNotInline;
import androidx.annotation.GuardedBy; import androidx.annotation.GuardedBy;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -457,12 +456,10 @@ public final class EncoderUtil {
@RequiresApi(29) @RequiresApi(29)
private static final class Api29 { private static final class Api29 {
@DoNotInline
public static boolean isHardwareAccelerated(MediaCodecInfo encoderInfo) { public static boolean isHardwareAccelerated(MediaCodecInfo encoderInfo) {
return encoderInfo.isHardwareAccelerated(); return encoderInfo.isHardwareAccelerated();
} }
@DoNotInline
public static boolean isSoftwareOnly(MediaCodecInfo encoderInfo) { public static boolean isSoftwareOnly(MediaCodecInfo encoderInfo) {
return encoderInfo.isSoftwareOnly(); return encoderInfo.isSoftwareOnly();
} }

View File

@ -52,7 +52,6 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import android.window.SurfaceSyncGroup; import android.window.SurfaceSyncGroup;
import androidx.annotation.ColorInt; import androidx.annotation.ColorInt;
import androidx.annotation.DoNotInline;
import androidx.annotation.IntDef; import androidx.annotation.IntDef;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi; import androidx.annotation.RequiresApi;
@ -1968,7 +1967,6 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
@RequiresApi(34) @RequiresApi(34)
private static class Api34 { private static class Api34 {
@DoNotInline
public static void setSurfaceLifecycleToFollowsAttachment(SurfaceView surfaceView) { public static void setSurfaceLifecycleToFollowsAttachment(SurfaceView surfaceView) {
surfaceView.setSurfaceLifecycle(SurfaceView.SURFACE_LIFECYCLE_FOLLOWS_ATTACHMENT); surfaceView.setSurfaceLifecycle(SurfaceView.SURFACE_LIFECYCLE_FOLLOWS_ATTACHMENT);
} }
@ -1979,7 +1977,6 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
@Nullable SurfaceSyncGroup surfaceSyncGroup; @Nullable SurfaceSyncGroup surfaceSyncGroup;
@DoNotInline
public void postRegister( public void postRegister(
Handler mainLooperHandler, SurfaceView surfaceView, Runnable invalidate) { Handler mainLooperHandler, SurfaceView surfaceView, Runnable invalidate) {
mainLooperHandler.post( mainLooperHandler.post(
@ -1997,7 +1994,6 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
}); });
} }
@DoNotInline
public void maybeMarkSyncReadyAndClear() { public void maybeMarkSyncReadyAndClear() {
if (surfaceSyncGroup != null) { if (surfaceSyncGroup != null) {
surfaceSyncGroup.markSyncReady(); surfaceSyncGroup.markSyncReady();