Suppress SwitchIntDef warning where it makes sense

In both cases it's deliberate that all excluded constants should use
the default branch. Furthermore, there are quite a lot of excluded
constants missing, so it's probably better to suppress the warning
than to include them all.

#minor-release

PiperOrigin-RevId: 355426749
This commit is contained in:
olly 2021-02-03 18:29:06 +00:00 committed by Oliver Woodman
parent 6bcc6791b6
commit 95d9060a30
2 changed files with 19 additions and 1 deletions

View File

@ -385,8 +385,24 @@ import java.util.concurrent.Callable;
case COMMAND_CODE_PLAYER_PAUSE:
case COMMAND_CODE_PLAYER_PREPARE:
return true;
case COMMAND_CODE_PLAYER_ADD_PLAYLIST_ITEM:
case COMMAND_CODE_PLAYER_MOVE_PLAYLIST_ITEM:
case COMMAND_CODE_PLAYER_REMOVE_PLAYLIST_ITEM:
case COMMAND_CODE_PLAYER_REPLACE_PLAYLIST_ITEM:
case COMMAND_CODE_PLAYER_SEEK_TO:
case COMMAND_CODE_PLAYER_SET_AUDIO_ATTRIBUTES:
case COMMAND_CODE_PLAYER_SET_MEDIA_ITEM:
case COMMAND_CODE_PLAYER_SET_PLAYLIST:
case COMMAND_CODE_PLAYER_SET_REPEAT_MODE:
case COMMAND_CODE_PLAYER_SET_SHUFFLE_MODE:
case COMMAND_CODE_PLAYER_SET_SPEED:
case COMMAND_CODE_PLAYER_SKIP_TO_NEXT_PLAYLIST_ITEM:
case COMMAND_CODE_PLAYER_SKIP_TO_PLAYLIST_ITEM:
case COMMAND_CODE_PLAYER_SKIP_TO_PREVIOUS_PLAYLIST_ITEM:
case COMMAND_CODE_PLAYER_UPDATE_LIST_METADATA:
default:
return false;
}
return false;
}
private static final class AsyncPlayerCommandResult {

View File

@ -17,6 +17,7 @@ package com.google.android.exoplayer2.source.hls;
import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import android.annotation.SuppressLint;
import android.net.Uri;
import android.text.TextUtils;
import androidx.annotation.Nullable;
@ -143,6 +144,7 @@ public final class DefaultHlsExtractorFactory implements HlsExtractorFactory {
fileTypes.add(fileType);
}
@SuppressLint("SwitchIntDef") // HLS only supports a small subset of the defined file types.
@Nullable
private Extractor createExtractorByFileType(
@FileTypes.Type int fileType,