mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Update @SuppressWarnings
annotations for go/nullness diagnostics
in preparation for upgrading the version of the Checker Framework in google3. More information: go/checker-3110-lsc PiperOrigin-RevId: 378184078
This commit is contained in:
parent
1ca0efdd9b
commit
628ebeeb2b
@ -352,7 +352,7 @@ import java.util.concurrent.TimeoutException;
|
||||
// TODO(internal b/160846312): Remove warning suppression and mark item @Nullable once we depend
|
||||
// on media2 1.2.0.
|
||||
@Override
|
||||
@SuppressWarnings("nullness:override.param.invalid")
|
||||
@SuppressWarnings({"nullness:override.param.invalid", "nullness:override.param"})
|
||||
public void onCurrentMediaItemChanged(SessionPlayer player, MediaItem item) {
|
||||
currentMediaItemBuffered = isBufferedState(player.getBufferingState());
|
||||
updateAllowedCommands();
|
||||
|
@ -243,7 +243,7 @@ public class DefaultTimeBar extends View implements TimeBar {
|
||||
}
|
||||
|
||||
// Suppress warnings due to usage of View methods in the constructor.
|
||||
@SuppressWarnings("nullness:method.invocation.invalid")
|
||||
@SuppressWarnings({"nullness:method.invocation.invalid", "nullness:method.invocation"})
|
||||
public DefaultTimeBar(
|
||||
Context context,
|
||||
@Nullable AttributeSet attrs,
|
||||
|
@ -361,9 +361,9 @@ public class PlayerControlView extends FrameLayout {
|
||||
}
|
||||
|
||||
@SuppressWarnings({
|
||||
"nullness:argument.type.incompatible",
|
||||
"nullness:method.invocation.invalid",
|
||||
"nullness:methodref.receiver.bound.invalid"
|
||||
"nullness:argument.type.incompatible", "nullness:argument",
|
||||
"nullness:method.invocation.invalid", "nullness:method.invocation",
|
||||
"nullness:methodref.receiver.bound.invalid", "nullness:methodref.receiver.bound"
|
||||
})
|
||||
public PlayerControlView(
|
||||
Context context,
|
||||
|
@ -704,7 +704,10 @@ public class PlayerNotificationManager {
|
||||
// This fails the nullness checker because handleMessage() is 'called' while `this` is still
|
||||
// @UnderInitialization. No tasks are scheduled on mainHandler before the constructor completes,
|
||||
// so this is safe and we can suppress the warning.
|
||||
@SuppressWarnings("nullness:methodref.receiver.bound.invalid")
|
||||
@SuppressWarnings({
|
||||
"nullness:methodref.receiver.bound.invalid",
|
||||
"nullness:methodref.receiver.bound"
|
||||
})
|
||||
Handler mainHandler = Util.createHandler(Looper.getMainLooper(), this::handleMessage);
|
||||
this.mainHandler = mainHandler;
|
||||
notificationManager = NotificationManagerCompat.from(context);
|
||||
@ -1461,7 +1464,7 @@ public class PlayerNotificationManager {
|
||||
return PendingIntent.getBroadcast(context, instanceId, intent, pendingFlags);
|
||||
}
|
||||
|
||||
@SuppressWarnings("nullness:argument.type.incompatible")
|
||||
@SuppressWarnings({"nullness:argument.type.incompatible", "nullness:argument"})
|
||||
private static void setLargeIcon(NotificationCompat.Builder builder, @Nullable Bitmap largeIcon) {
|
||||
builder.setLargeIcon(largeIcon);
|
||||
}
|
||||
|
@ -324,7 +324,12 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
|
||||
this(context, attrs, /* defStyleAttr= */ 0);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"nullness:argument.type.incompatible", "nullness:method.invocation.invalid"})
|
||||
@SuppressWarnings({
|
||||
"nullness:argument.type.incompatible",
|
||||
"nullness:argument",
|
||||
"nullness:method.invocation.invalid",
|
||||
"nullness:method.invocation"
|
||||
})
|
||||
public PlayerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
|
||||
|
@ -470,10 +470,10 @@ public class StyledPlayerControlView extends FrameLayout {
|
||||
}
|
||||
|
||||
@SuppressWarnings({
|
||||
"nullness:argument.type.incompatible",
|
||||
"nullness:assignment.type.incompatible",
|
||||
"nullness:method.invocation.invalid",
|
||||
"nullness:methodref.receiver.bound.invalid"
|
||||
"nullness:argument.type.incompatible", "nullness:argument",
|
||||
"nullness:assignment.type.incompatible", "nullness:assignment",
|
||||
"nullness:method.invocation.invalid", "nullness:method.invocation",
|
||||
"nullness:methodref.receiver.bound.invalid", "nullness:methodref.receiver.bound"
|
||||
})
|
||||
public StyledPlayerControlView(
|
||||
Context context,
|
||||
|
@ -84,8 +84,8 @@ import java.util.List;
|
||||
private boolean animationEnabled;
|
||||
|
||||
@SuppressWarnings({
|
||||
"nullness:method.invocation.invalid",
|
||||
"nullness:methodref.receiver.bound.invalid"
|
||||
"nullness:method.invocation.invalid", "nullness:method.invocation",
|
||||
"nullness:methodref.receiver.bound.invalid", "nullness:methodref.receiver.bound"
|
||||
})
|
||||
public StyledPlayerControlViewLayoutManager(StyledPlayerControlView styledPlayerControlView) {
|
||||
this.styledPlayerControlView = styledPlayerControlView;
|
||||
|
@ -325,7 +325,12 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider {
|
||||
this(context, attrs, /* defStyleAttr= */ 0);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"nullness:argument.type.incompatible", "nullness:method.invocation.invalid"})
|
||||
@SuppressWarnings({
|
||||
"nullness:argument.type.incompatible",
|
||||
"nullness:argument",
|
||||
"nullness:method.invocation.invalid",
|
||||
"nullness:method.invocation"
|
||||
})
|
||||
public StyledPlayerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
|
||||
|
@ -256,7 +256,7 @@ public final class TrackSelectionDialogBuilder {
|
||||
}
|
||||
|
||||
// Reflection calls can't verify null safety of return values or parameters.
|
||||
@SuppressWarnings("nullness:argument.type.incompatible")
|
||||
@SuppressWarnings({"nullness:argument.type.incompatible", "nullness:argument"})
|
||||
@Nullable
|
||||
private Dialog buildForAndroidX() {
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user