Skip to content

Commit

Permalink
Annotate parameters in RepeatModeUtil
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 692129684
(cherry picked from commit 544d7aa)
  • Loading branch information
tonihei authored and ivanbuper committed Nov 5, 2024
1 parent 664dc6e commit aad746b
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ private RepeatModeUtil() {
/**
* Gets the next repeat mode out of {@code enabledModes} starting from {@code currentMode}.
*
* @param currentMode The current repeat mode.
* @param enabledModes Bitmask of enabled modes.
* @param currentMode The current {@link Player.RepeatMode}.
* @param enabledModes The bitmask of enabled {@link RepeatToggleModes}.
* @return The next repeat mode.
*/
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++) {
@Player.RepeatMode int proposedMode = (currentMode + offset) % 3;
if (isRepeatModeEnabled(proposedMode, enabledModes)) {
Expand All @@ -79,13 +79,15 @@ private 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 enabledModes The bitmask representing the enabled modes.
* @param repeatMode The {@link Player.RepeatMode} to check.
* @param enabledModes The bitmask of enabled {@link RepeatToggleModes}.
* @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) {
case Player.REPEAT_MODE_OFF:
return true;
Expand Down

0 comments on commit aad746b

Please sign in to comment.