Skip to content

Commit

Permalink
Fix Dackka/Metalava errors in test_utils module
Browse files Browse the repository at this point in the history
This involves reducing the visibility of methods/constructors that
are already unusable outside the `androidx.media3.test.utils` package.

#minor-release

PiperOrigin-RevId: 487473005
  • Loading branch information
icbaker authored and microkatz committed Nov 10, 2022
1 parent 1cd488a commit ca8de0e
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 78 deletions.
Expand Up @@ -64,6 +64,18 @@ public Action(@Size(max = 23) String tag, @Nullable String description) {
this.description = description;
}

/**
* Called by {@link #doActionAndScheduleNextImpl(ExoPlayer, DefaultTrackSelector, Surface,
* HandlerWrapper, ActionNode)} to perform the action.
*
* @param player The player to which the action should be applied.
* @param trackSelector The track selector to which the action should be applied.
* @param surface The surface to use when applying actions, or {@code null} if no surface is
* needed.
*/
protected abstract void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface);

/**
* Executes the action and schedules the next.
*
Expand All @@ -75,7 +87,7 @@ public Action(@Size(max = 23) String tag, @Nullable String description) {
* @param nextAction The next action to schedule immediately after this action finished, or {@code
* null} if there's no next action.
*/
public final void doActionAndScheduleNext(
/* package */ final void doActionAndScheduleNext(
ExoPlayer player,
DefaultTrackSelector trackSelector,
@Nullable Surface surface,
Expand All @@ -99,7 +111,7 @@ public final void doActionAndScheduleNext(
* @param nextAction The next action to schedule immediately after this action finished, or {@code
* null} if there's no next action.
*/
protected void doActionAndScheduleNextImpl(
/* package */ void doActionAndScheduleNextImpl(
ExoPlayer player,
DefaultTrackSelector trackSelector,
@Nullable Surface surface,
Expand All @@ -111,18 +123,6 @@ protected void doActionAndScheduleNextImpl(
}
}

/**
* Called by {@link #doActionAndScheduleNextImpl(ExoPlayer, DefaultTrackSelector, Surface,
* HandlerWrapper, ActionNode)} to perform the action.
*
* @param player The player to which the action should be applied.
* @param trackSelector The track selector to which the action should be applied.
* @param surface The surface to use when applying actions, or {@code null} if no surface is
* needed.
*/
protected abstract void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface);

/** Calls {@link Player#seekTo(long)} or {@link Player#seekTo(int, long)}. */
public static final class Seek extends Action {

Expand Down Expand Up @@ -695,7 +695,13 @@ public PlayUntilPosition(@Size(max = 23) String tag, int mediaItemIndex, long po
}

@Override
protected void doActionAndScheduleNextImpl(
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}

@Override
/* package */ void doActionAndScheduleNextImpl(
ExoPlayer player,
DefaultTrackSelector trackSelector,
@Nullable Surface surface,
Expand Down Expand Up @@ -737,12 +743,6 @@ protected void doActionAndScheduleNextImpl(
}
player.play();
}

@Override
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}
}

/** Waits for {@link Player.Listener#onTimelineChanged(Timeline, int)}. */
Expand Down Expand Up @@ -783,7 +783,13 @@ public WaitForTimelineChanged(String tag) {
}

@Override
protected void doActionAndScheduleNextImpl(
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}

@Override
/* package */ void doActionAndScheduleNextImpl(
ExoPlayer player,
DefaultTrackSelector trackSelector,
@Nullable Surface surface,
Expand Down Expand Up @@ -811,12 +817,6 @@ && timelinesAreSame(player.getCurrentTimeline(), expectedTimeline)) {
nextAction.schedule(player, trackSelector, surface, handler);
}
}

@Override
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}
}

/**
Expand All @@ -833,7 +833,13 @@ public WaitForPositionDiscontinuity(String tag) {
}

@Override
protected void doActionAndScheduleNextImpl(
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}

@Override
/* package */ void doActionAndScheduleNextImpl(
ExoPlayer player,
DefaultTrackSelector trackSelector,
@Nullable Surface surface,
Expand All @@ -854,12 +860,6 @@ public void onPositionDiscontinuity(
}
});
}

@Override
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}
}

/**
Expand All @@ -880,7 +880,13 @@ public WaitForPlayWhenReady(@Size(max = 23) String tag, boolean playWhenReady) {
}

@Override
protected void doActionAndScheduleNextImpl(
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}

@Override
/* package */ void doActionAndScheduleNextImpl(
ExoPlayer player,
DefaultTrackSelector trackSelector,
@Nullable Surface surface,
Expand All @@ -905,12 +911,6 @@ public void onPlayWhenReadyChanged(
});
}
}

@Override
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}
}

/**
Expand All @@ -931,7 +931,13 @@ public WaitForPlaybackState(@Size(max = 23) String tag, @Player.State int target
}

@Override
protected void doActionAndScheduleNextImpl(
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}

@Override
/* package */ void doActionAndScheduleNextImpl(
ExoPlayer player,
DefaultTrackSelector trackSelector,
@Nullable Surface surface,
Expand All @@ -955,12 +961,6 @@ public void onPlaybackStateChanged(@Player.State int playbackState) {
});
}
}

@Override
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}
}

/**
Expand All @@ -981,7 +981,13 @@ public WaitForMessage(@Size(max = 23) String tag, PlayerTarget playerTarget) {
}

@Override
protected void doActionAndScheduleNextImpl(
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}

@Override
/* package */ void doActionAndScheduleNextImpl(
ExoPlayer player,
DefaultTrackSelector trackSelector,
@Nullable Surface surface,
Expand All @@ -995,12 +1001,6 @@ protected void doActionAndScheduleNextImpl(

playerTarget.setCallback(callback);
}

@Override
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}
}

/**
Expand All @@ -1021,7 +1021,13 @@ public WaitForIsLoading(@Size(max = 23) String tag, boolean targetIsLoading) {
}

@Override
protected void doActionAndScheduleNextImpl(
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}

@Override
/* package */ void doActionAndScheduleNextImpl(
ExoPlayer player,
DefaultTrackSelector trackSelector,
@Nullable Surface surface,
Expand All @@ -1045,12 +1051,6 @@ public void onIsLoadingChanged(boolean isLoading) {
});
}
}

@Override
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}
}

/** Waits until the player acknowledged all pending player commands. */
Expand All @@ -1064,7 +1064,13 @@ public WaitForPendingPlayerCommands(String tag) {
}

@Override
protected void doActionAndScheduleNextImpl(
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}

@Override
/* package */ void doActionAndScheduleNextImpl(
ExoPlayer player,
DefaultTrackSelector trackSelector,
@Nullable Surface surface,
Expand All @@ -1082,12 +1088,6 @@ protected void doActionAndScheduleNextImpl(
.setLooper(Util.getCurrentOrMainLooper())
.send();
}

@Override
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}
}

/** Calls {@code Runnable.run()}. */
Expand Down
Expand Up @@ -827,7 +827,13 @@ public void setCallback(@Nullable Callback callback) {
}

@Override
protected void doActionAndScheduleNextImpl(
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}

@Override
/* package */ void doActionAndScheduleNextImpl(
ExoPlayer player,
DefaultTrackSelector trackSelector,
@Nullable Surface surface,
Expand All @@ -839,11 +845,5 @@ protected void doActionAndScheduleNextImpl(
handler.post(callback::onActionScheduleFinished);
}
}

@Override
protected void doActionImpl(
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
// Not triggered.
}
}
}
Expand Up @@ -284,7 +284,7 @@ protected final class HandlerMessage
private final int arg2;
@Nullable private final Object obj;

public HandlerMessage(
private HandlerMessage(
long timeMs,
ClockHandler handler,
int what,
Expand Down

0 comments on commit ca8de0e

Please sign in to comment.