From 02a4aa261c28df2466234106d61282289276b462 Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Wed, 3 Sep 2014 10:01:24 -0700 Subject: Unconditionally move stack to front. Recents was depending on using moveTaskToFront() to also move the task's stack to the front. But that only works if the task is actually in the stack because moveTaskToFront() doesn't do the stack movement if the task is no longer in the stack. This change calls ActivityStack.moveToFront() in addition to moveTaskToFront(). Fixes bug 17361027. Also logs callingUid when starting an activity. Change-Id: I023f956bafae00f45c58757ff5707ce520f02b55 --- services/core/java/com/android/server/am/ActivityStackSupervisor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index 6bc1c9ce550e..780efa1a0032 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -1262,7 +1262,7 @@ public final class ActivityStackSupervisor implements DisplayListener { if (err == ActivityManager.START_SUCCESS) { final int userId = aInfo != null ? UserHandle.getUserId(aInfo.applicationInfo.uid) : 0; Slog.i(TAG, "START u" + userId + " {" + intent.toShortString(true, true, true, false) - + "} from pid " + (callerApp != null ? callerApp.pid : callingPid) + + "} from uid " + callingUid + " on display " + (container == null ? (mFocusedStack == null ? Display.DEFAULT_DISPLAY : mFocusedStack.mDisplayId) : (container.mActivityDisplay == null ? Display.DEFAULT_DISPLAY : @@ -2075,6 +2075,7 @@ public final class ActivityStackSupervisor implements DisplayListener { } targetStack = inTask.stack; targetStack.moveTaskToFrontLocked(inTask, r, options); + targetStack.moveToFront(); mWindowManager.moveTaskToTop(inTask.taskId); // Check whether we should actually launch the new activity in to the task, -- cgit v1.2.3-59-g8ed1b