Commit 7b9eaaed by ibaker Committed by Ian Baker

Fix ForwardingPlayer @Override and @Deprecated annotations

These were messed up in https://github.com/androidx/media/commit/74c6ef9ba096fe64e767a739b97debca5185a375

Also suppress deprecation warnings when we're just forwarding a
deprecated method to the delegate.

#minor-release

PiperOrigin-RevId: 426351791
parent 37d47e1d
......@@ -39,12 +39,12 @@ public class ForwardingPlayer implements Player {
this.player = player;
}
@Deprecated
@Override
public Looper getApplicationLooper() {
return player.getApplicationLooper();
}
@Deprecated
@Override
public void addListener(Listener listener) {
player.addListener(new ForwardingListener(this, listener));
}
......@@ -255,12 +255,14 @@ public class ForwardingPlayer implements Player {
player.seekForward();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public boolean hasPrevious() {
return player.hasPrevious();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public boolean hasPreviousWindow() {
......@@ -272,12 +274,14 @@ public class ForwardingPlayer implements Player {
return player.hasPreviousMediaItem();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public void previous() {
player.previous();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public void seekToPreviousWindow() {
......@@ -299,12 +303,14 @@ public class ForwardingPlayer implements Player {
return player.getMaxSeekToPreviousPosition();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public boolean hasNext() {
return player.hasNext();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public boolean hasNextWindow() {
......@@ -316,12 +322,14 @@ public class ForwardingPlayer implements Player {
return player.hasNextMediaItem();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public void next() {
player.next();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public void seekToNextWindow() {
......@@ -358,6 +366,7 @@ public class ForwardingPlayer implements Player {
player.stop();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public void stop(boolean reset) {
......@@ -369,11 +378,15 @@ public class ForwardingPlayer implements Player {
player.release();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public TrackGroupArray getCurrentTrackGroups() {
return player.getCurrentTrackGroups();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public TrackSelectionArray getCurrentTrackSelections() {
return player.getCurrentTrackSelections();
......@@ -425,6 +438,7 @@ public class ForwardingPlayer implements Player {
return player.getCurrentPeriodIndex();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public int getCurrentWindowIndex() {
......@@ -436,6 +450,7 @@ public class ForwardingPlayer implements Player {
return player.getCurrentMediaItemIndex();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public int getNextWindowIndex() {
......@@ -447,6 +462,7 @@ public class ForwardingPlayer implements Player {
return player.getNextMediaItemIndex();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public int getPreviousWindowIndex() {
......@@ -499,6 +515,7 @@ public class ForwardingPlayer implements Player {
return player.getTotalBufferedDuration();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public boolean isCurrentWindowDynamic() {
......@@ -510,6 +527,7 @@ public class ForwardingPlayer implements Player {
return player.isCurrentMediaItemDynamic();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public boolean isCurrentWindowLive() {
......@@ -526,6 +544,7 @@ public class ForwardingPlayer implements Player {
return player.getCurrentLiveOffset();
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method
@Deprecated
@Override
public boolean isCurrentWindowSeekable() {
......
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