Commit 81d68317 by ibaker Committed by Ian Baker

Fix or suppress nullness warnings introduced by checkerframework 3.7.0

PiperOrigin-RevId: 340826532
parent 3f9488b7
...@@ -610,10 +610,12 @@ public class PlayerNotificationManager { ...@@ -610,10 +610,12 @@ public class PlayerNotificationManager {
controlDispatcher = new DefaultControlDispatcher(); controlDispatcher = new DefaultControlDispatcher();
window = new Timeline.Window(); window = new Timeline.Window();
instanceId = instanceIdCounter++; instanceId = instanceIdCounter++;
//noinspection Convert2MethodRef // This fails the nullness checker because handleMessage() is 'called' while `this` is still
mainHandler = // @UnderInitialization. No tasks are scheduled on mainHandler before the constructor completes,
Util.createHandler( // so this is safe and we can suppress the warning.
Looper.getMainLooper(), msg -> PlayerNotificationManager.this.handleMessage(msg)); @SuppressWarnings("nullness:methodref.receiver.bound.invalid")
Handler mainHandler = Util.createHandler(Looper.getMainLooper(), this::handleMessage);
this.mainHandler = mainHandler;
notificationManager = NotificationManagerCompat.from(context); notificationManager = NotificationManagerCompat.from(context);
playerListener = new PlayerListener(); playerListener = new PlayerListener();
notificationBroadcastReceiver = new NotificationBroadcastReceiver(); notificationBroadcastReceiver = new NotificationBroadcastReceiver();
......
...@@ -1920,7 +1920,7 @@ public class StyledPlayerControlView extends FrameLayout { ...@@ -1920,7 +1920,7 @@ public class StyledPlayerControlView extends FrameLayout {
} }
} }
private class SettingViewHolder extends RecyclerView.ViewHolder { private final class SettingViewHolder extends RecyclerView.ViewHolder {
private final TextView mainTextView; private final TextView mainTextView;
private final TextView subTextView; private final TextView subTextView;
private final ImageView iconView; private final ImageView iconView;
...@@ -1930,8 +1930,7 @@ public class StyledPlayerControlView extends FrameLayout { ...@@ -1930,8 +1930,7 @@ public class StyledPlayerControlView extends FrameLayout {
mainTextView = itemView.findViewById(R.id.exo_main_text); mainTextView = itemView.findViewById(R.id.exo_main_text);
subTextView = itemView.findViewById(R.id.exo_sub_text); subTextView = itemView.findViewById(R.id.exo_sub_text);
iconView = itemView.findViewById(R.id.exo_icon); iconView = itemView.findViewById(R.id.exo_icon);
itemView.setOnClickListener( itemView.setOnClickListener(v -> onSettingViewClicked(getAdapterPosition()));
v -> onSettingViewClicked(SettingViewHolder.this.getAdapterPosition()));
} }
} }
...@@ -1969,7 +1968,7 @@ public class StyledPlayerControlView extends FrameLayout { ...@@ -1969,7 +1968,7 @@ public class StyledPlayerControlView extends FrameLayout {
} }
} }
private class SubSettingViewHolder extends RecyclerView.ViewHolder { private final class SubSettingViewHolder extends RecyclerView.ViewHolder {
private final TextView textView; private final TextView textView;
private final View checkView; private final View checkView;
...@@ -1977,8 +1976,7 @@ public class StyledPlayerControlView extends FrameLayout { ...@@ -1977,8 +1976,7 @@ public class StyledPlayerControlView extends FrameLayout {
super(itemView); super(itemView);
textView = itemView.findViewById(R.id.exo_text); textView = itemView.findViewById(R.id.exo_text);
checkView = itemView.findViewById(R.id.exo_check); checkView = itemView.findViewById(R.id.exo_check);
itemView.setOnClickListener( itemView.setOnClickListener(v -> onSubSettingViewClicked(getAdapterPosition()));
v -> onSubSettingViewClicked(SubSettingViewHolder.this.getAdapterPosition()));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment