Commit 5fe0cf6a by ibaker Committed by microkatz

Mark effectively-final PlayerControlView fields as actually final

This means the null checker can be more sure that these fields don't
get reassigned between a null-check and a usage.

PiperOrigin-RevId: 481142004
(cherry picked from commit e97b25a6)
parent 80a242d1
...@@ -256,11 +256,23 @@ public class PlayerControlView extends FrameLayout { ...@@ -256,11 +256,23 @@ public class PlayerControlView extends FrameLayout {
private static final int SETTINGS_PLAYBACK_SPEED_POSITION = 0; private static final int SETTINGS_PLAYBACK_SPEED_POSITION = 0;
private static final int SETTINGS_AUDIO_TRACK_SELECTION_POSITION = 1; private static final int SETTINGS_AUDIO_TRACK_SELECTION_POSITION = 1;
private final PlayerControlViewLayoutManager controlViewLayoutManager;
private final Resources resources;
private final ComponentListener componentListener; private final ComponentListener componentListener;
@SuppressWarnings("deprecation") // Using the deprecated type for now. @SuppressWarnings("deprecation") // Using the deprecated type for now.
private final CopyOnWriteArrayList<VisibilityListener> visibilityListeners; private final CopyOnWriteArrayList<VisibilityListener> visibilityListeners;
private final RecyclerView settingsView;
private final SettingsAdapter settingsAdapter;
private final PlaybackSpeedAdapter playbackSpeedAdapter;
private final TextTrackSelectionAdapter textTrackSelectionAdapter;
private final AudioTrackSelectionAdapter audioTrackSelectionAdapter;
// TODO(insun): Add setTrackNameProvider to use customized track name provider.
private final TrackNameProvider trackNameProvider;
private final PopupWindow settingsWindow;
private final int settingsWindowMargin;
@Nullable private final View previousButton; @Nullable private final View previousButton;
@Nullable private final View nextButton; @Nullable private final View nextButton;
@Nullable private final View playPauseButton; @Nullable private final View playPauseButton;
...@@ -271,6 +283,12 @@ public class PlayerControlView extends FrameLayout { ...@@ -271,6 +283,12 @@ public class PlayerControlView extends FrameLayout {
@Nullable private final ImageView repeatToggleButton; @Nullable private final ImageView repeatToggleButton;
@Nullable private final ImageView shuffleButton; @Nullable private final ImageView shuffleButton;
@Nullable private final View vrButton; @Nullable private final View vrButton;
@Nullable private final ImageView subtitleButton;
@Nullable private final ImageView fullScreenButton;
@Nullable private final ImageView minimalFullScreenButton;
@Nullable private final View settingsButton;
@Nullable private final View playbackSpeedButton;
@Nullable private final View audioTrackButton;
@Nullable private final TextView durationView; @Nullable private final TextView durationView;
@Nullable private final TextView positionView; @Nullable private final TextView positionView;
@Nullable private final TimeBar timeBar; @Nullable private final TimeBar timeBar;
...@@ -319,27 +337,7 @@ public class PlayerControlView extends FrameLayout { ...@@ -319,27 +337,7 @@ public class PlayerControlView extends FrameLayout {
private boolean[] extraPlayedAdGroups; private boolean[] extraPlayedAdGroups;
private long currentWindowOffset; private long currentWindowOffset;
private PlayerControlViewLayoutManager controlViewLayoutManager;
private Resources resources;
private RecyclerView settingsView;
private SettingsAdapter settingsAdapter;
private PlaybackSpeedAdapter playbackSpeedAdapter;
private PopupWindow settingsWindow;
private boolean needToHideBars; private boolean needToHideBars;
private int settingsWindowMargin;
private TextTrackSelectionAdapter textTrackSelectionAdapter;
private AudioTrackSelectionAdapter audioTrackSelectionAdapter;
// TODO(insun): Add setTrackNameProvider to use customized track name provider.
private TrackNameProvider trackNameProvider;
@Nullable private ImageView subtitleButton;
@Nullable private ImageView fullScreenButton;
@Nullable private ImageView minimalFullScreenButton;
@Nullable private View settingsButton;
@Nullable private View playbackSpeedButton;
@Nullable private View audioTrackButton;
public PlayerControlView(Context context) { public PlayerControlView(Context context) {
this(context, /* attrs= */ null); this(context, /* attrs= */ null);
......
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