diff options
| author | 2019-07-01 15:52:50 -0700 | |
|---|---|---|
| committer | 2019-07-18 10:11:31 -0700 | |
| commit | a5799f8a484788d4d1ee07226288784894a1b12b (patch) | |
| tree | 50ee79faa7415f41ee48cd71ed1ea2457a4978da | |
| parent | ba7fb6a5f66f24c942c8dcd6ca7b0de9fd266ce5 (diff) | |
Ensure applying saved fraction when re-entering PiP
1. Resets PiP fraction once the app is stopped
When in gesture navigation mode, setHidden can be called ahead of
enterPictureInPictureMode, which results the fraction being reset before
accessing the last saved value.
2. Do not set mBoundsAnimating* variables for FADE_IN animation
Bug: 135224920
Test: Manually enter and exit PiP mode
Change-Id: I93d77071d72a2695e510372dff3a48bf97209b8d
| -rw-r--r-- | services/core/java/com/android/server/wm/AppWindowToken.java | 7 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/TaskStack.java | 10 |
2 files changed, 9 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java index 8007c0f316e0..ed3218351210 100644 --- a/services/core/java/com/android/server/wm/AppWindowToken.java +++ b/services/core/java/com/android/server/wm/AppWindowToken.java @@ -1015,6 +1015,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree void notifyAppStopped() { if (DEBUG_ADD_REMOVE) Slog.v(TAG, "notifyAppStopped: " + this); mAppStopped = true; + // Reset the last saved PiP snap fraction on app stop. + mDisplayContent.mPinnedStackControllerLocked.resetReentrySnapFraction(this); destroySurfaces(); // Remove any starting window that was added for this app if they are still around. removeStartingWindow(); @@ -3072,11 +3074,6 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree @Override void setHidden(boolean hidden) { super.setHidden(hidden); - - if (hidden) { - // Once the app window is hidden, reset the last saved PiP snap fraction - mDisplayContent.mPinnedStackControllerLocked.resetReentrySnapFraction(this); - } scheduleAnimation(); } diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java index eb45e73d47a4..79367a050d46 100644 --- a/services/core/java/com/android/server/wm/TaskStack.java +++ b/services/core/java/com/android/server/wm/TaskStack.java @@ -321,7 +321,9 @@ public class TaskStack extends WindowContainer<Task> implements */ private void setAnimationFinalBounds(Rect sourceHintBounds, Rect destBounds, boolean toFullscreen) { - mBoundsAnimatingRequested = true; + if (mAnimationType == BoundsAnimationController.BOUNDS) { + mBoundsAnimatingRequested = true; + } mBoundsAnimatingToFullscreen = toFullscreen; if (destBounds != null) { mBoundsAnimationTarget.set(destBounds); @@ -1586,8 +1588,10 @@ public class TaskStack extends WindowContainer<Task> implements return false; } - mBoundsAnimatingRequested = false; - mBoundsAnimating = true; + if (animationType == BoundsAnimationController.BOUNDS) { + mBoundsAnimatingRequested = false; + mBoundsAnimating = true; + } mAnimationType = animationType; // If we are changing UI mode, as in the PiP to fullscreen |