summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wale Ogunwale <ogunwale@google.com> 2017-10-18 18:16:41 +0000
committer android-build-merger <android-build-merger@google.com> 2017-10-18 18:16:41 +0000
commit36276fd6ee5db8481e3d14faaf5772f94fd7ebfe (patch)
treed10ac0953d2f75f56d07db0890f05d48bdbd3136
parentf8084a33b423868af7465dbee879e47bc73e91c9 (diff)
parentb3a89501834c951a12c37638f5ab043e0b1d8ba3 (diff)
Merge "Don't defer client hidden if activity is already paused" into oc-mr1-dev
am: b3a8950183 Change-Id: I594079cd01aedb6f14cb534d43b8c0820a63c442
-rw-r--r--services/core/java/com/android/server/am/ActivityStack.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 148ce08d01f2..199860597f9a 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -65,6 +65,7 @@ import static com.android.server.am.ActivityManagerDebugConfig.POSTFIX_VISIBILIT
import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.am.ActivityRecord.APPLICATION_ACTIVITY_TYPE;
+import static com.android.server.am.ActivityStack.ActivityState.PAUSED;
import static com.android.server.am.ActivityRecord.ASSISTANT_ACTIVITY_TYPE;
import static com.android.server.am.ActivityRecord.HOME_ACTIVITY_TYPE;
import static com.android.server.am.ActivityStack.ActivityState.STOPPED;
@@ -2080,10 +2081,15 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
try {
final boolean canEnterPictureInPicture = r.checkEnterPictureInPictureState(
"makeInvisible", true /* beforeStopping */);
- // Defer telling the client it is hidden if it can enter Pip and isn't current stopped
- // or stopping. This gives it a chance to enter Pip in onPause().
+ // Defer telling the client it is hidden if it can enter Pip and isn't current paused,
+ // stopped or stopping. This gives it a chance to enter Pip in onPause().
+ // TODO: There is still a question surrounding activities in multi-window mode that want
+ // to enter Pip after they are paused, but are still visible. I they should be okay to
+ // enter Pip in those cases, but not "auto-Pip" which is what this condition covers and
+ // the current contract for "auto-Pip" is that the app should enter it before onPause
+ // returns. Just need to confirm this reasoning makes sense.
final boolean deferHidingClient = canEnterPictureInPicture
- && r.state != STOPPING && r.state != STOPPED;
+ && r.state != STOPPING && r.state != STOPPED && r.state != PAUSED;
r.setDeferHidingClient(deferHidingClient);
r.setVisible(false);