Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java +5 −3 Original line number Diff line number Diff line Loading @@ -124,7 +124,6 @@ public class PipTransition extends PipTransitionController implements // Internal state and relevant cached info // @Nullable private Transitions.TransitionFinishCallback mFinishCallback; private ValueAnimator mTransitionAnimator; Loading Loading @@ -236,7 +235,6 @@ public class PipTransition extends PipTransitionController implements @NonNull SurfaceControl.Transaction startTransaction, @NonNull SurfaceControl.Transaction finishTransaction, @NonNull Transitions.TransitionFinishCallback finishCallback) { mFinishCallback = finishCallback; if (transition == mEnterTransition || info.getType() == TRANSIT_PIP) { mEnterTransition = null; // If we are in swipe PiP to Home transition we are ENTERING_PIP as a jumpcut transition Loading Loading @@ -282,7 +280,6 @@ public class PipTransition extends PipTransitionController implements if (isRemovePipTransition(info)) { return removePipImmediately(info, startTransaction, finishTransaction, finishCallback); } mFinishCallback = null; return false; } Loading Loading @@ -331,6 +328,7 @@ public class PipTransition extends PipTransitionController implements if (pipChange == null) { return false; } mFinishCallback = finishCallback; // We expect the PiP activity as a separate change in a config-at-end transition; // only flings are not using config-at-end for resize bounds changes TransitionInfo.Change pipActivityChange = getDeferConfigActivityChange(info, Loading Loading @@ -378,6 +376,7 @@ public class PipTransition extends PipTransitionController implements if (pipActivityChange == null) { return false; } mFinishCallback = finishCallback; final SurfaceControl pipLeash = getLeash(pipChange); final Rect destinationBounds = pipChange.getEndAbsBounds(); Loading Loading @@ -446,6 +445,7 @@ public class PipTransition extends PipTransitionController implements if (pipActivityChange == null) { return false; } mFinishCallback = finishCallback; final SurfaceControl pipLeash = getLeash(pipChange); final Rect startBounds = pipChange.getStartAbsBounds(); Loading Loading @@ -572,6 +572,7 @@ public class PipTransition extends PipTransitionController implements if (pipChange == null) { return false; } mFinishCallback = finishCallback; Rect destinationBounds = pipChange.getEndAbsBounds(); SurfaceControl pipLeash = mPipTransitionState.getPinnedTaskLeash(); Loading Loading @@ -614,6 +615,7 @@ public class PipTransition extends PipTransitionController implements return false; } } mFinishCallback = finishCallback; // The parent change if we were in a multi-activity PiP; null if single activity PiP. final TransitionInfo.Change parentBeforePip = pipChange.getTaskInfo() == null Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultMixedTransition.java +17 −2 Original line number Diff line number Diff line Loading @@ -204,6 +204,7 @@ class DefaultMixedTransition extends DefaultMixedHandler.MixedTransition { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "tryAnimateOpenIntentWithRemoteAndPipOrDesktop"); TransitionInfo.Change pipChange = null; TransitionInfo.Change pipActivityChange = null; for (int i = info.getChanges().size() - 1; i >= 0; --i) { TransitionInfo.Change change = info.getChanges().get(i); if (mPipHandler.isEnteringPip(change, info.getType())) { Loading @@ -213,6 +214,12 @@ class DefaultMixedTransition extends DefaultMixedHandler.MixedTransition { } pipChange = change; info.getChanges().remove(i); } else if (change.getTaskInfo() == null && change.getParent() != null && pipChange != null && change.getParent().equals(pipChange.getContainer())) { // Cache the PiP activity if it's a target and cached pip task change is its parent; // note that we are bottom-to-top, so if such activity has a task // that is also a target, then it must have been cached already as pipChange. pipActivityChange = change; } } TransitionInfo.Change desktopChange = null; Loading Loading @@ -257,8 +264,16 @@ class DefaultMixedTransition extends DefaultMixedHandler.MixedTransition { // make a new startTransaction because pip's startEnterAnimation "consumes" it so // we need a separate one to send over to launcher. SurfaceControl.Transaction otherStartT = new SurfaceControl.Transaction(); mPipHandler.startEnterAnimation(pipChange, otherStartT, finishTransaction, finishCB); if (pipActivityChange == null) { mPipHandler.startEnterAnimation(pipChange, otherStartT, finishTransaction, finishCB); } else { info.getChanges().remove(pipActivityChange); TransitionInfo pipInfo = subCopy(info, TRANSIT_PIP, false /* withChanges */); pipInfo.getChanges().addAll(List.of(pipChange, pipActivityChange)); mPipHandler.startAnimation(mTransition, pipInfo, startTransaction, finishTransaction, finishCB); } // Dispatch the rest of the transition normally. if (mLeftoversHandler != null Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java +5 −3 Original line number Diff line number Diff line Loading @@ -124,7 +124,6 @@ public class PipTransition extends PipTransitionController implements // Internal state and relevant cached info // @Nullable private Transitions.TransitionFinishCallback mFinishCallback; private ValueAnimator mTransitionAnimator; Loading Loading @@ -236,7 +235,6 @@ public class PipTransition extends PipTransitionController implements @NonNull SurfaceControl.Transaction startTransaction, @NonNull SurfaceControl.Transaction finishTransaction, @NonNull Transitions.TransitionFinishCallback finishCallback) { mFinishCallback = finishCallback; if (transition == mEnterTransition || info.getType() == TRANSIT_PIP) { mEnterTransition = null; // If we are in swipe PiP to Home transition we are ENTERING_PIP as a jumpcut transition Loading Loading @@ -282,7 +280,6 @@ public class PipTransition extends PipTransitionController implements if (isRemovePipTransition(info)) { return removePipImmediately(info, startTransaction, finishTransaction, finishCallback); } mFinishCallback = null; return false; } Loading Loading @@ -331,6 +328,7 @@ public class PipTransition extends PipTransitionController implements if (pipChange == null) { return false; } mFinishCallback = finishCallback; // We expect the PiP activity as a separate change in a config-at-end transition; // only flings are not using config-at-end for resize bounds changes TransitionInfo.Change pipActivityChange = getDeferConfigActivityChange(info, Loading Loading @@ -378,6 +376,7 @@ public class PipTransition extends PipTransitionController implements if (pipActivityChange == null) { return false; } mFinishCallback = finishCallback; final SurfaceControl pipLeash = getLeash(pipChange); final Rect destinationBounds = pipChange.getEndAbsBounds(); Loading Loading @@ -446,6 +445,7 @@ public class PipTransition extends PipTransitionController implements if (pipActivityChange == null) { return false; } mFinishCallback = finishCallback; final SurfaceControl pipLeash = getLeash(pipChange); final Rect startBounds = pipChange.getStartAbsBounds(); Loading Loading @@ -572,6 +572,7 @@ public class PipTransition extends PipTransitionController implements if (pipChange == null) { return false; } mFinishCallback = finishCallback; Rect destinationBounds = pipChange.getEndAbsBounds(); SurfaceControl pipLeash = mPipTransitionState.getPinnedTaskLeash(); Loading Loading @@ -614,6 +615,7 @@ public class PipTransition extends PipTransitionController implements return false; } } mFinishCallback = finishCallback; // The parent change if we were in a multi-activity PiP; null if single activity PiP. final TransitionInfo.Change parentBeforePip = pipChange.getTaskInfo() == null Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultMixedTransition.java +17 −2 Original line number Diff line number Diff line Loading @@ -204,6 +204,7 @@ class DefaultMixedTransition extends DefaultMixedHandler.MixedTransition { ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "tryAnimateOpenIntentWithRemoteAndPipOrDesktop"); TransitionInfo.Change pipChange = null; TransitionInfo.Change pipActivityChange = null; for (int i = info.getChanges().size() - 1; i >= 0; --i) { TransitionInfo.Change change = info.getChanges().get(i); if (mPipHandler.isEnteringPip(change, info.getType())) { Loading @@ -213,6 +214,12 @@ class DefaultMixedTransition extends DefaultMixedHandler.MixedTransition { } pipChange = change; info.getChanges().remove(i); } else if (change.getTaskInfo() == null && change.getParent() != null && pipChange != null && change.getParent().equals(pipChange.getContainer())) { // Cache the PiP activity if it's a target and cached pip task change is its parent; // note that we are bottom-to-top, so if such activity has a task // that is also a target, then it must have been cached already as pipChange. pipActivityChange = change; } } TransitionInfo.Change desktopChange = null; Loading Loading @@ -257,8 +264,16 @@ class DefaultMixedTransition extends DefaultMixedHandler.MixedTransition { // make a new startTransaction because pip's startEnterAnimation "consumes" it so // we need a separate one to send over to launcher. SurfaceControl.Transaction otherStartT = new SurfaceControl.Transaction(); mPipHandler.startEnterAnimation(pipChange, otherStartT, finishTransaction, finishCB); if (pipActivityChange == null) { mPipHandler.startEnterAnimation(pipChange, otherStartT, finishTransaction, finishCB); } else { info.getChanges().remove(pipActivityChange); TransitionInfo pipInfo = subCopy(info, TRANSIT_PIP, false /* withChanges */); pipInfo.getChanges().addAll(List.of(pipChange, pipActivityChange)); mPipHandler.startAnimation(mTransition, pipInfo, startTransaction, finishTransaction, finishCB); } // Dispatch the rest of the transition normally. if (mLeftoversHandler != null Loading