Annotate parameters in RepeatModeUtil

PiperOrigin-RevId: 692129684
(cherry picked from commit 544d7aa2dc5147ec4e04501269f89f96a7397a09)
This commit is contained in:
tonihei 2024-11-01 04:29:25 -07:00 committed by Iván Budnik
parent 664dc6e482
commit aad746b05c

View File

@ -63,12 +63,12 @@ public final class RepeatModeUtil {
/** /**
* Gets the next repeat mode out of {@code enabledModes} starting from {@code currentMode}. * Gets the next repeat mode out of {@code enabledModes} starting from {@code currentMode}.
* *
* @param currentMode The current repeat mode. * @param currentMode The current {@link Player.RepeatMode}.
* @param enabledModes Bitmask of enabled modes. * @param enabledModes The bitmask of enabled {@link RepeatToggleModes}.
* @return The next repeat mode. * @return The next repeat mode.
*/ */
public static @Player.RepeatMode int getNextRepeatMode( public static @Player.RepeatMode int getNextRepeatMode(
@Player.RepeatMode int currentMode, int enabledModes) { @Player.RepeatMode int currentMode, @RepeatToggleModes int enabledModes) {
for (int offset = 1; offset <= 2; offset++) { for (int offset = 1; offset <= 2; offset++) {
@Player.RepeatMode int proposedMode = (currentMode + offset) % 3; @Player.RepeatMode int proposedMode = (currentMode + offset) % 3;
if (isRepeatModeEnabled(proposedMode, enabledModes)) { if (isRepeatModeEnabled(proposedMode, enabledModes)) {
@ -79,13 +79,15 @@ public final class RepeatModeUtil {
} }
/** /**
* Verifies whether a given {@code repeatMode} is enabled in the bitmask {@code enabledModes}. * Verifies whether a given {@link Player.RepeatMode} is enabled in the bitmask of {@link
* RepeatToggleModes}.
* *
* @param repeatMode The mode to check. * @param repeatMode The {@link Player.RepeatMode} to check.
* @param enabledModes The bitmask representing the enabled modes. * @param enabledModes The bitmask of enabled {@link RepeatToggleModes}.
* @return {@code true} if enabled. * @return {@code true} if enabled.
*/ */
public static boolean isRepeatModeEnabled(@Player.RepeatMode int repeatMode, int enabledModes) { public static boolean isRepeatModeEnabled(
@Player.RepeatMode int repeatMode, @RepeatToggleModes int enabledModes) {
switch (repeatMode) { switch (repeatMode) {
case Player.REPEAT_MODE_OFF: case Player.REPEAT_MODE_OFF:
return true; return true;