Loading core/java/android/app/Activity.java +0 −17 Original line number Original line Diff line number Diff line Loading @@ -2092,7 +2092,6 @@ public class Activity extends ContextThemeWrapper if (params == null) { if (params == null) { throw new IllegalArgumentException("Expected non-null picture-in-picture params"); throw new IllegalArgumentException("Expected non-null picture-in-picture params"); } } updatePictureInPictureParamsForContentInsets(params); return ActivityManagerNative.getDefault().enterPictureInPictureMode(mToken, params); return ActivityManagerNative.getDefault().enterPictureInPictureMode(mToken, params); } catch (RemoteException e) { } catch (RemoteException e) { return false; return false; Loading @@ -2116,7 +2115,6 @@ public class Activity extends ContextThemeWrapper if (params == null) { if (params == null) { throw new IllegalArgumentException("Expected non-null picture-in-picture params"); throw new IllegalArgumentException("Expected non-null picture-in-picture params"); } } updatePictureInPictureParamsForContentInsets(params); ActivityManagerNative.getDefault().setPictureInPictureParams(mToken, params); ActivityManagerNative.getDefault().setPictureInPictureParams(mToken, params); } catch (RemoteException e) { } catch (RemoteException e) { } } Loading @@ -2136,21 +2134,6 @@ public class Activity extends ContextThemeWrapper } } } } /** * Updates the provided {@param params} with the last known content insets for this activity, to * be used with the source hint rect for the transition into PiP. */ private void updatePictureInPictureParamsForContentInsets(PictureInPictureParams params) { if (params != null && params.hasSourceBoundsHint() && getWindow() != null && getWindow().peekDecorView() != null && getWindow().peekDecorView().getViewRootImpl() != null) { params.setSourceRectHintInsets( getWindow().peekDecorView().getViewRootImpl().getLastContentInsets()); } else { params.setSourceRectHintInsets(null); } } void dispatchMovedToDisplay(int displayId, Configuration config) { void dispatchMovedToDisplay(int displayId, Configuration config) { updateDisplay(displayId); updateDisplay(displayId); onMovedToDisplay(displayId, config); onMovedToDisplay(displayId, config); Loading core/java/android/app/PictureInPictureArgs.java +0 −12 Original line number Original line Diff line number Diff line Loading @@ -160,9 +160,6 @@ public final class PictureInPictureArgs implements Parcelable { if (in.readInt() != 0) { if (in.readInt() != 0) { mSourceRectHint = Rect.CREATOR.createFromParcel(in); mSourceRectHint = Rect.CREATOR.createFromParcel(in); } } if (in.readInt() != 0) { mSourceRectHintInsets = Rect.CREATOR.createFromParcel(in); } } } private PictureInPictureArgs(Rational aspectRatio, List<RemoteAction> actions, private PictureInPictureArgs(Rational aspectRatio, List<RemoteAction> actions, Loading Loading @@ -220,9 +217,6 @@ public final class PictureInPictureArgs implements Parcelable { if (otherArgs.hasSourceBoundsHint()) { if (otherArgs.hasSourceBoundsHint()) { mSourceRectHint = new Rect(otherArgs.getSourceRectHint()); mSourceRectHint = new Rect(otherArgs.getSourceRectHint()); } } if (otherArgs.hasSourceBoundsHintInsets()) { mSourceRectHintInsets = new Rect(otherArgs.getSourceRectHintInsets()); } } } /** /** Loading Loading @@ -346,12 +340,6 @@ public final class PictureInPictureArgs implements Parcelable { } else { } else { out.writeInt(0); out.writeInt(0); } } if (mSourceRectHintInsets != null) { out.writeInt(1); mSourceRectHintInsets.writeToParcel(out, 0); } else { out.writeInt(0); } } } public static final Creator<PictureInPictureArgs> CREATOR = public static final Creator<PictureInPictureArgs> CREATOR = Loading core/java/android/app/PictureInPictureParams.java +1 −49 Original line number Original line Diff line number Diff line Loading @@ -135,13 +135,6 @@ public final class PictureInPictureParams implements Parcelable { @Nullable @Nullable private Rect mSourceRectHint; private Rect mSourceRectHint; /** * The content insets that are used with the source hint rect for the transition into PiP where * the insets are removed at the beginning of the transition. */ @Nullable private Rect mSourceRectHintInsets; /** {@hide} */ /** {@hide} */ PictureInPictureParams() { PictureInPictureParams() { } } Loading @@ -158,9 +151,6 @@ public final class PictureInPictureParams implements Parcelable { if (in.readInt() != 0) { if (in.readInt() != 0) { mSourceRectHint = Rect.CREATOR.createFromParcel(in); mSourceRectHint = Rect.CREATOR.createFromParcel(in); } } if (in.readInt() != 0) { mSourceRectHintInsets = Rect.CREATOR.createFromParcel(in); } } } /** {@hide} */ /** {@hide} */ Loading @@ -185,9 +175,6 @@ public final class PictureInPictureParams implements Parcelable { if (otherArgs.hasSourceBoundsHint()) { if (otherArgs.hasSourceBoundsHint()) { mSourceRectHint = new Rect(otherArgs.getSourceRectHint()); mSourceRectHint = new Rect(otherArgs.getSourceRectHint()); } } if (otherArgs.hasSourceBoundsHintInsets()) { mSourceRectHintInsets = new Rect(otherArgs.getSourceRectHintInsets()); } } } /** /** Loading Loading @@ -240,19 +227,6 @@ public final class PictureInPictureParams implements Parcelable { } } } } /** * Sets the insets to be used with the source rect hint bounds. * @hide */ @Deprecated public void setSourceRectHintInsets(Rect insets) { if (insets == null) { mSourceRectHintInsets = null; } else { mSourceRectHintInsets = new Rect(insets); } } /** /** * @return the source rect hint * @return the source rect hint * @hide * @hide Loading @@ -261,14 +235,6 @@ public final class PictureInPictureParams implements Parcelable { return mSourceRectHint; return mSourceRectHint; } } /** * @return the source rect hint insets. * @hide */ public Rect getSourceRectHintInsets() { return mSourceRectHintInsets; } /** /** * @return whether there are launch bounds set * @return whether there are launch bounds set * @hide * @hide Loading @@ -277,14 +243,6 @@ public final class PictureInPictureParams implements Parcelable { return mSourceRectHint != null && !mSourceRectHint.isEmpty(); return mSourceRectHint != null && !mSourceRectHint.isEmpty(); } } /** * @return whether there are source rect hint insets set * @hide */ public boolean hasSourceBoundsHintInsets() { return mSourceRectHintInsets != null; } @Override @Override public int describeContents() { public int describeContents() { return 0; return 0; Loading @@ -311,12 +269,6 @@ public final class PictureInPictureParams implements Parcelable { } else { } else { out.writeInt(0); out.writeInt(0); } } if (mSourceRectHintInsets != null) { out.writeInt(1); mSourceRectHintInsets.writeToParcel(out, 0); } else { out.writeInt(0); } } } public static final Creator<PictureInPictureParams> CREATOR = public static final Creator<PictureInPictureParams> CREATOR = Loading core/java/android/view/ViewRootImpl.java +0 −10 Original line number Original line Diff line number Diff line Loading @@ -1561,16 +1561,6 @@ public final class ViewRootImpl implements ViewParent, host.dispatchApplyWindowInsets(getWindowInsets(true /* forceConstruct */)); host.dispatchApplyWindowInsets(getWindowInsets(true /* forceConstruct */)); } } /** * @return the last content insets for use in adjusting the source hint rect for the * picture-in-picture transition. * * @hide */ public Rect getLastContentInsets() { return mAttachInfo.mContentInsets; } private static boolean shouldUseDisplaySize(final WindowManager.LayoutParams lp) { private static boolean shouldUseDisplaySize(final WindowManager.LayoutParams lp) { return lp.type == TYPE_STATUS_BAR_PANEL return lp.type == TYPE_STATUS_BAR_PANEL || lp.type == TYPE_INPUT_METHOD || lp.type == TYPE_INPUT_METHOD Loading services/core/java/com/android/server/am/ActivityManagerService.java +0 −6 Original line number Original line Diff line number Diff line Loading @@ -7894,12 +7894,6 @@ public class ActivityManagerService extends IActivityManager.Stub final List<RemoteAction> actions = r.pictureInPictureArgs.getActions(); final List<RemoteAction> actions = r.pictureInPictureArgs.getActions(); // Adjust the source bounds by the insets for the transition down // Adjust the source bounds by the insets for the transition down final Rect sourceBounds = new Rect(r.pictureInPictureArgs.getSourceRectHint()); final Rect sourceBounds = new Rect(r.pictureInPictureArgs.getSourceRectHint()); final Rect insets = r.pictureInPictureArgs.getSourceRectHintInsets(); if (insets != null) { sourceBounds.offsetTo(Math.max(0, sourceBounds.left - insets.left), Math.max(0, sourceBounds.top - insets.top)); } mStackSupervisor.moveActivityToPinnedStackLocked(r, sourceBounds, aspectRatio, mStackSupervisor.moveActivityToPinnedStackLocked(r, sourceBounds, aspectRatio, true /* moveHomeStackToFront */, "enterPictureInPictureMode"); true /* moveHomeStackToFront */, "enterPictureInPictureMode"); final PinnedActivityStack stack = mStackSupervisor.getStack(PINNED_STACK_ID); final PinnedActivityStack stack = mStackSupervisor.getStack(PINNED_STACK_ID); Loading
core/java/android/app/Activity.java +0 −17 Original line number Original line Diff line number Diff line Loading @@ -2092,7 +2092,6 @@ public class Activity extends ContextThemeWrapper if (params == null) { if (params == null) { throw new IllegalArgumentException("Expected non-null picture-in-picture params"); throw new IllegalArgumentException("Expected non-null picture-in-picture params"); } } updatePictureInPictureParamsForContentInsets(params); return ActivityManagerNative.getDefault().enterPictureInPictureMode(mToken, params); return ActivityManagerNative.getDefault().enterPictureInPictureMode(mToken, params); } catch (RemoteException e) { } catch (RemoteException e) { return false; return false; Loading @@ -2116,7 +2115,6 @@ public class Activity extends ContextThemeWrapper if (params == null) { if (params == null) { throw new IllegalArgumentException("Expected non-null picture-in-picture params"); throw new IllegalArgumentException("Expected non-null picture-in-picture params"); } } updatePictureInPictureParamsForContentInsets(params); ActivityManagerNative.getDefault().setPictureInPictureParams(mToken, params); ActivityManagerNative.getDefault().setPictureInPictureParams(mToken, params); } catch (RemoteException e) { } catch (RemoteException e) { } } Loading @@ -2136,21 +2134,6 @@ public class Activity extends ContextThemeWrapper } } } } /** * Updates the provided {@param params} with the last known content insets for this activity, to * be used with the source hint rect for the transition into PiP. */ private void updatePictureInPictureParamsForContentInsets(PictureInPictureParams params) { if (params != null && params.hasSourceBoundsHint() && getWindow() != null && getWindow().peekDecorView() != null && getWindow().peekDecorView().getViewRootImpl() != null) { params.setSourceRectHintInsets( getWindow().peekDecorView().getViewRootImpl().getLastContentInsets()); } else { params.setSourceRectHintInsets(null); } } void dispatchMovedToDisplay(int displayId, Configuration config) { void dispatchMovedToDisplay(int displayId, Configuration config) { updateDisplay(displayId); updateDisplay(displayId); onMovedToDisplay(displayId, config); onMovedToDisplay(displayId, config); Loading
core/java/android/app/PictureInPictureArgs.java +0 −12 Original line number Original line Diff line number Diff line Loading @@ -160,9 +160,6 @@ public final class PictureInPictureArgs implements Parcelable { if (in.readInt() != 0) { if (in.readInt() != 0) { mSourceRectHint = Rect.CREATOR.createFromParcel(in); mSourceRectHint = Rect.CREATOR.createFromParcel(in); } } if (in.readInt() != 0) { mSourceRectHintInsets = Rect.CREATOR.createFromParcel(in); } } } private PictureInPictureArgs(Rational aspectRatio, List<RemoteAction> actions, private PictureInPictureArgs(Rational aspectRatio, List<RemoteAction> actions, Loading Loading @@ -220,9 +217,6 @@ public final class PictureInPictureArgs implements Parcelable { if (otherArgs.hasSourceBoundsHint()) { if (otherArgs.hasSourceBoundsHint()) { mSourceRectHint = new Rect(otherArgs.getSourceRectHint()); mSourceRectHint = new Rect(otherArgs.getSourceRectHint()); } } if (otherArgs.hasSourceBoundsHintInsets()) { mSourceRectHintInsets = new Rect(otherArgs.getSourceRectHintInsets()); } } } /** /** Loading Loading @@ -346,12 +340,6 @@ public final class PictureInPictureArgs implements Parcelable { } else { } else { out.writeInt(0); out.writeInt(0); } } if (mSourceRectHintInsets != null) { out.writeInt(1); mSourceRectHintInsets.writeToParcel(out, 0); } else { out.writeInt(0); } } } public static final Creator<PictureInPictureArgs> CREATOR = public static final Creator<PictureInPictureArgs> CREATOR = Loading
core/java/android/app/PictureInPictureParams.java +1 −49 Original line number Original line Diff line number Diff line Loading @@ -135,13 +135,6 @@ public final class PictureInPictureParams implements Parcelable { @Nullable @Nullable private Rect mSourceRectHint; private Rect mSourceRectHint; /** * The content insets that are used with the source hint rect for the transition into PiP where * the insets are removed at the beginning of the transition. */ @Nullable private Rect mSourceRectHintInsets; /** {@hide} */ /** {@hide} */ PictureInPictureParams() { PictureInPictureParams() { } } Loading @@ -158,9 +151,6 @@ public final class PictureInPictureParams implements Parcelable { if (in.readInt() != 0) { if (in.readInt() != 0) { mSourceRectHint = Rect.CREATOR.createFromParcel(in); mSourceRectHint = Rect.CREATOR.createFromParcel(in); } } if (in.readInt() != 0) { mSourceRectHintInsets = Rect.CREATOR.createFromParcel(in); } } } /** {@hide} */ /** {@hide} */ Loading @@ -185,9 +175,6 @@ public final class PictureInPictureParams implements Parcelable { if (otherArgs.hasSourceBoundsHint()) { if (otherArgs.hasSourceBoundsHint()) { mSourceRectHint = new Rect(otherArgs.getSourceRectHint()); mSourceRectHint = new Rect(otherArgs.getSourceRectHint()); } } if (otherArgs.hasSourceBoundsHintInsets()) { mSourceRectHintInsets = new Rect(otherArgs.getSourceRectHintInsets()); } } } /** /** Loading Loading @@ -240,19 +227,6 @@ public final class PictureInPictureParams implements Parcelable { } } } } /** * Sets the insets to be used with the source rect hint bounds. * @hide */ @Deprecated public void setSourceRectHintInsets(Rect insets) { if (insets == null) { mSourceRectHintInsets = null; } else { mSourceRectHintInsets = new Rect(insets); } } /** /** * @return the source rect hint * @return the source rect hint * @hide * @hide Loading @@ -261,14 +235,6 @@ public final class PictureInPictureParams implements Parcelable { return mSourceRectHint; return mSourceRectHint; } } /** * @return the source rect hint insets. * @hide */ public Rect getSourceRectHintInsets() { return mSourceRectHintInsets; } /** /** * @return whether there are launch bounds set * @return whether there are launch bounds set * @hide * @hide Loading @@ -277,14 +243,6 @@ public final class PictureInPictureParams implements Parcelable { return mSourceRectHint != null && !mSourceRectHint.isEmpty(); return mSourceRectHint != null && !mSourceRectHint.isEmpty(); } } /** * @return whether there are source rect hint insets set * @hide */ public boolean hasSourceBoundsHintInsets() { return mSourceRectHintInsets != null; } @Override @Override public int describeContents() { public int describeContents() { return 0; return 0; Loading @@ -311,12 +269,6 @@ public final class PictureInPictureParams implements Parcelable { } else { } else { out.writeInt(0); out.writeInt(0); } } if (mSourceRectHintInsets != null) { out.writeInt(1); mSourceRectHintInsets.writeToParcel(out, 0); } else { out.writeInt(0); } } } public static final Creator<PictureInPictureParams> CREATOR = public static final Creator<PictureInPictureParams> CREATOR = Loading
core/java/android/view/ViewRootImpl.java +0 −10 Original line number Original line Diff line number Diff line Loading @@ -1561,16 +1561,6 @@ public final class ViewRootImpl implements ViewParent, host.dispatchApplyWindowInsets(getWindowInsets(true /* forceConstruct */)); host.dispatchApplyWindowInsets(getWindowInsets(true /* forceConstruct */)); } } /** * @return the last content insets for use in adjusting the source hint rect for the * picture-in-picture transition. * * @hide */ public Rect getLastContentInsets() { return mAttachInfo.mContentInsets; } private static boolean shouldUseDisplaySize(final WindowManager.LayoutParams lp) { private static boolean shouldUseDisplaySize(final WindowManager.LayoutParams lp) { return lp.type == TYPE_STATUS_BAR_PANEL return lp.type == TYPE_STATUS_BAR_PANEL || lp.type == TYPE_INPUT_METHOD || lp.type == TYPE_INPUT_METHOD Loading
services/core/java/com/android/server/am/ActivityManagerService.java +0 −6 Original line number Original line Diff line number Diff line Loading @@ -7894,12 +7894,6 @@ public class ActivityManagerService extends IActivityManager.Stub final List<RemoteAction> actions = r.pictureInPictureArgs.getActions(); final List<RemoteAction> actions = r.pictureInPictureArgs.getActions(); // Adjust the source bounds by the insets for the transition down // Adjust the source bounds by the insets for the transition down final Rect sourceBounds = new Rect(r.pictureInPictureArgs.getSourceRectHint()); final Rect sourceBounds = new Rect(r.pictureInPictureArgs.getSourceRectHint()); final Rect insets = r.pictureInPictureArgs.getSourceRectHintInsets(); if (insets != null) { sourceBounds.offsetTo(Math.max(0, sourceBounds.left - insets.left), Math.max(0, sourceBounds.top - insets.top)); } mStackSupervisor.moveActivityToPinnedStackLocked(r, sourceBounds, aspectRatio, mStackSupervisor.moveActivityToPinnedStackLocked(r, sourceBounds, aspectRatio, true /* moveHomeStackToFront */, "enterPictureInPictureMode"); true /* moveHomeStackToFront */, "enterPictureInPictureMode"); final PinnedActivityStack stack = mStackSupervisor.getStack(PINNED_STACK_ID); final PinnedActivityStack stack = mStackSupervisor.getStack(PINNED_STACK_ID);