summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Filip Gruszczynski <gruszczy@google.com> 2015-06-19 15:14:53 -0700
committer Filip Gruszczynski <gruszczy@google.com> 2015-06-19 15:40:47 -0700
commitdd91362c2c65dbcd781034a16f293d5489946f3e (patch)
tree92322a0f50dd157fd150dc13c4c491b544c191fd
parentae363d2db4398a695606c254b88be8940139edd1 (diff)
Make sure home activity gets resumed after started.
When there is only one activity and it gets paused, activity manager will try resuming some other activity. If there is no other activity, it will start home activity and try to resume it. This will fail, because the activity stack doesn't want to enter recursive resuming. We need to detect this situation and schedule additional resume of top activity after home gets started. Bug: 21500945 Change-Id: I6ca703f8d97bcc4001e7da4cd5a5db63bfb5c861
-rw-r--r--services/core/java/com/android/server/am/ActivityStackSupervisor.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 0630cad95c32..2b96f9c4b419 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -831,8 +831,18 @@ public final class ActivityStackSupervisor implements DisplayListener {
void startHomeActivity(Intent intent, ActivityInfo aInfo, String reason) {
moveHomeStackTaskToTop(HOME_ACTIVITY_TYPE, reason);
- startActivityLocked(null, intent, null, aInfo, null, null, null, null, 0, 0, 0, null,
- 0, 0, 0, null, false, null, null, null);
+ startActivityLocked(null /* caller */, intent, null /* resolvedType */, aInfo,
+ null /* voiceSession */, null /* voiceInteractor */, null /* resultTo */,
+ null /* resultWho */, 0 /* requestCode */, 0 /* callingPid */, 0 /* callingUid */,
+ null /* callingPackage */, 0 /* realCallingPid */, 0 /* realCallingUid */,
+ 0 /* startFlags */, null /* options */, false /* componentSpecified */,
+ null /* outActivity */, null /* container */, null /* inTask */);
+ if (inResumeTopActivity) {
+ // If we are in resume section already, home activity will be initialized, but not
+ // resumed (to avoid recursive resume) and will stay that way until something pokes it
+ // again. We need to schedule another resume.
+ scheduleResumeTopActivities();
+ }
}
final int startActivityMayWait(IApplicationThread caller, int callingUid,