Merge "Remove TV specific methods from Pip interface"
This commit is contained in:
committed by
Android (Google) Code Review
commit
3026b03ea5
@@ -22,7 +22,6 @@ import android.app.PictureInPictureParams;
|
||||
import android.content.ComponentName;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.graphics.Rect;
|
||||
import android.media.session.MediaController;
|
||||
|
||||
import com.android.wm.shell.pip.phone.PipTouchHandler;
|
||||
import com.android.wm.shell.pip.tv.PipController;
|
||||
@@ -34,13 +33,6 @@ import java.util.function.Consumer;
|
||||
* Interface to engage picture in picture feature.
|
||||
*/
|
||||
public interface Pip {
|
||||
/**
|
||||
* Registers {@link com.android.wm.shell.pip.tv.PipController.Listener} that gets called.
|
||||
* whenever receiving notification on changes in PIP.
|
||||
*/
|
||||
default void addListener(PipController.Listener listener) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a {@link PipController.MediaListener} to PipController.
|
||||
*/
|
||||
@@ -67,18 +59,9 @@ public interface Pip {
|
||||
default void expandPip() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current play back state. (e.g: Used in TV)
|
||||
*
|
||||
* @return The state of defined in PipController.
|
||||
*/
|
||||
default int getPlaybackState() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the touch handler which manages all the touch handling for PIP on the Phone,
|
||||
* including moving, dismissing and expanding the PIP. (Do not used in TV)
|
||||
* including moving, dismissing and expanding the PIP. (Do not use in TV)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@@ -86,15 +69,6 @@ public interface Pip {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get MediaController.
|
||||
*
|
||||
* @return The MediaController instance.
|
||||
*/
|
||||
default MediaController getMediaController() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides the PIP menu.
|
||||
*/
|
||||
@@ -170,12 +144,6 @@ public interface Pip {
|
||||
default void onTaskStackChanged() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a {@link PipController.Listener} from PipController.
|
||||
*/
|
||||
default void removeListener(PipController.Listener listener) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a {@link PipController.MediaListener} from PipController.
|
||||
*/
|
||||
|
||||
@@ -545,14 +545,14 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac
|
||||
/**
|
||||
* Adds a {@link Listener} to PipController.
|
||||
*/
|
||||
public void addListener(Listener listener) {
|
||||
void addListener(Listener listener) {
|
||||
mListeners.add(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a {@link Listener} from PipController.
|
||||
*/
|
||||
public void removeListener(Listener listener) {
|
||||
void removeListener(Listener listener) {
|
||||
mListeners.remove(listener);
|
||||
}
|
||||
|
||||
@@ -641,7 +641,7 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac
|
||||
/**
|
||||
* Gets the {@link android.media.session.MediaController} for the PIPed activity.
|
||||
*/
|
||||
public MediaController getMediaController() {
|
||||
MediaController getMediaController() {
|
||||
return mPipMediaController;
|
||||
}
|
||||
|
||||
@@ -655,7 +655,7 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac
|
||||
* This returns one of {@link #PLAYBACK_STATE_PLAYING}, {@link #PLAYBACK_STATE_PAUSED},
|
||||
* or {@link #PLAYBACK_STATE_UNAVAILABLE}.
|
||||
*/
|
||||
public int getPlaybackState() {
|
||||
int getPlaybackState() {
|
||||
if (mPipMediaController == null || mPipMediaController.getPlaybackState() == null) {
|
||||
return PLAYBACK_STATE_UNAVAILABLE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user