Reset mHiddenSetFromTransferredStartingWindow when app set visibility
ag/2276103 fixed an issue where an app token was left in the visible state
due to it getting a tranferred starting window that is later transferred out.
However, we were not resetting the state of the variable we use to track this
when the app actually sets a visibility state which can cause the app to
remain in an hidden state.
Fixes: 62011969
Bug: 38317227
Test: Cold launch Docs apps and change the orientation and make sure the app
is still displayed.
Test: Launch Audible app music player and verify the LibraryActivity
token isn't in the visible state.
Change-Id: I9ff434efe8d29b32021b9881bf36e69de700e70e
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 17db253..f0e0e14 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -341,7 +341,9 @@
boolean delayed = false;
inPendingTransaction = false;
-
+ // Reset the state of mHiddenSetFromTransferredStartingWindow since visibility is actually
+ // been set by the app now.
+ mHiddenSetFromTransferredStartingWindow = false;
setClientHidden(!visible);
// Allow for state changes and animation to be applied if: