From 73fd117c6566db42afbb791ac30da3910b549be5 Mon Sep 17 00:00:00 2001 From: louis_chang Date: Mon, 28 Apr 2014 16:59:22 +0800 Subject: [ActivityManager]: Update home process when home activity resumed Symptom: When switch between two home activities, the home process might not be updated to the correct one. In that case, the home activity might be killed easily. Root Cause: The home process is updated only when a home activity is newly created or being restarted. ActivityManager did not update the home process when simply resume a home activity. Solution: Update home process when home activity resumed Reproduce Steps: 1. Install a launcher application, such as Apex Launcher 2. Press home key to change to Apex Launcher by "Just once" option 3. Press home key to switch back to original home activity by "Just once" option. (The home process is still the Apex Launcher's process because ActivityManager does not update the home process when resuming the original home activity.) Change-Id: I046279ca7ba851a283ee67ea19202890f7b3f343 --- services/java/com/android/server/am/ActivityStack.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java index 3d66d84..75d32e3 100755 --- a/services/java/com/android/server/am/ActivityStack.java +++ b/services/java/com/android/server/am/ActivityStack.java @@ -957,6 +957,14 @@ final class ActivityStack { next.idle = false; next.results = null; next.newIntents = null; + + if (next.isHomeActivity() && next.isNotResolverActivity()) { + ProcessRecord app = next.task.mActivities.get(0).app; + if (app != null && app != mService.mHomeProcess) { + mService.mHomeProcess = app; + } + } + if (next.nowVisible) { // We won't get a call to reportActivityVisibleLocked() so dismiss lockscreen now. mStackSupervisor.dismissKeyguard(); -- cgit v1.1