Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54fa566a authored by Jaewan Kim's avatar Jaewan Kim Committed by Android (Google) Code Review
Browse files

Merge "PIP: Use StatusBarService to handle PIP key"

parents a80bf367 c552b04c
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -2575,16 +2575,6 @@ public class Intent implements Parcelable, Cloneable {
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_MEDIA_BUTTON = "android.intent.action.MEDIA_BUTTON";

   /**
     * Broadcast Action:  The "Picture-in-picture (PIP) Button" was pressed.
     * Includes a single extra field, {@link #EXTRA_KEY_EVENT}, containing the key event that
     * caused the broadcast.
     * @hide
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_PICTURE_IN_PICTURE_BUTTON =
            "android.intent.action.PICTURE_IN_PICTURE_BUTTON";

    /**
     * Broadcast Action:  The "Camera Button" was pressed.  Includes a single
     * extra field, {@link #EXTRA_KEY_EVENT}, containing the key event that
+10 −1
Original line number Diff line number Diff line
@@ -78,5 +78,14 @@ oneway interface IStatusBar
     * @param source the identifier for the gesture, see {@link StatusBarManager}
     */
    void onCameraLaunchGestureDetected(int source);
}

    /**
     * Request picture-in-picture.
     *
     * <p>
     * This is called when an user presses picture-in-picture key or equivalent.
     * TV device may start picture-in-picture from foreground activity if there's none.
     * Picture-in-picture overlay menu will be shown instead otherwise.
     */
    void requestTvPictureInPicture();
}
+10 −0
Original line number Diff line number Diff line
@@ -93,4 +93,14 @@ interface IStatusBarService
    void appTransitionStarting(long statusBarAnimationsStartTime, long statusBarAnimationsDuration);

    void startAssist(in Bundle args);

    /**
     * Request picture-in-picture.
     *
     * <p>
     * This is called when an user presses picture-in-picture key or equivalent.
     * TV device may start picture-in-picture from foreground activity if there's none.
     * Picture-in-picture overlay menu will be shown instead otherwise.
     */
    void requestTvPictureInPicture();
}
+0 −2
Original line number Diff line number Diff line
@@ -226,8 +226,6 @@
    <protected-broadcast android:name="android.intent.action.MEDIA_UNMOUNTABLE" />
    <protected-broadcast android:name="android.intent.action.MEDIA_EJECT" />

    <protected-broadcast android:name="android.intent.action.PICTURE_IN_PICTURE_BUTTON" />

    <protected-broadcast android:name="android.net.conn.CAPTIVE_PORTAL" />
    <protected-broadcast android:name="android.net.conn.CONNECTIVITY_CHANGE" />
    <!-- @deprecated.  Only {@link android.net.ConnectivityManager.CONNECTIVITY_ACTION} is sent. -->
+38 −25
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ public class CommandQueue extends IStatusBar.Stub {
    private static final int MSG_START_ASSIST                  = 23 << MSG_SHIFT;
    private static final int MSG_CAMERA_LAUNCH_GESTURE         = 24 << MSG_SHIFT;
    private static final int MSG_TOGGLE_KEYBOARD_SHORTCUTS     = 25 << MSG_SHIFT;
    private static final int MSG_REQUEST_TV_PICTURE_IN_PICTURE = 26 << MSG_SHIFT;

    public static final int FLAG_EXCLUDE_NONE = 0;
    public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0;
@@ -110,6 +111,7 @@ public class CommandQueue extends IStatusBar.Stub {
        public void showAssistDisclosure();
        public void startAssist(Bundle args);
        public void onCameraLaunchGestureDetected(int source);
        public void requestTvPictureInPicture();
    }

    public CommandQueue(Callbacks callbacks) {
@@ -231,6 +233,14 @@ public class CommandQueue extends IStatusBar.Stub {
        }
    }

    @Override
    public void requestTvPictureInPicture() {
        synchronized (mLock) {
            mHandler.removeMessages(MSG_REQUEST_TV_PICTURE_IN_PICTURE);
            mHandler.obtainMessage(MSG_REQUEST_TV_PICTURE_IN_PICTURE).sendToTarget();
        }
    }

    public void setWindowState(int window, int state) {
        synchronized (mLock) {
            // don't coalesce these
@@ -399,6 +409,9 @@ public class CommandQueue extends IStatusBar.Stub {
                case MSG_CAMERA_LAUNCH_GESTURE:
                    mCallbacks.onCameraLaunchGestureDetected(msg.arg1);
                    break;
                case MSG_REQUEST_TV_PICTURE_IN_PICTURE:
                    mCallbacks.requestTvPictureInPicture();
                    break;
            }
        }
    }
Loading