mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Correctly map deprecated methods in MediaController to replacement
This avoids throwing exceptions for correct (but deprecated) Player method invocations. PiperOrigin-RevId: 502341428 (cherry picked from commit 86a95c2a4afd861986376f9dc31e0d65910e6e74)
This commit is contained in:
parent
a2aaad65a8
commit
13dc59fc0f
@ -478,7 +478,10 @@ public class MediaController implements Player {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public void stop(boolean reset) {
|
public void stop(boolean reset) {
|
||||||
throw new UnsupportedOperationException();
|
stop();
|
||||||
|
if (reset) {
|
||||||
|
clearMediaItems();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1174,7 +1177,7 @@ public class MediaController implements Player {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public boolean isCurrentWindowDynamic() {
|
public boolean isCurrentWindowDynamic() {
|
||||||
throw new UnsupportedOperationException();
|
return isCurrentMediaItemDynamic();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1191,7 +1194,7 @@ public class MediaController implements Player {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public boolean isCurrentWindowLive() {
|
public boolean isCurrentWindowLive() {
|
||||||
throw new UnsupportedOperationException();
|
return isCurrentMediaItemLive();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1208,7 +1211,7 @@ public class MediaController implements Player {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public boolean isCurrentWindowSeekable() {
|
public boolean isCurrentWindowSeekable() {
|
||||||
throw new UnsupportedOperationException();
|
return isCurrentMediaItemSeekable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1260,7 +1263,7 @@ public class MediaController implements Player {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public int getCurrentWindowIndex() {
|
public int getCurrentWindowIndex() {
|
||||||
throw new UnsupportedOperationException();
|
return getCurrentMediaItemIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1276,7 +1279,7 @@ public class MediaController implements Player {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public int getPreviousWindowIndex() {
|
public int getPreviousWindowIndex() {
|
||||||
throw new UnsupportedOperationException();
|
return getPreviousMediaItemIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1299,7 +1302,7 @@ public class MediaController implements Player {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public int getNextWindowIndex() {
|
public int getNextWindowIndex() {
|
||||||
throw new UnsupportedOperationException();
|
return getNextMediaItemIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1322,7 +1325,7 @@ public class MediaController implements Player {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public boolean hasPrevious() {
|
public boolean hasPrevious() {
|
||||||
throw new UnsupportedOperationException();
|
return hasPreviousMediaItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1332,7 +1335,7 @@ public class MediaController implements Player {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
throw new UnsupportedOperationException();
|
return hasNextMediaItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1342,7 +1345,7 @@ public class MediaController implements Player {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public boolean hasPreviousWindow() {
|
public boolean hasPreviousWindow() {
|
||||||
throw new UnsupportedOperationException();
|
return hasPreviousMediaItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1352,7 +1355,7 @@ public class MediaController implements Player {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public boolean hasNextWindow() {
|
public boolean hasNextWindow() {
|
||||||
throw new UnsupportedOperationException();
|
return hasNextMediaItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1374,7 +1377,7 @@ public class MediaController implements Player {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public void previous() {
|
public void previous() {
|
||||||
throw new UnsupportedOperationException();
|
seekToPreviousMediaItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1384,7 +1387,7 @@ public class MediaController implements Player {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public void next() {
|
public void next() {
|
||||||
throw new UnsupportedOperationException();
|
seekToNextMediaItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1394,7 +1397,7 @@ public class MediaController implements Player {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public void seekToPreviousWindow() {
|
public void seekToPreviousWindow() {
|
||||||
throw new UnsupportedOperationException();
|
seekToPreviousMediaItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1420,7 +1423,7 @@ public class MediaController implements Player {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public void seekToNextWindow() {
|
public void seekToNextWindow() {
|
||||||
throw new UnsupportedOperationException();
|
seekToNextMediaItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user