Remove IntDef warning suppression from DefaultTrackSelector

The problem is not the IntDef array, it's the fact the lint tool
is unable to correctly infer the annotations on the lambda parameters
without them being explicitly annotated. It seems explicitly annotating
is better than suppressing all IntDef warnings in the whole method.

PiperOrigin-RevId: 437969271
This commit is contained in:
ibaker 2022-03-29 10:07:23 +01:00 committed by Ian Baker
parent f722114fc0
commit 9d48cff9ff

View File

@ -1736,7 +1736,6 @@ public class DefaultTrackSelector extends MappingTrackSelector {
* renderer index, or null if no selection was made.
* @throws ExoPlaybackException If an error occurs while selecting the tracks.
*/
@SuppressLint("WrongConstant") // Lint doesn't understand arrays of IntDefs.
@Nullable
protected Pair<ExoTrackSelection.Definition, Integer> selectVideoTrack(
MappedTrackInfo mappedTrackInfo,
@ -1748,7 +1747,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
C.TRACK_TYPE_VIDEO,
mappedTrackInfo,
rendererFormatSupports,
(rendererIndex, group, support) ->
(int rendererIndex, TrackGroup group, @Capabilities int[] support) ->
VideoTrackInfo.createForTrackGroup(
rendererIndex, group, params, support, mixedMimeTypeSupports[rendererIndex]),
VideoTrackInfo::compareSelections);
@ -1770,7 +1769,6 @@ public class DefaultTrackSelector extends MappingTrackSelector {
* renderer index, or null if no selection was made.
* @throws ExoPlaybackException If an error occurs while selecting the tracks.
*/
@SuppressLint("WrongConstant") // Lint doesn't understand arrays of IntDefs.
@Nullable
protected Pair<ExoTrackSelection.Definition, Integer> selectAudioTrack(
MappedTrackInfo mappedTrackInfo,
@ -1791,7 +1789,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
C.TRACK_TYPE_AUDIO,
mappedTrackInfo,
rendererFormatSupports,
(rendererIndex, group, support) ->
(int rendererIndex, TrackGroup group, @Capabilities int[] support) ->
AudioTrackInfo.createForTrackGroup(
rendererIndex, group, params, support, hasVideoRendererWithMappedTracksFinal),
AudioTrackInfo::compareSelections);
@ -1813,7 +1811,6 @@ public class DefaultTrackSelector extends MappingTrackSelector {
* renderer index, or null if no selection was made.
* @throws ExoPlaybackException If an error occurs while selecting the tracks.
*/
@SuppressLint("WrongConstant") // Lint doesn't understand arrays of IntDefs.
@Nullable
protected Pair<ExoTrackSelection.Definition, Integer> selectTextTrack(
MappedTrackInfo mappedTrackInfo,
@ -1825,7 +1822,7 @@ public class DefaultTrackSelector extends MappingTrackSelector {
C.TRACK_TYPE_TEXT,
mappedTrackInfo,
rendererFormatSupports,
(rendererIndex, group, support) ->
(int rendererIndex, TrackGroup group, @Capabilities int[] support) ->
TextTrackInfo.createForTrackGroup(
rendererIndex, group, params, support, selectedAudioLanguage),
TextTrackInfo::compareSelections);