summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Riddle Hsu <riddlehsu@google.com> 2018-09-18 01:28:53 +0800
committer Riddle Hsu <riddlehsu@google.com> 2018-09-18 13:08:19 +0800
commitef71377464650f9ef234d08a9a181bfa9003a341 (patch)
tree565cdb7aacd3e163123fcdf4193f83ab00678172
parent3bbff814edf69e5c80ee10a24048a39bfec12385 (diff)
Fix unable to resume show-when-lock activity
When the show-when-lock activity is becoming top because the other top non-show-when-lock activities are removed or moved to back, the occluded state may not been updated that causes activity state stays at stopped and visible. Bug: 115499058 Test: atest CtsActivityManagerDeviceTestCases:KeyguardTests Change-Id: I540f591755b51da777480f8b3ae2a8bedfc2ff5f
-rw-r--r--services/core/java/com/android/server/am/ActivityStack.java25
1 files changed, 18 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index aa4e68d492b4..69f60c432565 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -2455,13 +2455,24 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
if (shouldSleepOrShutDownActivities()
&& mLastPausedActivity == next
&& mStackSupervisor.allPausedActivitiesComplete()) {
- // Make sure we have executed any pending transitions, since there
- // should be nothing left to do at this point.
- executeAppTransition(options);
- if (DEBUG_STATES) Slog.d(TAG_STATES,
- "resumeTopActivityLocked: Going to sleep and all paused");
- if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked();
- return false;
+ // If the current top activity may be able to occlude keyguard but the occluded state
+ // has not been set, update visibility and check again if we should continue to resume.
+ boolean nothingToResume = true;
+ if (!mService.mShuttingDown && !mTopActivityOccludesKeyguard
+ && next.canShowWhenLocked()) {
+ ensureActivitiesVisibleLocked(null /* starting */, 0 /* configChanges */,
+ !PRESERVE_WINDOWS);
+ nothingToResume = shouldSleepActivities();
+ }
+ if (nothingToResume) {
+ // Make sure we have executed any pending transitions, since there
+ // should be nothing left to do at this point.
+ executeAppTransition(options);
+ if (DEBUG_STATES) Slog.d(TAG_STATES,
+ "resumeTopActivityLocked: Going to sleep and all paused");
+ if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked();
+ return false;
+ }
}
// Make sure that the user who owns this activity is started. If not,