Remove deprecated usage of MediaSession APIs

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209152304
This commit is contained in:
olly 2018-08-17 08:26:41 -07:00 committed by Oliver Woodman
parent b34c46415d
commit 0831f6cab3
3 changed files with 2 additions and 17 deletions

View file

@ -839,7 +839,6 @@ public final class CastPlayer implements Player {
@Override @Override
public void onAdBreakStatusUpdated() {} public void onAdBreakStatusUpdated() {}
// SessionManagerListener implementation. // SessionManagerListener implementation.
@Override @Override

View file

@ -248,8 +248,6 @@ public final class MediaSessionConnector {
* description)}. * description)}.
*/ */
void onRemoveQueueItem(Player player, MediaDescriptionCompat description); void onRemoveQueueItem(Player player, MediaDescriptionCompat description);
/** See {@link MediaSessionCompat.Callback#onRemoveQueueItemAt(int index)}. */
void onRemoveQueueItemAt(Player player, int index);
} }
/** Callback receiving a user rating for the active media item. */ /** Callback receiving a user rating for the active media item. */
@ -1022,12 +1020,5 @@ public final class MediaSessionConnector {
queueEditor.onRemoveQueueItem(player, description); queueEditor.onRemoveQueueItem(player, description);
} }
} }
@Override
public void onRemoveQueueItemAt(int index) {
if (queueEditor != null) {
queueEditor.onRemoveQueueItemAt(player, index);
}
}
} }
} }

View file

@ -184,18 +184,13 @@ public final class TimelineQueueEditor
List<MediaSessionCompat.QueueItem> queue = mediaController.getQueue(); List<MediaSessionCompat.QueueItem> queue = mediaController.getQueue();
for (int i = 0; i < queue.size(); i++) { for (int i = 0; i < queue.size(); i++) {
if (equalityChecker.equals(queue.get(i).getDescription(), description)) { if (equalityChecker.equals(queue.get(i).getDescription(), description)) {
onRemoveQueueItemAt(player, i); queueDataAdapter.remove(i);
queueMediaSource.removeMediaSource(i);
return; return;
} }
} }
} }
@Override
public void onRemoveQueueItemAt(Player player, int index) {
queueDataAdapter.remove(index);
queueMediaSource.removeMediaSource(index);
}
// CommandReceiver implementation. // CommandReceiver implementation.
@NonNull @NonNull