Loading media/java/android/media/MediaLibraryService2.java +4 −4 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ public abstract class MediaLibraryService2 extends MediaSessionService2 { * Callback for the {@link MediaLibrarySession}. */ public static class MediaLibrarySessionCallback extends MediaSession2.SessionCallback { public MediaLibrarySessionCallback(Context context) { public MediaLibrarySessionCallback(@NonNull Context context) { super(context); } Loading Loading @@ -226,7 +226,7 @@ public abstract class MediaLibraryService2 extends MediaSessionService2 { } @Override public Builder setVolumeProvider(@NonNull VolumeProvider2 volumeProvider) { public Builder setVolumeProvider(@Nullable VolumeProvider2 volumeProvider) { return super.setVolumeProvider(volumeProvider); } Loading @@ -236,12 +236,12 @@ public abstract class MediaLibraryService2 extends MediaSessionService2 { } @Override public Builder setId(String id) { public Builder setId(@NonNull String id) { return super.setId(id); } @Override public Builder setSessionCallback(@NonNull Executor executor, public Builder setSessionCallback(@NonNull @CallbackExecutor Executor executor, @NonNull MediaLibrarySessionCallback callback) { return super.setSessionCallback(executor, callback); } Loading media/java/android/media/MediaMetadata2.java +7 −5 Original line number Diff line number Diff line Loading @@ -562,7 +562,7 @@ public final class MediaMetadata2 { * @param key The key the value is stored under * @return a CharSequence value, or null */ public @Nullable CharSequence getText(@TextKey String key) { public @Nullable CharSequence getText(@NonNull @TextKey String key) { return mProvider.getText_impl(key); } Loading Loading @@ -611,7 +611,7 @@ public final class MediaMetadata2 { * @param key The key the value is stored under * @return A {@link Rating2} or {@code null} */ public @Nullable Rating2 getRating(@RatingKey String key) { public @Nullable Rating2 getRating(@NonNull @RatingKey String key) { return mProvider.getRating_impl(key); } Loading @@ -622,7 +622,7 @@ public final class MediaMetadata2 { * @param key The key the value is stored under * @return A {@link Bitmap} or null */ public Bitmap getBitmap(@BitmapKey String key) { public @Nullable Bitmap getBitmap(@NonNull @BitmapKey String key) { return mProvider.getBitmap_impl(key); } Loading Loading @@ -749,7 +749,8 @@ public final class MediaMetadata2 { * @param value The CharSequence value to store * @return The Builder to allow chaining */ public @NonNull Builder putText(@TextKey String key, @Nullable CharSequence value) { public @NonNull Builder putText(@NonNull @TextKey String key, @Nullable CharSequence value) { return mProvider.putText_impl(key, value); } Loading Loading @@ -780,7 +781,8 @@ public final class MediaMetadata2 { * @param value The String value to store * @return The Builder to allow chaining */ public @NonNull Builder putString(@TextKey String key, @Nullable String value) { public @NonNull Builder putString(@NonNull @TextKey String key, @Nullable String value) { return mProvider.putString_impl(key, value); } Loading media/java/android/media/MediaSession2.java +41 −38 Original line number Diff line number Diff line Loading @@ -490,7 +490,7 @@ public class MediaSession2 implements AutoCloseable { * @return a new Command instance from the Bundle * @hide */ public static Command fromBundle(@NonNull Context context, Bundle command) { public static Command fromBundle(@NonNull Context context, @NonNull Bundle command) { return ApiLoader.getProvider(context).fromBundle_MediaSession2Command(context, command); } } Loading @@ -501,17 +501,17 @@ public class MediaSession2 implements AutoCloseable { public static final class CommandGroup { private final CommandGroupProvider mProvider; public CommandGroup(Context context) { public CommandGroup(@NonNull Context context) { mProvider = ApiLoader.getProvider(context) .createMediaSession2CommandGroup(context, this, null); } public CommandGroup(Context context, CommandGroup others) { public CommandGroup(@NonNull Context context, @Nullable CommandGroup others) { mProvider = ApiLoader.getProvider(context) .createMediaSession2CommandGroup(context, this, others); } public void addCommand(Command command) { public void addCommand(@NonNull Command command) { mProvider.addCommand_impl(command); } Loading @@ -519,11 +519,11 @@ public class MediaSession2 implements AutoCloseable { mProvider.addAllPredefinedCommands_impl(); } public void removeCommand(Command command) { public void removeCommand(@NonNull Command command) { mProvider.removeCommand_impl(command); } public boolean hasCommand(Command command) { public boolean hasCommand(@NonNull Command command) { return mProvider.hasCommand_impl(command); } Loading @@ -531,14 +531,14 @@ public class MediaSession2 implements AutoCloseable { return mProvider.hasCommand_impl(code); } public List<Command> getCommands() { public @NonNull List<Command> getCommands() { return mProvider.getCommands_impl(); } /** * @hide */ public CommandGroupProvider getProvider() { public @NonNull CommandGroupProvider getProvider() { return mProvider; } Loading @@ -546,7 +546,7 @@ public class MediaSession2 implements AutoCloseable { * @return new bundle from the CommandGroup * @hide */ public Bundle toBundle() { public @NonNull Bundle toBundle() { return mProvider.toBundle_impl(); } Loading @@ -570,7 +570,10 @@ public class MediaSession2 implements AutoCloseable { public static abstract class SessionCallback { private final Context mContext; public SessionCallback(Context context) { public SessionCallback(@NonNull Context context) { if (context == null) { throw new IllegalArgumentException("context shouldn't be null"); } mContext = context; } Loading @@ -584,7 +587,7 @@ public class MediaSession2 implements AutoCloseable { * * @param session the session for this event * @param controller controller information. * @return allowed commands. Can be {@code null} to reject coonnection. * @return allowed commands. Can be {@code null} to reject connection. */ public @Nullable CommandGroup onConnect(@NonNull MediaSession2 session, @NonNull ControllerInfo controller) { Loading Loading @@ -906,7 +909,7 @@ public class MediaSession2 implements AutoCloseable { * * @param player a {@link MediaPlayerBase} that handles actual media playback in your app. */ U setPlayer(@NonNull MediaPlayerBase player) { @NonNull U setPlayer(@NonNull MediaPlayerBase player) { mProvider.setPlayer_impl(player); return (U) this; } Loading @@ -933,7 +936,7 @@ public class MediaSession2 implements AutoCloseable { * * @param volumeProvider The provider that will receive volume button events. */ U setVolumeProvider(@NonNull VolumeProvider2 volumeProvider) { @NonNull U setVolumeProvider(@Nullable VolumeProvider2 volumeProvider) { mProvider.setVolumeProvider_impl(volumeProvider); return (U) this; } Loading @@ -945,7 +948,7 @@ public class MediaSession2 implements AutoCloseable { * * @param pi The intent to launch to show UI for this session. */ U setSessionActivity(@Nullable PendingIntent pi) { @NonNull U setSessionActivity(@Nullable PendingIntent pi) { mProvider.setSessionActivity_impl(pi); return (U) this; } Loading @@ -960,7 +963,7 @@ public class MediaSession2 implements AutoCloseable { * @throws IllegalArgumentException if id is {@code null} * @return */ U setId(@NonNull String id) { @NonNull U setId(@NonNull String id) { mProvider.setId_impl(id); return (U) this; } Loading @@ -972,7 +975,7 @@ public class MediaSession2 implements AutoCloseable { * @param callback session callback. * @return */ U setSessionCallback(@NonNull @CallbackExecutor Executor executor, @NonNull U setSessionCallback(@NonNull @CallbackExecutor Executor executor, @NonNull C callback) { mProvider.setSessionCallback_impl(executor, callback); return (U) this; Loading @@ -985,7 +988,7 @@ public class MediaSession2 implements AutoCloseable { * @throws IllegalStateException if the session with the same id is already exists for the * package. */ T build() { @NonNull T build() { return mProvider.build_impl(); } } Loading @@ -1005,7 +1008,7 @@ public class MediaSession2 implements AutoCloseable { } @Override public Builder setPlayer(@NonNull MediaPlayerBase player) { public @NonNull Builder setPlayer(@NonNull MediaPlayerBase player) { return super.setPlayer(player); } Loading @@ -1015,28 +1018,28 @@ public class MediaSession2 implements AutoCloseable { } @Override public Builder setVolumeProvider(@NonNull VolumeProvider2 volumeProvider) { public @NonNull Builder setVolumeProvider(@Nullable VolumeProvider2 volumeProvider) { return super.setVolumeProvider(volumeProvider); } @Override public Builder setSessionActivity(@Nullable PendingIntent pi) { public @NonNull Builder setSessionActivity(@Nullable PendingIntent pi) { return super.setSessionActivity(pi); } @Override public Builder setId(@NonNull String id) { public @NonNull Builder setId(@NonNull String id) { return super.setId(id); } @Override public Builder setSessionCallback(@NonNull Executor executor, public @NonNull Builder setSessionCallback(@NonNull Executor executor, @Nullable SessionCallback callback) { return super.setSessionCallback(executor, callback); } @Override public MediaSession2 build() { public @NonNull MediaSession2 build() { return super.build(); } } Loading @@ -1050,8 +1053,8 @@ public class MediaSession2 implements AutoCloseable { /** * @hide */ public ControllerInfo(Context context, int uid, int pid, String packageName, IInterface callback) { public ControllerInfo(@NonNull Context context, int uid, int pid, @NonNull String packageName, @NonNull IInterface callback) { mProvider = ApiLoader.getProvider(context) .createMediaSession2ControllerInfo( context, this, uid, pid, packageName, callback); Loading @@ -1060,7 +1063,7 @@ public class MediaSession2 implements AutoCloseable { /** * @return package name of the controller */ public String getPackageName() { public @NonNull String getPackageName() { return mProvider.getPackageName_impl(); } Loading @@ -1085,7 +1088,7 @@ public class MediaSession2 implements AutoCloseable { /** * @hide */ public ControllerInfoProvider getProvider() { public @NonNull ControllerInfoProvider getProvider() { return mProvider; } Loading Loading @@ -1171,7 +1174,7 @@ public class MediaSession2 implements AutoCloseable { /** * @hide */ public CommandButtonProvider getProvider() { public @NonNull CommandButtonProvider getProvider() { return mProvider; } Loading @@ -1186,27 +1189,27 @@ public class MediaSession2 implements AutoCloseable { .createMediaSession2CommandButtonBuilder(context, this); } public Builder setCommand(Command command) { public @NonNull Builder setCommand(@Nullable Command command) { return mProvider.setCommand_impl(command); } public Builder setIconResId(int resId) { public @NonNull Builder setIconResId(int resId) { return mProvider.setIconResId_impl(resId); } public Builder setDisplayName(String displayName) { public @NonNull Builder setDisplayName(@Nullable String displayName) { return mProvider.setDisplayName_impl(displayName); } public Builder setEnabled(boolean enabled) { public @NonNull Builder setEnabled(boolean enabled) { return mProvider.setEnabled_impl(enabled); } public Builder setExtras(Bundle extras) { public @NonNull Builder setExtras(@Nullable Bundle extras) { return mProvider.setExtras_impl(extras); } public CommandButton build() { public @NonNull CommandButton build() { return mProvider.build_impl(); } } Loading Loading @@ -1365,7 +1368,7 @@ public class MediaSession2 implements AutoCloseable { /** * @hide */ public MediaSession2Provider getProvider() { public @NonNull MediaSession2Provider getProvider() { return mProvider; } Loading Loading @@ -1432,7 +1435,7 @@ public class MediaSession2 implements AutoCloseable { * * @param afr the full request parameters */ public void setAudioFocusRequest(AudioFocusRequest afr) { public void setAudioFocusRequest(@Nullable AudioFocusRequest afr) { // TODO(jaewan): implement this (b/72529899) // mProvider.setAudioFocusRequest_impl(focusGain); } Loading Loading @@ -1745,7 +1748,7 @@ public class MediaSession2 implements AutoCloseable { * @throws IllegalArgumentException if the play list is null * @throws NullPointerException if index is outside play list range */ public void skipToPlaylistItem(MediaItem2 item) { public void skipToPlaylistItem(@NonNull MediaItem2 item) { mProvider.skipToPlaylistItem_impl(item); } Loading Loading @@ -1785,7 +1788,7 @@ public class MediaSession2 implements AutoCloseable { * * @throws IllegalArgumentException if the play list is null */ public void removePlaylistItem(MediaItem2 item) { public void removePlaylistItem(@NonNull MediaItem2 item) { mProvider.removePlaylistItem_impl(item); } Loading media/java/android/media/MediaSessionService2.java +3 −3 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ public abstract class MediaSessionService2 extends Service { * * @return a {@link MediaNotification}. If it's {@code null}, notification wouldn't be shown. */ public MediaNotification onUpdateNotification() { public @Nullable MediaNotification onUpdateNotification() { return mProvider.onUpdateNotification_impl(); } Loading Loading @@ -202,7 +202,7 @@ public abstract class MediaSessionService2 extends Service { } /** * Returned by {@link #onUpdateNotification()} for making session service forground service * Returned by {@link #onUpdateNotification()} for making session service foreground service * to keep playback running in the background. It's highly recommended to show media style * notification here. */ Loading @@ -229,7 +229,7 @@ public abstract class MediaSessionService2 extends Service { return mProvider.getNotificationId_impl(); } public Notification getNotification() { public @NonNull Notification getNotification() { return mProvider.getNotification_impl(); } } Loading media/java/android/media/Rating2.java +3 −3 Original line number Diff line number Diff line Loading @@ -152,7 +152,8 @@ public final class Rating2 { * or {@link #RATING_PERCENTAGE}. * @return null if an invalid rating style is passed, a new Rating2 instance otherwise. */ public static @Nullable Rating2 newUnratedRating(@NonNull Context context, @Style int ratingStyle) { public static @Nullable Rating2 newUnratedRating(@NonNull Context context, @Style int ratingStyle) { return ApiLoader.getProvider(context).newUnratedRating_Rating2(context, ratingStyle); } Loading Loading @@ -225,8 +226,7 @@ public final class Rating2 { * {@link #RATING_3_STARS}, {@link #RATING_4_STARS}, {@link #RATING_5_STARS}, * or {@link #RATING_PERCENTAGE}. */ @Style public int getRatingStyle() { public @Style int getRatingStyle() { return mProvider.getRatingStyle_impl(); } Loading Loading
media/java/android/media/MediaLibraryService2.java +4 −4 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ public abstract class MediaLibraryService2 extends MediaSessionService2 { * Callback for the {@link MediaLibrarySession}. */ public static class MediaLibrarySessionCallback extends MediaSession2.SessionCallback { public MediaLibrarySessionCallback(Context context) { public MediaLibrarySessionCallback(@NonNull Context context) { super(context); } Loading Loading @@ -226,7 +226,7 @@ public abstract class MediaLibraryService2 extends MediaSessionService2 { } @Override public Builder setVolumeProvider(@NonNull VolumeProvider2 volumeProvider) { public Builder setVolumeProvider(@Nullable VolumeProvider2 volumeProvider) { return super.setVolumeProvider(volumeProvider); } Loading @@ -236,12 +236,12 @@ public abstract class MediaLibraryService2 extends MediaSessionService2 { } @Override public Builder setId(String id) { public Builder setId(@NonNull String id) { return super.setId(id); } @Override public Builder setSessionCallback(@NonNull Executor executor, public Builder setSessionCallback(@NonNull @CallbackExecutor Executor executor, @NonNull MediaLibrarySessionCallback callback) { return super.setSessionCallback(executor, callback); } Loading
media/java/android/media/MediaMetadata2.java +7 −5 Original line number Diff line number Diff line Loading @@ -562,7 +562,7 @@ public final class MediaMetadata2 { * @param key The key the value is stored under * @return a CharSequence value, or null */ public @Nullable CharSequence getText(@TextKey String key) { public @Nullable CharSequence getText(@NonNull @TextKey String key) { return mProvider.getText_impl(key); } Loading Loading @@ -611,7 +611,7 @@ public final class MediaMetadata2 { * @param key The key the value is stored under * @return A {@link Rating2} or {@code null} */ public @Nullable Rating2 getRating(@RatingKey String key) { public @Nullable Rating2 getRating(@NonNull @RatingKey String key) { return mProvider.getRating_impl(key); } Loading @@ -622,7 +622,7 @@ public final class MediaMetadata2 { * @param key The key the value is stored under * @return A {@link Bitmap} or null */ public Bitmap getBitmap(@BitmapKey String key) { public @Nullable Bitmap getBitmap(@NonNull @BitmapKey String key) { return mProvider.getBitmap_impl(key); } Loading Loading @@ -749,7 +749,8 @@ public final class MediaMetadata2 { * @param value The CharSequence value to store * @return The Builder to allow chaining */ public @NonNull Builder putText(@TextKey String key, @Nullable CharSequence value) { public @NonNull Builder putText(@NonNull @TextKey String key, @Nullable CharSequence value) { return mProvider.putText_impl(key, value); } Loading Loading @@ -780,7 +781,8 @@ public final class MediaMetadata2 { * @param value The String value to store * @return The Builder to allow chaining */ public @NonNull Builder putString(@TextKey String key, @Nullable String value) { public @NonNull Builder putString(@NonNull @TextKey String key, @Nullable String value) { return mProvider.putString_impl(key, value); } Loading
media/java/android/media/MediaSession2.java +41 −38 Original line number Diff line number Diff line Loading @@ -490,7 +490,7 @@ public class MediaSession2 implements AutoCloseable { * @return a new Command instance from the Bundle * @hide */ public static Command fromBundle(@NonNull Context context, Bundle command) { public static Command fromBundle(@NonNull Context context, @NonNull Bundle command) { return ApiLoader.getProvider(context).fromBundle_MediaSession2Command(context, command); } } Loading @@ -501,17 +501,17 @@ public class MediaSession2 implements AutoCloseable { public static final class CommandGroup { private final CommandGroupProvider mProvider; public CommandGroup(Context context) { public CommandGroup(@NonNull Context context) { mProvider = ApiLoader.getProvider(context) .createMediaSession2CommandGroup(context, this, null); } public CommandGroup(Context context, CommandGroup others) { public CommandGroup(@NonNull Context context, @Nullable CommandGroup others) { mProvider = ApiLoader.getProvider(context) .createMediaSession2CommandGroup(context, this, others); } public void addCommand(Command command) { public void addCommand(@NonNull Command command) { mProvider.addCommand_impl(command); } Loading @@ -519,11 +519,11 @@ public class MediaSession2 implements AutoCloseable { mProvider.addAllPredefinedCommands_impl(); } public void removeCommand(Command command) { public void removeCommand(@NonNull Command command) { mProvider.removeCommand_impl(command); } public boolean hasCommand(Command command) { public boolean hasCommand(@NonNull Command command) { return mProvider.hasCommand_impl(command); } Loading @@ -531,14 +531,14 @@ public class MediaSession2 implements AutoCloseable { return mProvider.hasCommand_impl(code); } public List<Command> getCommands() { public @NonNull List<Command> getCommands() { return mProvider.getCommands_impl(); } /** * @hide */ public CommandGroupProvider getProvider() { public @NonNull CommandGroupProvider getProvider() { return mProvider; } Loading @@ -546,7 +546,7 @@ public class MediaSession2 implements AutoCloseable { * @return new bundle from the CommandGroup * @hide */ public Bundle toBundle() { public @NonNull Bundle toBundle() { return mProvider.toBundle_impl(); } Loading @@ -570,7 +570,10 @@ public class MediaSession2 implements AutoCloseable { public static abstract class SessionCallback { private final Context mContext; public SessionCallback(Context context) { public SessionCallback(@NonNull Context context) { if (context == null) { throw new IllegalArgumentException("context shouldn't be null"); } mContext = context; } Loading @@ -584,7 +587,7 @@ public class MediaSession2 implements AutoCloseable { * * @param session the session for this event * @param controller controller information. * @return allowed commands. Can be {@code null} to reject coonnection. * @return allowed commands. Can be {@code null} to reject connection. */ public @Nullable CommandGroup onConnect(@NonNull MediaSession2 session, @NonNull ControllerInfo controller) { Loading Loading @@ -906,7 +909,7 @@ public class MediaSession2 implements AutoCloseable { * * @param player a {@link MediaPlayerBase} that handles actual media playback in your app. */ U setPlayer(@NonNull MediaPlayerBase player) { @NonNull U setPlayer(@NonNull MediaPlayerBase player) { mProvider.setPlayer_impl(player); return (U) this; } Loading @@ -933,7 +936,7 @@ public class MediaSession2 implements AutoCloseable { * * @param volumeProvider The provider that will receive volume button events. */ U setVolumeProvider(@NonNull VolumeProvider2 volumeProvider) { @NonNull U setVolumeProvider(@Nullable VolumeProvider2 volumeProvider) { mProvider.setVolumeProvider_impl(volumeProvider); return (U) this; } Loading @@ -945,7 +948,7 @@ public class MediaSession2 implements AutoCloseable { * * @param pi The intent to launch to show UI for this session. */ U setSessionActivity(@Nullable PendingIntent pi) { @NonNull U setSessionActivity(@Nullable PendingIntent pi) { mProvider.setSessionActivity_impl(pi); return (U) this; } Loading @@ -960,7 +963,7 @@ public class MediaSession2 implements AutoCloseable { * @throws IllegalArgumentException if id is {@code null} * @return */ U setId(@NonNull String id) { @NonNull U setId(@NonNull String id) { mProvider.setId_impl(id); return (U) this; } Loading @@ -972,7 +975,7 @@ public class MediaSession2 implements AutoCloseable { * @param callback session callback. * @return */ U setSessionCallback(@NonNull @CallbackExecutor Executor executor, @NonNull U setSessionCallback(@NonNull @CallbackExecutor Executor executor, @NonNull C callback) { mProvider.setSessionCallback_impl(executor, callback); return (U) this; Loading @@ -985,7 +988,7 @@ public class MediaSession2 implements AutoCloseable { * @throws IllegalStateException if the session with the same id is already exists for the * package. */ T build() { @NonNull T build() { return mProvider.build_impl(); } } Loading @@ -1005,7 +1008,7 @@ public class MediaSession2 implements AutoCloseable { } @Override public Builder setPlayer(@NonNull MediaPlayerBase player) { public @NonNull Builder setPlayer(@NonNull MediaPlayerBase player) { return super.setPlayer(player); } Loading @@ -1015,28 +1018,28 @@ public class MediaSession2 implements AutoCloseable { } @Override public Builder setVolumeProvider(@NonNull VolumeProvider2 volumeProvider) { public @NonNull Builder setVolumeProvider(@Nullable VolumeProvider2 volumeProvider) { return super.setVolumeProvider(volumeProvider); } @Override public Builder setSessionActivity(@Nullable PendingIntent pi) { public @NonNull Builder setSessionActivity(@Nullable PendingIntent pi) { return super.setSessionActivity(pi); } @Override public Builder setId(@NonNull String id) { public @NonNull Builder setId(@NonNull String id) { return super.setId(id); } @Override public Builder setSessionCallback(@NonNull Executor executor, public @NonNull Builder setSessionCallback(@NonNull Executor executor, @Nullable SessionCallback callback) { return super.setSessionCallback(executor, callback); } @Override public MediaSession2 build() { public @NonNull MediaSession2 build() { return super.build(); } } Loading @@ -1050,8 +1053,8 @@ public class MediaSession2 implements AutoCloseable { /** * @hide */ public ControllerInfo(Context context, int uid, int pid, String packageName, IInterface callback) { public ControllerInfo(@NonNull Context context, int uid, int pid, @NonNull String packageName, @NonNull IInterface callback) { mProvider = ApiLoader.getProvider(context) .createMediaSession2ControllerInfo( context, this, uid, pid, packageName, callback); Loading @@ -1060,7 +1063,7 @@ public class MediaSession2 implements AutoCloseable { /** * @return package name of the controller */ public String getPackageName() { public @NonNull String getPackageName() { return mProvider.getPackageName_impl(); } Loading @@ -1085,7 +1088,7 @@ public class MediaSession2 implements AutoCloseable { /** * @hide */ public ControllerInfoProvider getProvider() { public @NonNull ControllerInfoProvider getProvider() { return mProvider; } Loading Loading @@ -1171,7 +1174,7 @@ public class MediaSession2 implements AutoCloseable { /** * @hide */ public CommandButtonProvider getProvider() { public @NonNull CommandButtonProvider getProvider() { return mProvider; } Loading @@ -1186,27 +1189,27 @@ public class MediaSession2 implements AutoCloseable { .createMediaSession2CommandButtonBuilder(context, this); } public Builder setCommand(Command command) { public @NonNull Builder setCommand(@Nullable Command command) { return mProvider.setCommand_impl(command); } public Builder setIconResId(int resId) { public @NonNull Builder setIconResId(int resId) { return mProvider.setIconResId_impl(resId); } public Builder setDisplayName(String displayName) { public @NonNull Builder setDisplayName(@Nullable String displayName) { return mProvider.setDisplayName_impl(displayName); } public Builder setEnabled(boolean enabled) { public @NonNull Builder setEnabled(boolean enabled) { return mProvider.setEnabled_impl(enabled); } public Builder setExtras(Bundle extras) { public @NonNull Builder setExtras(@Nullable Bundle extras) { return mProvider.setExtras_impl(extras); } public CommandButton build() { public @NonNull CommandButton build() { return mProvider.build_impl(); } } Loading Loading @@ -1365,7 +1368,7 @@ public class MediaSession2 implements AutoCloseable { /** * @hide */ public MediaSession2Provider getProvider() { public @NonNull MediaSession2Provider getProvider() { return mProvider; } Loading Loading @@ -1432,7 +1435,7 @@ public class MediaSession2 implements AutoCloseable { * * @param afr the full request parameters */ public void setAudioFocusRequest(AudioFocusRequest afr) { public void setAudioFocusRequest(@Nullable AudioFocusRequest afr) { // TODO(jaewan): implement this (b/72529899) // mProvider.setAudioFocusRequest_impl(focusGain); } Loading Loading @@ -1745,7 +1748,7 @@ public class MediaSession2 implements AutoCloseable { * @throws IllegalArgumentException if the play list is null * @throws NullPointerException if index is outside play list range */ public void skipToPlaylistItem(MediaItem2 item) { public void skipToPlaylistItem(@NonNull MediaItem2 item) { mProvider.skipToPlaylistItem_impl(item); } Loading Loading @@ -1785,7 +1788,7 @@ public class MediaSession2 implements AutoCloseable { * * @throws IllegalArgumentException if the play list is null */ public void removePlaylistItem(MediaItem2 item) { public void removePlaylistItem(@NonNull MediaItem2 item) { mProvider.removePlaylistItem_impl(item); } Loading
media/java/android/media/MediaSessionService2.java +3 −3 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ public abstract class MediaSessionService2 extends Service { * * @return a {@link MediaNotification}. If it's {@code null}, notification wouldn't be shown. */ public MediaNotification onUpdateNotification() { public @Nullable MediaNotification onUpdateNotification() { return mProvider.onUpdateNotification_impl(); } Loading Loading @@ -202,7 +202,7 @@ public abstract class MediaSessionService2 extends Service { } /** * Returned by {@link #onUpdateNotification()} for making session service forground service * Returned by {@link #onUpdateNotification()} for making session service foreground service * to keep playback running in the background. It's highly recommended to show media style * notification here. */ Loading @@ -229,7 +229,7 @@ public abstract class MediaSessionService2 extends Service { return mProvider.getNotificationId_impl(); } public Notification getNotification() { public @NonNull Notification getNotification() { return mProvider.getNotification_impl(); } } Loading
media/java/android/media/Rating2.java +3 −3 Original line number Diff line number Diff line Loading @@ -152,7 +152,8 @@ public final class Rating2 { * or {@link #RATING_PERCENTAGE}. * @return null if an invalid rating style is passed, a new Rating2 instance otherwise. */ public static @Nullable Rating2 newUnratedRating(@NonNull Context context, @Style int ratingStyle) { public static @Nullable Rating2 newUnratedRating(@NonNull Context context, @Style int ratingStyle) { return ApiLoader.getProvider(context).newUnratedRating_Rating2(context, ratingStyle); } Loading Loading @@ -225,8 +226,7 @@ public final class Rating2 { * {@link #RATING_3_STARS}, {@link #RATING_4_STARS}, {@link #RATING_5_STARS}, * or {@link #RATING_PERCENTAGE}. */ @Style public int getRatingStyle() { public @Style int getRatingStyle() { return mProvider.getRatingStyle_impl(); } Loading