Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipBoundsState.java +2 −0 Original line number Diff line number Diff line Loading @@ -622,6 +622,8 @@ public class PipBoundsState { pw.println(innerPrefix + "mShelfHeight=" + mShelfHeight); pw.println(innerPrefix + "mHasUserMovedPip=" + mHasUserMovedPip); pw.println(innerPrefix + "mHasUserResizedPip=" + mHasUserResizedPip); pw.println(innerPrefix + "mMinSize=" + mMinSize); pw.println(innerPrefix + "mMaxSize=" + mMaxSize); if (mPipReentryState == null) { pw.println(innerPrefix + "mPipReentryState=null"); } else { Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java +8 −0 Original line number Diff line number Diff line Loading @@ -579,6 +579,12 @@ public class PipResizeGestureHandler { resizeRectAboutCenter(mLastResizeBounds, mMaxSize.x, mMaxSize.y); } // If user resize is smaller than min size, auto resize to min if (mLastResizeBounds.width() < mMinSize.x || mLastResizeBounds.height() < mMinSize.y) { resizeRectAboutCenter(mLastResizeBounds, mMinSize.x, mMinSize.y); } // get the current movement bounds final Rect movementBounds = mPipBoundsAlgorithm .getMovementBounds(mLastResizeBounds); Loading Loading @@ -679,6 +685,8 @@ public class PipResizeGestureHandler { pw.println(innerPrefix + "mEnablePinchResize=" + mEnablePinchResize); pw.println(innerPrefix + "mThresholdCrossed=" + mThresholdCrossed); pw.println(innerPrefix + "mOhmOffset=" + mOhmOffset); pw.println(innerPrefix + "mMinSize=" + mMinSize); pw.println(innerPrefix + "mMaxSize=" + mMaxSize); } class PipResizeInputEventReceiver extends BatchedInputEventReceiver { Loading libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipPinchInTest.kt +16 −3 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.wm.shell.flicker.pip import android.platform.test.annotations.Presubmit import android.tools.common.Rotation import android.tools.common.flicker.subject.exceptions.IncorrectRegionException import android.tools.device.flicker.junit.FlickerParametersRunnerFactory import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.LegacyFlickerTest Loading @@ -40,14 +41,26 @@ class PipPinchInTest(flicker: LegacyFlickerTest) : PipTransition(flicker) { transitions { pipApp.pinchInPipWindow(wmHelper, 0.4f, 30) } } /** Checks that the visible region area of [pipApp] always decreases during the animation. */ /** * Checks that the visible region area of [pipApp] decreases * and then increases during the animation. */ @Presubmit @Test fun pipLayerAreaDecreases() { fun pipLayerAreaDecreasesThenIncreases() { val isAreaDecreasing = arrayOf(true) flicker.assertLayers { val pipLayerList = this.layers { pipApp.layerMatchesAnyOf(it) && it.isVisible } pipLayerList.zipWithNext { previous, current -> if (isAreaDecreasing[0]) { try { current.visibleRegion.notBiggerThan(previous.visibleRegion.region) } catch (e: IncorrectRegionException) { isAreaDecreasing[0] = false } } else { previous.visibleRegion.notBiggerThan(current.visibleRegion.region) } } } } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipBoundsState.java +2 −0 Original line number Diff line number Diff line Loading @@ -622,6 +622,8 @@ public class PipBoundsState { pw.println(innerPrefix + "mShelfHeight=" + mShelfHeight); pw.println(innerPrefix + "mHasUserMovedPip=" + mHasUserMovedPip); pw.println(innerPrefix + "mHasUserResizedPip=" + mHasUserResizedPip); pw.println(innerPrefix + "mMinSize=" + mMinSize); pw.println(innerPrefix + "mMaxSize=" + mMaxSize); if (mPipReentryState == null) { pw.println(innerPrefix + "mPipReentryState=null"); } else { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java +8 −0 Original line number Diff line number Diff line Loading @@ -579,6 +579,12 @@ public class PipResizeGestureHandler { resizeRectAboutCenter(mLastResizeBounds, mMaxSize.x, mMaxSize.y); } // If user resize is smaller than min size, auto resize to min if (mLastResizeBounds.width() < mMinSize.x || mLastResizeBounds.height() < mMinSize.y) { resizeRectAboutCenter(mLastResizeBounds, mMinSize.x, mMinSize.y); } // get the current movement bounds final Rect movementBounds = mPipBoundsAlgorithm .getMovementBounds(mLastResizeBounds); Loading Loading @@ -679,6 +685,8 @@ public class PipResizeGestureHandler { pw.println(innerPrefix + "mEnablePinchResize=" + mEnablePinchResize); pw.println(innerPrefix + "mThresholdCrossed=" + mThresholdCrossed); pw.println(innerPrefix + "mOhmOffset=" + mOhmOffset); pw.println(innerPrefix + "mMinSize=" + mMinSize); pw.println(innerPrefix + "mMaxSize=" + mMaxSize); } class PipResizeInputEventReceiver extends BatchedInputEventReceiver { Loading
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipPinchInTest.kt +16 −3 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.wm.shell.flicker.pip import android.platform.test.annotations.Presubmit import android.tools.common.Rotation import android.tools.common.flicker.subject.exceptions.IncorrectRegionException import android.tools.device.flicker.junit.FlickerParametersRunnerFactory import android.tools.device.flicker.legacy.FlickerBuilder import android.tools.device.flicker.legacy.LegacyFlickerTest Loading @@ -40,14 +41,26 @@ class PipPinchInTest(flicker: LegacyFlickerTest) : PipTransition(flicker) { transitions { pipApp.pinchInPipWindow(wmHelper, 0.4f, 30) } } /** Checks that the visible region area of [pipApp] always decreases during the animation. */ /** * Checks that the visible region area of [pipApp] decreases * and then increases during the animation. */ @Presubmit @Test fun pipLayerAreaDecreases() { fun pipLayerAreaDecreasesThenIncreases() { val isAreaDecreasing = arrayOf(true) flicker.assertLayers { val pipLayerList = this.layers { pipApp.layerMatchesAnyOf(it) && it.isVisible } pipLayerList.zipWithNext { previous, current -> if (isAreaDecreasing[0]) { try { current.visibleRegion.notBiggerThan(previous.visibleRegion.region) } catch (e: IncorrectRegionException) { isAreaDecreasing[0] = false } } else { previous.visibleRegion.notBiggerThan(current.visibleRegion.region) } } } } Loading