Skip to content

Commit ba0466b

Browse files
icbakermicrokatz
authored andcommitted
Fix Dackka/Metalava errors in test_utils module
This involves reducing the visibility of methods/constructors that are already unusable outside the `androidx.media3.test.utils` package. #minor-release PiperOrigin-RevId: 487473005 (cherry picked from commit 3ab8813)
1 parent 65d923c commit ba0466b

File tree

3 files changed

+78
-78
lines changed

3 files changed

+78
-78
lines changed

libraries/test_utils/src/main/java/androidx/media3/test/utils/Action.java

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ public Action(@Size(max = 23) String tag, @Nullable String description) {
6666
this.description = description;
6767
}
6868

69+
/**
70+
* Called by {@link #doActionAndScheduleNextImpl(ExoPlayer, DefaultTrackSelector, Surface,
71+
* HandlerWrapper, ActionNode)} to perform the action.
72+
*
73+
* @param player The player to which the action should be applied.
74+
* @param trackSelector The track selector to which the action should be applied.
75+
* @param surface The surface to use when applying actions, or {@code null} if no surface is
76+
* needed.
77+
*/
78+
protected abstract void doActionImpl(
79+
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface);
80+
6981
/**
7082
* Executes the action and schedules the next.
7183
*
@@ -77,7 +89,7 @@ public Action(@Size(max = 23) String tag, @Nullable String description) {
7789
* @param nextAction The next action to schedule immediately after this action finished, or {@code
7890
* null} if there's no next action.
7991
*/
80-
public final void doActionAndScheduleNext(
92+
/* package */ final void doActionAndScheduleNext(
8193
ExoPlayer player,
8294
DefaultTrackSelector trackSelector,
8395
@Nullable Surface surface,
@@ -101,7 +113,7 @@ public final void doActionAndScheduleNext(
101113
* @param nextAction The next action to schedule immediately after this action finished, or {@code
102114
* null} if there's no next action.
103115
*/
104-
protected void doActionAndScheduleNextImpl(
116+
/* package */ void doActionAndScheduleNextImpl(
105117
ExoPlayer player,
106118
DefaultTrackSelector trackSelector,
107119
@Nullable Surface surface,
@@ -113,18 +125,6 @@ protected void doActionAndScheduleNextImpl(
113125
}
114126
}
115127

116-
/**
117-
* Called by {@link #doActionAndScheduleNextImpl(ExoPlayer, DefaultTrackSelector, Surface,
118-
* HandlerWrapper, ActionNode)} to perform the action.
119-
*
120-
* @param player The player to which the action should be applied.
121-
* @param trackSelector The track selector to which the action should be applied.
122-
* @param surface The surface to use when applying actions, or {@code null} if no surface is
123-
* needed.
124-
*/
125-
protected abstract void doActionImpl(
126-
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface);
127-
128128
/** Calls {@link Player#seekTo(long)} or {@link Player#seekTo(int, long)}. */
129129
public static final class Seek extends Action {
130130

@@ -697,7 +697,13 @@ public PlayUntilPosition(@Size(max = 23) String tag, int mediaItemIndex, long po
697697
}
698698

699699
@Override
700-
protected void doActionAndScheduleNextImpl(
700+
protected void doActionImpl(
701+
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
702+
// Not triggered.
703+
}
704+
705+
@Override
706+
/* package */ void doActionAndScheduleNextImpl(
701707
ExoPlayer player,
702708
DefaultTrackSelector trackSelector,
703709
@Nullable Surface surface,
@@ -739,12 +745,6 @@ protected void doActionAndScheduleNextImpl(
739745
}
740746
player.play();
741747
}
742-
743-
@Override
744-
protected void doActionImpl(
745-
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
746-
// Not triggered.
747-
}
748748
}
749749

750750
/** Waits for {@link Player.Listener#onTimelineChanged(Timeline, int)}. */
@@ -785,7 +785,13 @@ public WaitForTimelineChanged(String tag) {
785785
}
786786

787787
@Override
788-
protected void doActionAndScheduleNextImpl(
788+
protected void doActionImpl(
789+
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
790+
// Not triggered.
791+
}
792+
793+
@Override
794+
/* package */ void doActionAndScheduleNextImpl(
789795
ExoPlayer player,
790796
DefaultTrackSelector trackSelector,
791797
@Nullable Surface surface,
@@ -813,12 +819,6 @@ && timelinesAreSame(player.getCurrentTimeline(), expectedTimeline)) {
813819
nextAction.schedule(player, trackSelector, surface, handler);
814820
}
815821
}
816-
817-
@Override
818-
protected void doActionImpl(
819-
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
820-
// Not triggered.
821-
}
822822
}
823823

824824
/**
@@ -835,7 +835,13 @@ public WaitForPositionDiscontinuity(String tag) {
835835
}
836836

837837
@Override
838-
protected void doActionAndScheduleNextImpl(
838+
protected void doActionImpl(
839+
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
840+
// Not triggered.
841+
}
842+
843+
@Override
844+
/* package */ void doActionAndScheduleNextImpl(
839845
ExoPlayer player,
840846
DefaultTrackSelector trackSelector,
841847
@Nullable Surface surface,
@@ -856,12 +862,6 @@ public void onPositionDiscontinuity(
856862
}
857863
});
858864
}
859-
860-
@Override
861-
protected void doActionImpl(
862-
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
863-
// Not triggered.
864-
}
865865
}
866866

867867
/**
@@ -882,7 +882,13 @@ public WaitForPlayWhenReady(@Size(max = 23) String tag, boolean playWhenReady) {
882882
}
883883

884884
@Override
885-
protected void doActionAndScheduleNextImpl(
885+
protected void doActionImpl(
886+
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
887+
// Not triggered.
888+
}
889+
890+
@Override
891+
/* package */ void doActionAndScheduleNextImpl(
886892
ExoPlayer player,
887893
DefaultTrackSelector trackSelector,
888894
@Nullable Surface surface,
@@ -907,12 +913,6 @@ public void onPlayWhenReadyChanged(
907913
});
908914
}
909915
}
910-
911-
@Override
912-
protected void doActionImpl(
913-
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
914-
// Not triggered.
915-
}
916916
}
917917

918918
/**
@@ -933,7 +933,13 @@ public WaitForPlaybackState(@Size(max = 23) String tag, @Player.State int target
933933
}
934934

935935
@Override
936-
protected void doActionAndScheduleNextImpl(
936+
protected void doActionImpl(
937+
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
938+
// Not triggered.
939+
}
940+
941+
@Override
942+
/* package */ void doActionAndScheduleNextImpl(
937943
ExoPlayer player,
938944
DefaultTrackSelector trackSelector,
939945
@Nullable Surface surface,
@@ -957,12 +963,6 @@ public void onPlaybackStateChanged(@Player.State int playbackState) {
957963
});
958964
}
959965
}
960-
961-
@Override
962-
protected void doActionImpl(
963-
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
964-
// Not triggered.
965-
}
966966
}
967967

968968
/**
@@ -983,7 +983,13 @@ public WaitForMessage(@Size(max = 23) String tag, PlayerTarget playerTarget) {
983983
}
984984

985985
@Override
986-
protected void doActionAndScheduleNextImpl(
986+
protected void doActionImpl(
987+
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
988+
// Not triggered.
989+
}
990+
991+
@Override
992+
/* package */ void doActionAndScheduleNextImpl(
987993
ExoPlayer player,
988994
DefaultTrackSelector trackSelector,
989995
@Nullable Surface surface,
@@ -997,12 +1003,6 @@ protected void doActionAndScheduleNextImpl(
9971003

9981004
playerTarget.setCallback(callback);
9991005
}
1000-
1001-
@Override
1002-
protected void doActionImpl(
1003-
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
1004-
// Not triggered.
1005-
}
10061006
}
10071007

10081008
/**
@@ -1023,7 +1023,13 @@ public WaitForIsLoading(@Size(max = 23) String tag, boolean targetIsLoading) {
10231023
}
10241024

10251025
@Override
1026-
protected void doActionAndScheduleNextImpl(
1026+
protected void doActionImpl(
1027+
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
1028+
// Not triggered.
1029+
}
1030+
1031+
@Override
1032+
/* package */ void doActionAndScheduleNextImpl(
10271033
ExoPlayer player,
10281034
DefaultTrackSelector trackSelector,
10291035
@Nullable Surface surface,
@@ -1047,12 +1053,6 @@ public void onIsLoadingChanged(boolean isLoading) {
10471053
});
10481054
}
10491055
}
1050-
1051-
@Override
1052-
protected void doActionImpl(
1053-
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
1054-
// Not triggered.
1055-
}
10561056
}
10571057

10581058
/** Waits until the player acknowledged all pending player commands. */
@@ -1066,7 +1066,13 @@ public WaitForPendingPlayerCommands(String tag) {
10661066
}
10671067

10681068
@Override
1069-
protected void doActionAndScheduleNextImpl(
1069+
protected void doActionImpl(
1070+
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
1071+
// Not triggered.
1072+
}
1073+
1074+
@Override
1075+
/* package */ void doActionAndScheduleNextImpl(
10701076
ExoPlayer player,
10711077
DefaultTrackSelector trackSelector,
10721078
@Nullable Surface surface,
@@ -1084,12 +1090,6 @@ protected void doActionAndScheduleNextImpl(
10841090
.setLooper(Util.getCurrentOrMainLooper())
10851091
.send();
10861092
}
1087-
1088-
@Override
1089-
protected void doActionImpl(
1090-
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
1091-
// Not triggered.
1092-
}
10931093
}
10941094

10951095
/** Calls {@code Runnable.run()}. */

libraries/test_utils/src/main/java/androidx/media3/test/utils/ActionSchedule.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,13 @@ public void setCallback(@Nullable Callback callback) {
829829
}
830830

831831
@Override
832-
protected void doActionAndScheduleNextImpl(
832+
protected void doActionImpl(
833+
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
834+
// Not triggered.
835+
}
836+
837+
@Override
838+
/* package */ void doActionAndScheduleNextImpl(
833839
ExoPlayer player,
834840
DefaultTrackSelector trackSelector,
835841
@Nullable Surface surface,
@@ -841,11 +847,5 @@ protected void doActionAndScheduleNextImpl(
841847
handler.post(callback::onActionScheduleFinished);
842848
}
843849
}
844-
845-
@Override
846-
protected void doActionImpl(
847-
ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface) {
848-
// Not triggered.
849-
}
850850
}
851851
}

libraries/test_utils/src/main/java/androidx/media3/test/utils/FakeClock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ protected final class HandlerMessage
286286
private final int arg2;
287287
@Nullable private final Object obj;
288288

289-
public HandlerMessage(
289+
private HandlerMessage(
290290
long timeMs,
291291
ClockHandler handler,
292292
int what,

0 commit comments

Comments
 (0)