From 371c44222f4f3268778efaf20368c92beaa2640c Mon Sep 17 00:00:00 2001 From: Chong Zhang Date: Wed, 11 May 2016 10:48:32 -0700 Subject: [PATCH] Deliver new activity options after the activity is made visible The return options need to be sent in makeVisibleIfNeeded() (where app is made visible from invisible), in addition to handleAlreadyVisible(). We can't rely on getting a second ensureActivitiesVisibleLocked to send the activity options. bug: 28610520 Change-Id: I38a4fd4624daecddfe9ea49c87753b04b154bb82 --- .../core/java/com/android/server/am/ActivityStack.java | 7 ++++--- 1 file changed, 4 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 d74e22e57e550..d29f7c600d633 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -1752,6 +1752,9 @@ final class ActivityStack { } } else if (r.visible) { // If this activity is already visible, then there is nothing to do here. + if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, + "Skipping: already visible at " + r); + if (handleAlreadyVisible(r)) { resumeNextActivity = false; } @@ -1933,8 +1936,6 @@ final class ActivityStack { r.sleeping = false; r.app.pendingUiClean = true; r.app.thread.scheduleWindowVisibility(r.appToken, true); - r.stopFreezingScreenLocked(false); - // The activity may be waiting for stop, but that is no longer // appropriate for it. mStackSupervisor.mStoppingActivities.remove(r); @@ -1944,10 +1945,10 @@ final class ActivityStack { // visible when it next restarts. Slog.w(TAG, "Exception thrown making visibile: " + r.intent.getComponent(), e); } + handleAlreadyVisible(r); } private boolean handleAlreadyVisible(ActivityRecord r) { - if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "Skipping: already visible at " + r); r.stopFreezingScreenLocked(false); try { if (r.returningOptions != null) {