Throw unsupported exception from deprecated MediaController methods

This is consistent with existing deprecated methods that have never been
supported on MediaController.

PiperOrigin-RevId: 407071712
This commit is contained in:
ibaker 2021-11-02 13:51:30 +00:00 committed by Ian Baker
parent 65c2bd981c
commit dfb87e2161
2 changed files with 12 additions and 24 deletions

View file

@ -1181,8 +1181,7 @@ public class MediaController implements Player {
@Deprecated @Deprecated
@Override @Override
public boolean isCurrentWindowDynamic() { public boolean isCurrentWindowDynamic() {
// TODO(b/202157117): Throw UnsupportedOperationException when all callers are migrated. throw new UnsupportedOperationException();
return isCurrentMediaItemDynamic();
} }
@Override @Override
@ -1196,8 +1195,7 @@ public class MediaController implements Player {
@Deprecated @Deprecated
@Override @Override
public boolean isCurrentWindowLive() { public boolean isCurrentWindowLive() {
// TODO(b/202157117): Throw UnsupportedOperationException when all callers are migrated. throw new UnsupportedOperationException();
return isCurrentMediaItemLive();
} }
@Override @Override
@ -1211,8 +1209,7 @@ public class MediaController implements Player {
@Deprecated @Deprecated
@Override @Override
public boolean isCurrentWindowSeekable() { public boolean isCurrentWindowSeekable() {
// TODO(b/202157117): Throw UnsupportedOperationException when all callers are migrated. throw new UnsupportedOperationException();
return isCurrentMediaItemSeekable();
} }
@Override @Override
@ -1261,8 +1258,7 @@ public class MediaController implements Player {
@Deprecated @Deprecated
@Override @Override
public int getCurrentWindowIndex() { public int getCurrentWindowIndex() {
// TODO(b/202157117): Throw UnsupportedOperationException when all callers are migrated. throw new UnsupportedOperationException();
return getCurrentMediaItemIndex();
} }
@Override @Override
@ -1275,8 +1271,7 @@ public class MediaController implements Player {
@Deprecated @Deprecated
@Override @Override
public int getPreviousWindowIndex() { public int getPreviousWindowIndex() {
// TODO(b/202157117): Throw UnsupportedOperationException when all callers are migrated. throw new UnsupportedOperationException();
return getPreviousMediaItemIndex();
} }
/** /**
@ -1296,8 +1291,7 @@ public class MediaController implements Player {
@Deprecated @Deprecated
@Override @Override
public int getNextWindowIndex() { public int getNextWindowIndex() {
// TODO(b/202157117): Throw UnsupportedOperationException when all callers are migrated. throw new UnsupportedOperationException();
return getNextMediaItemIndex();
} }
/** /**
@ -1331,16 +1325,14 @@ public class MediaController implements Player {
@Deprecated @Deprecated
@Override @Override
public boolean hasPreviousWindow() { public boolean hasPreviousWindow() {
// TODO(b/202157117): Throw UnsupportedOperationException when all callers are migrated. throw new UnsupportedOperationException();
return hasPreviousMediaItem();
} }
@UnstableApi @UnstableApi
@Deprecated @Deprecated
@Override @Override
public boolean hasNextWindow() { public boolean hasNextWindow() {
// TODO(b/202157117): Throw UnsupportedOperationException when all callers are migrated. throw new UnsupportedOperationException();
return hasNextMediaItem();
} }
@Override @Override
@ -1373,8 +1365,7 @@ public class MediaController implements Player {
@Deprecated @Deprecated
@Override @Override
public void seekToPreviousWindow() { public void seekToPreviousWindow() {
// TODO(b/202157117): Throw UnsupportedOperationException when all callers are migrated. throw new UnsupportedOperationException();
seekToPreviousMediaItem();
} }
/** /**
@ -1397,8 +1388,7 @@ public class MediaController implements Player {
@Deprecated @Deprecated
@Override @Override
public void seekToNextWindow() { public void seekToNextWindow() {
// TODO(b/202157117): Throw UnsupportedOperationException when all callers are migrated. throw new UnsupportedOperationException();
seekToNextMediaItem();
} }
/** /**

View file

@ -892,15 +892,13 @@ public class MockPlayer implements Player {
@Deprecated @Deprecated
@Override @Override
public void seekToPreviousWindow() { public void seekToPreviousWindow() {
// TODO(b/202157117): Throw UnsupportedOperationException when all callers are migrated. throw new UnsupportedOperationException();
seekToPreviousMediaItem();
} }
@Deprecated @Deprecated
@Override @Override
public void seekToNextWindow() { public void seekToNextWindow() {
// TODO(b/202157117): Throw UnsupportedOperationException when all callers are migrated. throw new UnsupportedOperationException();
seekToNextMediaItem();
} }
@Override @Override