Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java +8 −5 Original line number Diff line number Diff line Loading @@ -300,7 +300,7 @@ public class PipAnimationController { * @return true if handled by the handler, false otherwise. */ public boolean handlePipTransaction(SurfaceControl leash, SurfaceControl.Transaction tx, Rect destinationBounds) { Rect destinationBounds, float alpha) { return false; } } Loading Loading @@ -401,9 +401,10 @@ public class PipAnimationController { } boolean handlePipTransaction(SurfaceControl leash, SurfaceControl.Transaction tx, Rect destinationBounds) { Rect destinationBounds, float alpha) { if (mPipTransactionHandler != null) { return mPipTransactionHandler.handlePipTransaction(leash, tx, destinationBounds); return mPipTransactionHandler.handlePipTransaction( leash, tx, destinationBounds, alpha); } return false; } Loading Loading @@ -548,8 +549,10 @@ public class PipAnimationController { getSurfaceTransactionHelper().alpha(tx, leash, alpha) .round(tx, leash, shouldApplyCornerRadius()) .shadow(tx, leash, shouldApplyShadowRadius()); if (!handlePipTransaction(leash, tx, destinationBounds, alpha)) { tx.apply(); } } @Override void onStartTransaction(SurfaceControl leash, SurfaceControl.Transaction tx) { Loading Loading @@ -663,7 +666,7 @@ public class PipAnimationController { .shadow(tx, leash, shouldApplyShadowRadius()); } } if (!handlePipTransaction(leash, tx, bounds)) { if (!handlePipTransaction(leash, tx, bounds, /* alpha= */ 1f)) { tx.apply(); } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipMenuController.java +9 −2 Original line number Diff line number Diff line Loading @@ -44,6 +44,13 @@ public interface PipMenuController { String MENU_WINDOW_TITLE = "PipMenuView"; /** * Used with * {@link PipMenuController#movePipMenu(SurfaceControl, SurfaceControl.Transaction, Rect, * float)} to indicate that we don't want to affect the alpha value of the menu surfaces. */ float ALPHA_NO_CHANGE = -1f; /** * Called when * {@link PipTaskOrganizer#onTaskAppeared(RunningTaskInfo, SurfaceControl)} Loading Loading @@ -85,8 +92,8 @@ public interface PipMenuController { * need to synchronize the movements on the same frame as PiP. */ default void movePipMenu(@Nullable SurfaceControl pipLeash, @Nullable SurfaceControl.Transaction t, Rect destinationBounds) {} @Nullable SurfaceControl.Transaction t, Rect destinationBounds, float alpha) { } /** * Update the PiP menu with the given bounds for re-layout purposes. Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java +10 −5 Original line number Diff line number Diff line Loading @@ -249,7 +249,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, }, null); } private boolean shouldSyncPipTransactionWithMenu() { protected boolean shouldSyncPipTransactionWithMenu() { return mPipMenuController.isMenuVisible(); } Loading Loading @@ -277,9 +277,9 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, new PipAnimationController.PipTransactionHandler() { @Override public boolean handlePipTransaction(SurfaceControl leash, SurfaceControl.Transaction tx, Rect destinationBounds) { SurfaceControl.Transaction tx, Rect destinationBounds, float alpha) { if (shouldSyncPipTransactionWithMenu()) { mPipMenuController.movePipMenu(leash, tx, destinationBounds); mPipMenuController.movePipMenu(leash, tx, destinationBounds, alpha); return true; } return false; Loading Loading @@ -381,6 +381,10 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, return mPipTransitionController; } PipAnimationController.PipTransactionHandler getPipTransactionHandler() { return mPipTransactionHandler; } public Rect getCurrentOrAnimatingBounds() { PipAnimationController.PipTransitionAnimator animator = mPipAnimationController.getCurrentAnimator(); Loading Loading @@ -1385,7 +1389,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, .scale(tx, mLeash, startBounds, toBounds, degrees) .round(tx, mLeash, startBounds, toBounds); if (shouldSyncPipTransactionWithMenu()) { mPipMenuController.movePipMenu(mLeash, tx, toBounds); mPipMenuController.movePipMenu(mLeash, tx, toBounds, PipMenuController.ALPHA_NO_CHANGE); } else { tx.apply(); } Loading Loading @@ -1551,7 +1555,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, if (!isInPip()) { return; } mPipMenuController.movePipMenu(null, null, destinationBounds); mPipMenuController.movePipMenu(null, null, destinationBounds, PipMenuController.ALPHA_NO_CHANGE); mPipMenuController.updateMenuBounds(destinationBounds); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java +3 −1 Original line number Diff line number Diff line Loading @@ -823,6 +823,7 @@ public class PipTransition extends PipTransitionController { throw new RuntimeException("Unrecognized animation type: " + enterAnimationType); } animator.setTransitionDirection(TRANSITION_DIRECTION_TO_PIP) .setPipTransactionHandler(mPipOrganizer.getPipTransactionHandler()) .setPipAnimationCallback(mPipAnimationCallback) .setDuration(mEnterExitAnimationDuration); if (rotationDelta != Surface.ROTATION_0 && mInFixedRotation) { Loading Loading @@ -949,7 +950,8 @@ public class PipTransition extends PipTransitionController { } private void finishResizeForMenu(Rect destinationBounds) { mPipMenuController.movePipMenu(null, null, destinationBounds); mPipMenuController.movePipMenu(null, null, destinationBounds, PipMenuController.ALPHA_NO_CHANGE); mPipMenuController.updateMenuBounds(destinationBounds); } } libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java +3 −2 Original line number Diff line number Diff line Loading @@ -298,7 +298,8 @@ public class PhonePipMenuController implements PipMenuController { } // Sync the menu bounds before showing it in case it is out of sync. movePipMenu(null /* pipLeash */, null /* transaction */, stackBounds); movePipMenu(null /* pipLeash */, null /* transaction */, stackBounds, PipMenuController.ALPHA_NO_CHANGE); updateMenuBounds(stackBounds); mPipMenuView.showMenu(menuState, stackBounds, allowMenuTimeout, willResizeMenu, withDelay, Loading @@ -311,7 +312,7 @@ public class PhonePipMenuController implements PipMenuController { @Override public void movePipMenu(@Nullable SurfaceControl pipLeash, @Nullable SurfaceControl.Transaction t, Rect destinationBounds) { Rect destinationBounds, float alpha) { if (destinationBounds.isEmpty()) { return; } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java +8 −5 Original line number Diff line number Diff line Loading @@ -300,7 +300,7 @@ public class PipAnimationController { * @return true if handled by the handler, false otherwise. */ public boolean handlePipTransaction(SurfaceControl leash, SurfaceControl.Transaction tx, Rect destinationBounds) { Rect destinationBounds, float alpha) { return false; } } Loading Loading @@ -401,9 +401,10 @@ public class PipAnimationController { } boolean handlePipTransaction(SurfaceControl leash, SurfaceControl.Transaction tx, Rect destinationBounds) { Rect destinationBounds, float alpha) { if (mPipTransactionHandler != null) { return mPipTransactionHandler.handlePipTransaction(leash, tx, destinationBounds); return mPipTransactionHandler.handlePipTransaction( leash, tx, destinationBounds, alpha); } return false; } Loading Loading @@ -548,8 +549,10 @@ public class PipAnimationController { getSurfaceTransactionHelper().alpha(tx, leash, alpha) .round(tx, leash, shouldApplyCornerRadius()) .shadow(tx, leash, shouldApplyShadowRadius()); if (!handlePipTransaction(leash, tx, destinationBounds, alpha)) { tx.apply(); } } @Override void onStartTransaction(SurfaceControl leash, SurfaceControl.Transaction tx) { Loading Loading @@ -663,7 +666,7 @@ public class PipAnimationController { .shadow(tx, leash, shouldApplyShadowRadius()); } } if (!handlePipTransaction(leash, tx, bounds)) { if (!handlePipTransaction(leash, tx, bounds, /* alpha= */ 1f)) { tx.apply(); } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipMenuController.java +9 −2 Original line number Diff line number Diff line Loading @@ -44,6 +44,13 @@ public interface PipMenuController { String MENU_WINDOW_TITLE = "PipMenuView"; /** * Used with * {@link PipMenuController#movePipMenu(SurfaceControl, SurfaceControl.Transaction, Rect, * float)} to indicate that we don't want to affect the alpha value of the menu surfaces. */ float ALPHA_NO_CHANGE = -1f; /** * Called when * {@link PipTaskOrganizer#onTaskAppeared(RunningTaskInfo, SurfaceControl)} Loading Loading @@ -85,8 +92,8 @@ public interface PipMenuController { * need to synchronize the movements on the same frame as PiP. */ default void movePipMenu(@Nullable SurfaceControl pipLeash, @Nullable SurfaceControl.Transaction t, Rect destinationBounds) {} @Nullable SurfaceControl.Transaction t, Rect destinationBounds, float alpha) { } /** * Update the PiP menu with the given bounds for re-layout purposes. Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java +10 −5 Original line number Diff line number Diff line Loading @@ -249,7 +249,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, }, null); } private boolean shouldSyncPipTransactionWithMenu() { protected boolean shouldSyncPipTransactionWithMenu() { return mPipMenuController.isMenuVisible(); } Loading Loading @@ -277,9 +277,9 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, new PipAnimationController.PipTransactionHandler() { @Override public boolean handlePipTransaction(SurfaceControl leash, SurfaceControl.Transaction tx, Rect destinationBounds) { SurfaceControl.Transaction tx, Rect destinationBounds, float alpha) { if (shouldSyncPipTransactionWithMenu()) { mPipMenuController.movePipMenu(leash, tx, destinationBounds); mPipMenuController.movePipMenu(leash, tx, destinationBounds, alpha); return true; } return false; Loading Loading @@ -381,6 +381,10 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, return mPipTransitionController; } PipAnimationController.PipTransactionHandler getPipTransactionHandler() { return mPipTransactionHandler; } public Rect getCurrentOrAnimatingBounds() { PipAnimationController.PipTransitionAnimator animator = mPipAnimationController.getCurrentAnimator(); Loading Loading @@ -1385,7 +1389,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, .scale(tx, mLeash, startBounds, toBounds, degrees) .round(tx, mLeash, startBounds, toBounds); if (shouldSyncPipTransactionWithMenu()) { mPipMenuController.movePipMenu(mLeash, tx, toBounds); mPipMenuController.movePipMenu(mLeash, tx, toBounds, PipMenuController.ALPHA_NO_CHANGE); } else { tx.apply(); } Loading Loading @@ -1551,7 +1555,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, if (!isInPip()) { return; } mPipMenuController.movePipMenu(null, null, destinationBounds); mPipMenuController.movePipMenu(null, null, destinationBounds, PipMenuController.ALPHA_NO_CHANGE); mPipMenuController.updateMenuBounds(destinationBounds); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java +3 −1 Original line number Diff line number Diff line Loading @@ -823,6 +823,7 @@ public class PipTransition extends PipTransitionController { throw new RuntimeException("Unrecognized animation type: " + enterAnimationType); } animator.setTransitionDirection(TRANSITION_DIRECTION_TO_PIP) .setPipTransactionHandler(mPipOrganizer.getPipTransactionHandler()) .setPipAnimationCallback(mPipAnimationCallback) .setDuration(mEnterExitAnimationDuration); if (rotationDelta != Surface.ROTATION_0 && mInFixedRotation) { Loading Loading @@ -949,7 +950,8 @@ public class PipTransition extends PipTransitionController { } private void finishResizeForMenu(Rect destinationBounds) { mPipMenuController.movePipMenu(null, null, destinationBounds); mPipMenuController.movePipMenu(null, null, destinationBounds, PipMenuController.ALPHA_NO_CHANGE); mPipMenuController.updateMenuBounds(destinationBounds); } }
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java +3 −2 Original line number Diff line number Diff line Loading @@ -298,7 +298,8 @@ public class PhonePipMenuController implements PipMenuController { } // Sync the menu bounds before showing it in case it is out of sync. movePipMenu(null /* pipLeash */, null /* transaction */, stackBounds); movePipMenu(null /* pipLeash */, null /* transaction */, stackBounds, PipMenuController.ALPHA_NO_CHANGE); updateMenuBounds(stackBounds); mPipMenuView.showMenu(menuState, stackBounds, allowMenuTimeout, willResizeMenu, withDelay, Loading @@ -311,7 +312,7 @@ public class PhonePipMenuController implements PipMenuController { @Override public void movePipMenu(@Nullable SurfaceControl pipLeash, @Nullable SurfaceControl.Transaction t, Rect destinationBounds) { Rect destinationBounds, float alpha) { if (destinationBounds.isEmpty()) { return; } Loading