Commit dfb87e21 by ibaker Committed by Ian Baker

Throw unsupported exception from deprecated MediaController methods

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

PiperOrigin-RevId: 407071712
parent 65c2bd98
...@@ -1181,8 +1181,7 @@ public class MediaController implements Player { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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();
} }
/** /**
......
...@@ -892,15 +892,13 @@ public class MockPlayer implements Player { ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment