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
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 8007c0f..ed32183 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 @@
     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 @@
     @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();
     }