Loading packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java +33 −17 Original line number Diff line number Diff line Loading @@ -225,7 +225,7 @@ public class PipTouchHandler implements TunerService.Tunable { if (mIsMinimized) { setMinimizedStateInternal(false); } mDismissViewController.destroyDismissTarget(); cleanUpDismissTarget(); mShowPipMenuOnAnimationEnd = true; } Loading Loading @@ -334,6 +334,12 @@ public class PipTouchHandler implements TunerService.Tunable { mAccessibilityManager.setPictureInPictureActionReplacingConnection(isRegistered ? new PipAccessibilityInteractionConnection(mMotionHelper, this::onAccessibilityShowMenu, mHandler) : null); if (!isRegistered && mTouchState.isUserInteracting()) { // If the input consumer is unregistered while the user is interacting, then we may not // get the final TOUCH_UP event, so clean up the dismiss target as well cleanUpDismissTarget(); } } private void onAccessibilityShowMenu() { Loading Loading @@ -578,12 +584,12 @@ public class PipTouchHandler implements TunerService.Tunable { if (touchState.startedDragging()) { mSavedSnapFraction = -1f; } if (touchState.startedDragging() && ENABLE_DISMISS_DRAG_TO_EDGE) { if (ENABLE_DISMISS_DRAG_TO_EDGE) { mHandler.removeCallbacks(mShowDismissAffordance); mDismissViewController.showDismissTarget(); } } if (touchState.isDragging()) { // Move the pinned stack freely Loading Loading @@ -625,6 +631,12 @@ public class PipTouchHandler implements TunerService.Tunable { @Override public boolean onUp(PipTouchState touchState) { if (ENABLE_DISMISS_DRAG_TO_EDGE) { // Clean up the dismiss target regardless of the touch state in case the touch // enabled state changes while the user is interacting cleanUpDismissTarget(); } if (!touchState.isUserInteracting()) { return false; } Loading @@ -640,8 +652,7 @@ public class PipTouchHandler implements TunerService.Tunable { final boolean isFlingToBot = isFling && vel.y > 0 && !isHorizontal && (mMovementWithinDismiss || isUpWithinDimiss); if (ENABLE_DISMISS_DRAG_TO_EDGE) { try { mHandler.removeCallbacks(mShowDismissAffordance); // Check if the user dragged or flung the PiP offscreen to dismiss it if (mMotionHelper.shouldDismissPip() || isFlingToBot) { mMotionHelper.animateDismiss(mMotionHelper.getBounds(), vel.x, vel.y, mUpdateScrimListener); Loading @@ -650,9 +661,6 @@ public class PipTouchHandler implements TunerService.Tunable { METRIC_VALUE_DISMISSED_BY_DRAG); return true; } } finally { mDismissViewController.destroyDismissTarget(); } } if (touchState.isDragging()) { Loading Loading @@ -728,6 +736,14 @@ public class PipTouchHandler implements TunerService.Tunable { : mNormalMovementBounds; } /** * Removes the dismiss target and cancels any pending callbacks to show it. */ private void cleanUpDismissTarget() { mHandler.removeCallbacks(mShowDismissAffordance); mDismissViewController.destroyDismissTarget(); } public void dump(PrintWriter pw, String prefix) { final String innerPrefix = prefix + " "; pw.println(prefix + TAG); Loading Loading
packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java +33 −17 Original line number Diff line number Diff line Loading @@ -225,7 +225,7 @@ public class PipTouchHandler implements TunerService.Tunable { if (mIsMinimized) { setMinimizedStateInternal(false); } mDismissViewController.destroyDismissTarget(); cleanUpDismissTarget(); mShowPipMenuOnAnimationEnd = true; } Loading Loading @@ -334,6 +334,12 @@ public class PipTouchHandler implements TunerService.Tunable { mAccessibilityManager.setPictureInPictureActionReplacingConnection(isRegistered ? new PipAccessibilityInteractionConnection(mMotionHelper, this::onAccessibilityShowMenu, mHandler) : null); if (!isRegistered && mTouchState.isUserInteracting()) { // If the input consumer is unregistered while the user is interacting, then we may not // get the final TOUCH_UP event, so clean up the dismiss target as well cleanUpDismissTarget(); } } private void onAccessibilityShowMenu() { Loading Loading @@ -578,12 +584,12 @@ public class PipTouchHandler implements TunerService.Tunable { if (touchState.startedDragging()) { mSavedSnapFraction = -1f; } if (touchState.startedDragging() && ENABLE_DISMISS_DRAG_TO_EDGE) { if (ENABLE_DISMISS_DRAG_TO_EDGE) { mHandler.removeCallbacks(mShowDismissAffordance); mDismissViewController.showDismissTarget(); } } if (touchState.isDragging()) { // Move the pinned stack freely Loading Loading @@ -625,6 +631,12 @@ public class PipTouchHandler implements TunerService.Tunable { @Override public boolean onUp(PipTouchState touchState) { if (ENABLE_DISMISS_DRAG_TO_EDGE) { // Clean up the dismiss target regardless of the touch state in case the touch // enabled state changes while the user is interacting cleanUpDismissTarget(); } if (!touchState.isUserInteracting()) { return false; } Loading @@ -640,8 +652,7 @@ public class PipTouchHandler implements TunerService.Tunable { final boolean isFlingToBot = isFling && vel.y > 0 && !isHorizontal && (mMovementWithinDismiss || isUpWithinDimiss); if (ENABLE_DISMISS_DRAG_TO_EDGE) { try { mHandler.removeCallbacks(mShowDismissAffordance); // Check if the user dragged or flung the PiP offscreen to dismiss it if (mMotionHelper.shouldDismissPip() || isFlingToBot) { mMotionHelper.animateDismiss(mMotionHelper.getBounds(), vel.x, vel.y, mUpdateScrimListener); Loading @@ -650,9 +661,6 @@ public class PipTouchHandler implements TunerService.Tunable { METRIC_VALUE_DISMISSED_BY_DRAG); return true; } } finally { mDismissViewController.destroyDismissTarget(); } } if (touchState.isDragging()) { Loading Loading @@ -728,6 +736,14 @@ public class PipTouchHandler implements TunerService.Tunable { : mNormalMovementBounds; } /** * Removes the dismiss target and cancels any pending callbacks to show it. */ private void cleanUpDismissTarget() { mHandler.removeCallbacks(mShowDismissAffordance); mDismissViewController.destroyDismissTarget(); } public void dump(PrintWriter pw, String prefix) { final String innerPrefix = prefix + " "; pw.println(prefix + TAG); Loading