Loading core/java/android/view/View.java +7 −0 Original line number Diff line number Diff line Loading @@ -3068,6 +3068,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ public static final int RECENT_APPS_VISIBLE = 0x00004000; /** * @hide * * Whether the TV's picture-in-picture is visible or not. */ public static final int TV_PICTURE_IN_PICTURE_VISIBLE = 0x00010000; /** * @hide * Loading core/java/android/view/Window.java +13 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.StyleRes; import android.annotation.SystemApi; import android.app.ActivityManagerNative; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; Loading Loading @@ -1255,6 +1256,18 @@ public abstract class Window { return getDecorView().findViewById(id); } /** * Puts the activity in picture-in-picture mode. * @see android.R.attr#supportsPictureInPicture * @hide */ protected void enterPictureInPictureMode() { try { ActivityManagerNative.getDefault().enterPictureInPictureMode(mAppToken); } catch (IllegalArgumentException|RemoteException e) { } } /** * Convenience for * {@link #setContentView(View, android.view.ViewGroup.LayoutParams)} Loading core/java/com/android/internal/policy/PhoneWindow.java +7 −0 Original line number Diff line number Diff line Loading @@ -2002,6 +2002,13 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } return true; } case KeyEvent.KEYCODE_WINDOW: { if (!event.isCanceled()) { enterPictureInPictureMode(); } return true; } } return false; Loading core/java/com/android/internal/statusbar/IStatusBar.aidl +2 −7 Original line number Diff line number Diff line Loading @@ -105,14 +105,9 @@ oneway interface IStatusBar 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. * Shows the TV's picture-in-picture menu if an activity is in picture-in-picture mode. */ void requestTvPictureInPicture(); void showTvPictureInPictureMenu(); void addQsTile(in ComponentName tile); void remQsTile(in ComponentName tile); Loading packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java +7 −7 Original line number Diff line number Diff line Loading @@ -68,7 +68,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; private static final int MSG_SHOW_TV_PICTURE_IN_PICTURE_MENU = 26 << MSG_SHIFT; private static final int MSG_ADD_QS_TILE = 27 << MSG_SHIFT; private static final int MSG_REMOVE_QS_TILE = 28 << MSG_SHIFT; private static final int MSG_CLICK_QS_TILE = 29 << MSG_SHIFT; Loading Loading @@ -124,7 +124,7 @@ public class CommandQueue extends IStatusBar.Stub { void showAssistDisclosure(); void startAssist(Bundle args); void onCameraLaunchGestureDetected(int source); void requestTvPictureInPicture(); void showTvPictureInPictureMenu(); void addQsTile(ComponentName tile); void remQsTile(ComponentName tile); Loading Loading @@ -274,10 +274,10 @@ public class CommandQueue extends IStatusBar.Stub { } @Override public void requestTvPictureInPicture() { public void showTvPictureInPictureMenu() { synchronized (mLock) { mHandler.removeMessages(MSG_REQUEST_TV_PICTURE_IN_PICTURE); mHandler.obtainMessage(MSG_REQUEST_TV_PICTURE_IN_PICTURE).sendToTarget(); mHandler.removeMessages(MSG_SHOW_TV_PICTURE_IN_PICTURE_MENU); mHandler.obtainMessage(MSG_SHOW_TV_PICTURE_IN_PICTURE_MENU).sendToTarget(); } } Loading Loading @@ -488,8 +488,8 @@ 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(); case MSG_SHOW_TV_PICTURE_IN_PICTURE_MENU: mCallbacks.showTvPictureInPictureMenu(); break; case MSG_ADD_QS_TILE: mCallbacks.addQsTile((ComponentName) msg.obj); Loading Loading
core/java/android/view/View.java +7 −0 Original line number Diff line number Diff line Loading @@ -3068,6 +3068,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ public static final int RECENT_APPS_VISIBLE = 0x00004000; /** * @hide * * Whether the TV's picture-in-picture is visible or not. */ public static final int TV_PICTURE_IN_PICTURE_VISIBLE = 0x00010000; /** * @hide * Loading
core/java/android/view/Window.java +13 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.StyleRes; import android.annotation.SystemApi; import android.app.ActivityManagerNative; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; Loading Loading @@ -1255,6 +1256,18 @@ public abstract class Window { return getDecorView().findViewById(id); } /** * Puts the activity in picture-in-picture mode. * @see android.R.attr#supportsPictureInPicture * @hide */ protected void enterPictureInPictureMode() { try { ActivityManagerNative.getDefault().enterPictureInPictureMode(mAppToken); } catch (IllegalArgumentException|RemoteException e) { } } /** * Convenience for * {@link #setContentView(View, android.view.ViewGroup.LayoutParams)} Loading
core/java/com/android/internal/policy/PhoneWindow.java +7 −0 Original line number Diff line number Diff line Loading @@ -2002,6 +2002,13 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } return true; } case KeyEvent.KEYCODE_WINDOW: { if (!event.isCanceled()) { enterPictureInPictureMode(); } return true; } } return false; Loading
core/java/com/android/internal/statusbar/IStatusBar.aidl +2 −7 Original line number Diff line number Diff line Loading @@ -105,14 +105,9 @@ oneway interface IStatusBar 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. * Shows the TV's picture-in-picture menu if an activity is in picture-in-picture mode. */ void requestTvPictureInPicture(); void showTvPictureInPictureMenu(); void addQsTile(in ComponentName tile); void remQsTile(in ComponentName tile); Loading
packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java +7 −7 Original line number Diff line number Diff line Loading @@ -68,7 +68,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; private static final int MSG_SHOW_TV_PICTURE_IN_PICTURE_MENU = 26 << MSG_SHIFT; private static final int MSG_ADD_QS_TILE = 27 << MSG_SHIFT; private static final int MSG_REMOVE_QS_TILE = 28 << MSG_SHIFT; private static final int MSG_CLICK_QS_TILE = 29 << MSG_SHIFT; Loading Loading @@ -124,7 +124,7 @@ public class CommandQueue extends IStatusBar.Stub { void showAssistDisclosure(); void startAssist(Bundle args); void onCameraLaunchGestureDetected(int source); void requestTvPictureInPicture(); void showTvPictureInPictureMenu(); void addQsTile(ComponentName tile); void remQsTile(ComponentName tile); Loading Loading @@ -274,10 +274,10 @@ public class CommandQueue extends IStatusBar.Stub { } @Override public void requestTvPictureInPicture() { public void showTvPictureInPictureMenu() { synchronized (mLock) { mHandler.removeMessages(MSG_REQUEST_TV_PICTURE_IN_PICTURE); mHandler.obtainMessage(MSG_REQUEST_TV_PICTURE_IN_PICTURE).sendToTarget(); mHandler.removeMessages(MSG_SHOW_TV_PICTURE_IN_PICTURE_MENU); mHandler.obtainMessage(MSG_SHOW_TV_PICTURE_IN_PICTURE_MENU).sendToTarget(); } } Loading Loading @@ -488,8 +488,8 @@ 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(); case MSG_SHOW_TV_PICTURE_IN_PICTURE_MENU: mCallbacks.showTvPictureInPictureMenu(); break; case MSG_ADD_QS_TILE: mCallbacks.addQsTile((ComponentName) msg.obj); Loading