Loading libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java +7 −5 Original line number Diff line number Diff line Loading @@ -320,6 +320,7 @@ public abstract class WMShellModule { ShellCommandHandler shellCommandHandler, ShellController shellController, DisplayController displayController, PipAnimationController pipAnimationController, PipAppOpsListener pipAppOpsListener, PipBoundsAlgorithm pipBoundsAlgorithm, PhonePipKeepClearAlgorithm pipKeepClearAlgorithm, Loading @@ -339,11 +340,12 @@ public abstract class WMShellModule { @ShellMainThread ShellExecutor mainExecutor) { return Optional.ofNullable(PipController.create( context, shellInit, shellCommandHandler, shellController, displayController, pipAppOpsListener, pipBoundsAlgorithm, pipKeepClearAlgorithm, pipBoundsState, pipMotionHelper, pipMediaController, phonePipMenuController, pipTaskOrganizer, pipTransitionState, pipTouchHandler, pipTransitionController, windowManagerShellWrapper, taskStackListener, pipParamsChangedForwarder, displayInsetsController, oneHandedController, mainExecutor)); displayController, pipAnimationController, pipAppOpsListener, pipBoundsAlgorithm, pipKeepClearAlgorithm, pipBoundsState, pipMotionHelper, pipMediaController, phonePipMenuController, pipTaskOrganizer, pipTransitionState, pipTouchHandler, pipTransitionController, windowManagerShellWrapper, taskStackListener, pipParamsChangedForwarder, displayInsetsController, oneHandedController, mainExecutor)); } @WMSingleton Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java +11 −0 Original line number Diff line number Diff line Loading @@ -194,6 +194,17 @@ public class PipAnimationController { return animator; } /** * Returns true if the PiP window is currently being animated. */ public boolean isAnimating() { PipAnimationController.PipTransitionAnimator animator = getCurrentAnimator(); if (animator != null && animator.isRunning()) { return true; } return false; } /** * Quietly cancel the animator by removing the listeners first. */ Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java +0 −13 Original line number Diff line number Diff line Loading @@ -324,19 +324,6 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, return mPipTransitionController; } /** * Returns true if the PiP window is currently being animated. */ public boolean isAnimating() { // TODO(b/183746978) move this to PipAnimationController, and inject that in PipController PipAnimationController.PipTransitionAnimator animator = mPipAnimationController.getCurrentAnimator(); if (animator != null && animator.isRunning()) { return true; } return false; } public Rect getCurrentOrAnimatingBounds() { PipAnimationController.PipTransitionAnimator animator = mPipAnimationController.getCurrentAnimator(); Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +11 −6 Original line number Diff line number Diff line Loading @@ -130,6 +130,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb private DisplayController mDisplayController; private PipInputConsumer mPipInputConsumer; private WindowManagerShellWrapper mWindowManagerShellWrapper; private PipAnimationController mPipAnimationController; private PipAppOpsListener mAppOpsListener; private PipMediaController mMediaController; private PipBoundsAlgorithm mPipBoundsAlgorithm; Loading Loading @@ -158,7 +159,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb return; } // if there is another animation ongoing, wait for it to finish and try again if (mPipTaskOrganizer.isAnimating()) { if (mPipAnimationController.isAnimating()) { mMainExecutor.removeCallbacks( mMovePipInResponseToKeepClearAreasChangeCallback); mMainExecutor.executeDelayed( Loading Loading @@ -368,6 +369,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb ShellCommandHandler shellCommandHandler, ShellController shellController, DisplayController displayController, PipAnimationController pipAnimationController, PipAppOpsListener pipAppOpsListener, PipBoundsAlgorithm pipBoundsAlgorithm, PipKeepClearAlgorithm pipKeepClearAlgorithm, Loading @@ -392,11 +394,12 @@ public class PipController implements PipTransitionController.PipTransitionCallb } return new PipController(context, shellInit, shellCommandHandler, shellController, displayController, pipAppOpsListener, pipBoundsAlgorithm, pipKeepClearAlgorithm, pipBoundsState, pipMotionHelper, pipMediaController, phonePipMenuController, pipTaskOrganizer, pipTransitionState, pipTouchHandler, pipTransitionController, windowManagerShellWrapper, taskStackListener, pipParamsChangedForwarder, displayInsetsController, oneHandedController, mainExecutor) displayController, pipAnimationController, pipAppOpsListener, pipBoundsAlgorithm, pipKeepClearAlgorithm, pipBoundsState, pipMotionHelper, pipMediaController, phonePipMenuController, pipTaskOrganizer, pipTransitionState, pipTouchHandler, pipTransitionController, windowManagerShellWrapper, taskStackListener, pipParamsChangedForwarder, displayInsetsController, oneHandedController, mainExecutor) .mImpl; } Loading @@ -405,6 +408,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb ShellCommandHandler shellCommandHandler, ShellController shellController, DisplayController displayController, PipAnimationController pipAnimationController, PipAppOpsListener pipAppOpsListener, PipBoundsAlgorithm pipBoundsAlgorithm, PipKeepClearAlgorithm pipKeepClearAlgorithm, Loading Loading @@ -445,6 +449,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb mMediaController = pipMediaController; mMenuController = phonePipMenuController; mTouchHandler = pipTouchHandler; mPipAnimationController = pipAnimationController; mAppOpsListener = pipAppOpsListener; mOneHandedController = oneHandedController; mPipTransitionController = pipTransitionController; Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java +6 −4 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import com.android.wm.shell.common.DisplayLayout; import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.TaskStackListenerImpl; import com.android.wm.shell.onehanded.OneHandedController; import com.android.wm.shell.pip.PipAnimationController; import com.android.wm.shell.pip.PipAppOpsListener; import com.android.wm.shell.pip.PipBoundsAlgorithm; import com.android.wm.shell.pip.PipBoundsState; Loading Loading @@ -85,6 +86,7 @@ public class PipControllerTest extends ShellTestCase { @Mock private ShellCommandHandler mMockShellCommandHandler; @Mock private DisplayController mMockDisplayController; @Mock private PhonePipMenuController mMockPhonePipMenuController; @Mock private PipAnimationController mMockPipAnimationController; @Mock private PipAppOpsListener mMockPipAppOpsListener; @Mock private PipBoundsAlgorithm mMockPipBoundsAlgorithm; @Mock private PhonePipKeepClearAlgorithm mMockPipKeepClearAlgorithm; Loading Loading @@ -117,8 +119,8 @@ public class PipControllerTest extends ShellTestCase { mShellController = spy(new ShellController(mShellInit, mMockShellCommandHandler, mMockExecutor)); mPipController = new PipController(mContext, mShellInit, mMockShellCommandHandler, mShellController, mMockDisplayController, mMockPipAppOpsListener, mMockPipBoundsAlgorithm, mMockPipKeepClearAlgorithm, mShellController, mMockDisplayController, mMockPipAnimationController, mMockPipAppOpsListener, mMockPipBoundsAlgorithm, mMockPipKeepClearAlgorithm, mMockPipBoundsState, mMockPipMotionHelper, mMockPipMediaController, mMockPhonePipMenuController, mMockPipTaskOrganizer, mMockPipTransitionState, mMockPipTouchHandler, mMockPipTransitionController, mMockWindowManagerShellWrapper, Loading Loading @@ -183,8 +185,8 @@ public class PipControllerTest extends ShellTestCase { ShellInit shellInit = new ShellInit(mMockExecutor); assertNull(PipController.create(spyContext, shellInit, mMockShellCommandHandler, mShellController, mMockDisplayController, mMockPipAppOpsListener, mMockPipBoundsAlgorithm, mMockPipKeepClearAlgorithm, mShellController, mMockDisplayController, mMockPipAnimationController, mMockPipAppOpsListener, mMockPipBoundsAlgorithm, mMockPipKeepClearAlgorithm, mMockPipBoundsState, mMockPipMotionHelper, mMockPipMediaController, mMockPhonePipMenuController, mMockPipTaskOrganizer, mMockPipTransitionState, mMockPipTouchHandler, mMockPipTransitionController, mMockWindowManagerShellWrapper, Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java +7 −5 Original line number Diff line number Diff line Loading @@ -320,6 +320,7 @@ public abstract class WMShellModule { ShellCommandHandler shellCommandHandler, ShellController shellController, DisplayController displayController, PipAnimationController pipAnimationController, PipAppOpsListener pipAppOpsListener, PipBoundsAlgorithm pipBoundsAlgorithm, PhonePipKeepClearAlgorithm pipKeepClearAlgorithm, Loading @@ -339,11 +340,12 @@ public abstract class WMShellModule { @ShellMainThread ShellExecutor mainExecutor) { return Optional.ofNullable(PipController.create( context, shellInit, shellCommandHandler, shellController, displayController, pipAppOpsListener, pipBoundsAlgorithm, pipKeepClearAlgorithm, pipBoundsState, pipMotionHelper, pipMediaController, phonePipMenuController, pipTaskOrganizer, pipTransitionState, pipTouchHandler, pipTransitionController, windowManagerShellWrapper, taskStackListener, pipParamsChangedForwarder, displayInsetsController, oneHandedController, mainExecutor)); displayController, pipAnimationController, pipAppOpsListener, pipBoundsAlgorithm, pipKeepClearAlgorithm, pipBoundsState, pipMotionHelper, pipMediaController, phonePipMenuController, pipTaskOrganizer, pipTransitionState, pipTouchHandler, pipTransitionController, windowManagerShellWrapper, taskStackListener, pipParamsChangedForwarder, displayInsetsController, oneHandedController, mainExecutor)); } @WMSingleton Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java +11 −0 Original line number Diff line number Diff line Loading @@ -194,6 +194,17 @@ public class PipAnimationController { return animator; } /** * Returns true if the PiP window is currently being animated. */ public boolean isAnimating() { PipAnimationController.PipTransitionAnimator animator = getCurrentAnimator(); if (animator != null && animator.isRunning()) { return true; } return false; } /** * Quietly cancel the animator by removing the listeners first. */ Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java +0 −13 Original line number Diff line number Diff line Loading @@ -324,19 +324,6 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, return mPipTransitionController; } /** * Returns true if the PiP window is currently being animated. */ public boolean isAnimating() { // TODO(b/183746978) move this to PipAnimationController, and inject that in PipController PipAnimationController.PipTransitionAnimator animator = mPipAnimationController.getCurrentAnimator(); if (animator != null && animator.isRunning()) { return true; } return false; } public Rect getCurrentOrAnimatingBounds() { PipAnimationController.PipTransitionAnimator animator = mPipAnimationController.getCurrentAnimator(); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +11 −6 Original line number Diff line number Diff line Loading @@ -130,6 +130,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb private DisplayController mDisplayController; private PipInputConsumer mPipInputConsumer; private WindowManagerShellWrapper mWindowManagerShellWrapper; private PipAnimationController mPipAnimationController; private PipAppOpsListener mAppOpsListener; private PipMediaController mMediaController; private PipBoundsAlgorithm mPipBoundsAlgorithm; Loading Loading @@ -158,7 +159,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb return; } // if there is another animation ongoing, wait for it to finish and try again if (mPipTaskOrganizer.isAnimating()) { if (mPipAnimationController.isAnimating()) { mMainExecutor.removeCallbacks( mMovePipInResponseToKeepClearAreasChangeCallback); mMainExecutor.executeDelayed( Loading Loading @@ -368,6 +369,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb ShellCommandHandler shellCommandHandler, ShellController shellController, DisplayController displayController, PipAnimationController pipAnimationController, PipAppOpsListener pipAppOpsListener, PipBoundsAlgorithm pipBoundsAlgorithm, PipKeepClearAlgorithm pipKeepClearAlgorithm, Loading @@ -392,11 +394,12 @@ public class PipController implements PipTransitionController.PipTransitionCallb } return new PipController(context, shellInit, shellCommandHandler, shellController, displayController, pipAppOpsListener, pipBoundsAlgorithm, pipKeepClearAlgorithm, pipBoundsState, pipMotionHelper, pipMediaController, phonePipMenuController, pipTaskOrganizer, pipTransitionState, pipTouchHandler, pipTransitionController, windowManagerShellWrapper, taskStackListener, pipParamsChangedForwarder, displayInsetsController, oneHandedController, mainExecutor) displayController, pipAnimationController, pipAppOpsListener, pipBoundsAlgorithm, pipKeepClearAlgorithm, pipBoundsState, pipMotionHelper, pipMediaController, phonePipMenuController, pipTaskOrganizer, pipTransitionState, pipTouchHandler, pipTransitionController, windowManagerShellWrapper, taskStackListener, pipParamsChangedForwarder, displayInsetsController, oneHandedController, mainExecutor) .mImpl; } Loading @@ -405,6 +408,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb ShellCommandHandler shellCommandHandler, ShellController shellController, DisplayController displayController, PipAnimationController pipAnimationController, PipAppOpsListener pipAppOpsListener, PipBoundsAlgorithm pipBoundsAlgorithm, PipKeepClearAlgorithm pipKeepClearAlgorithm, Loading Loading @@ -445,6 +449,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb mMediaController = pipMediaController; mMenuController = phonePipMenuController; mTouchHandler = pipTouchHandler; mPipAnimationController = pipAnimationController; mAppOpsListener = pipAppOpsListener; mOneHandedController = oneHandedController; mPipTransitionController = pipTransitionController; Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java +6 −4 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import com.android.wm.shell.common.DisplayLayout; import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.TaskStackListenerImpl; import com.android.wm.shell.onehanded.OneHandedController; import com.android.wm.shell.pip.PipAnimationController; import com.android.wm.shell.pip.PipAppOpsListener; import com.android.wm.shell.pip.PipBoundsAlgorithm; import com.android.wm.shell.pip.PipBoundsState; Loading Loading @@ -85,6 +86,7 @@ public class PipControllerTest extends ShellTestCase { @Mock private ShellCommandHandler mMockShellCommandHandler; @Mock private DisplayController mMockDisplayController; @Mock private PhonePipMenuController mMockPhonePipMenuController; @Mock private PipAnimationController mMockPipAnimationController; @Mock private PipAppOpsListener mMockPipAppOpsListener; @Mock private PipBoundsAlgorithm mMockPipBoundsAlgorithm; @Mock private PhonePipKeepClearAlgorithm mMockPipKeepClearAlgorithm; Loading Loading @@ -117,8 +119,8 @@ public class PipControllerTest extends ShellTestCase { mShellController = spy(new ShellController(mShellInit, mMockShellCommandHandler, mMockExecutor)); mPipController = new PipController(mContext, mShellInit, mMockShellCommandHandler, mShellController, mMockDisplayController, mMockPipAppOpsListener, mMockPipBoundsAlgorithm, mMockPipKeepClearAlgorithm, mShellController, mMockDisplayController, mMockPipAnimationController, mMockPipAppOpsListener, mMockPipBoundsAlgorithm, mMockPipKeepClearAlgorithm, mMockPipBoundsState, mMockPipMotionHelper, mMockPipMediaController, mMockPhonePipMenuController, mMockPipTaskOrganizer, mMockPipTransitionState, mMockPipTouchHandler, mMockPipTransitionController, mMockWindowManagerShellWrapper, Loading Loading @@ -183,8 +185,8 @@ public class PipControllerTest extends ShellTestCase { ShellInit shellInit = new ShellInit(mMockExecutor); assertNull(PipController.create(spyContext, shellInit, mMockShellCommandHandler, mShellController, mMockDisplayController, mMockPipAppOpsListener, mMockPipBoundsAlgorithm, mMockPipKeepClearAlgorithm, mShellController, mMockDisplayController, mMockPipAnimationController, mMockPipAppOpsListener, mMockPipBoundsAlgorithm, mMockPipKeepClearAlgorithm, mMockPipBoundsState, mMockPipMotionHelper, mMockPipMediaController, mMockPhonePipMenuController, mMockPipTaskOrganizer, mMockPipTransitionState, mMockPipTouchHandler, mMockPipTransitionController, mMockWindowManagerShellWrapper, Loading