TIF: Remove the uniqueness check for track ID from notifyTracksChanged
Requiring uniqueness of ID across all track types seems a little too much demand for developers and they do want to use the same ID on different track types. Also, this doesn't seem terribly useful. Hence remove the check. Bug: 28436618 Change-Id: I9040310c5ce31bcff522021d83f7508506cbd9d3
This commit is contained in:
@@ -401,20 +401,8 @@ public abstract class TvInputService extends Service {
|
||||
* with a different track ID.
|
||||
*
|
||||
* @param tracks A list which includes track information.
|
||||
* @throws IllegalArgumentException if {@code tracks} contains redundant tracks.
|
||||
*/
|
||||
public void notifyTracksChanged(final List<TvTrackInfo> tracks) {
|
||||
Set<String> trackIdSet = new HashSet<>();
|
||||
for (TvTrackInfo track : tracks) {
|
||||
String trackId = track.getId();
|
||||
if (trackIdSet.contains(trackId)) {
|
||||
throw new IllegalArgumentException("redundant track ID: " + trackId);
|
||||
}
|
||||
trackIdSet.add(trackId);
|
||||
}
|
||||
trackIdSet.clear();
|
||||
|
||||
// TODO: Validate the track list.
|
||||
final List<TvTrackInfo> tracksCopy = new ArrayList<>(tracks);
|
||||
executeOrPostRunnableOnMainThread(new Runnable() {
|
||||
@MainThread
|
||||
|
||||
Reference in New Issue
Block a user