From 35cdd6dd8d9c1494a16a5afd514b1bead4f6f744 Mon Sep 17 00:00:00 2001 From: Wale Ogunwale Date: Thu, 7 Apr 2016 16:39:43 -0700 Subject: [PATCH] Fixed bug with activity moved to pinned stack left in resumed state. When we move an activities task to the pinned stack, we were checking if the previous activity stack is the currently focused stack to see if the activity was resumed. It is possible we changed the focused stack which will cause this check to fail and we will fail to detect that the activity was in the resumed state there by failing to transition it to the paused state. We now only check that the activity is the resumed activity in the previous stack which is sufficient. Bug: 28023315 Change-Id: I0782f385b7ee53307ed9c95e3048bcb4353463f7 --- .../java/com/android/server/am/ActivityStackSupervisor.java | 2 +- 1 file changed, 1 insertion(+), 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 f659bde8d6d4e..3ba8cfde945cb 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -2270,7 +2270,7 @@ public final class ActivityStackSupervisor implements DisplayListener { final ActivityRecord r = task.getTopActivity(); final ActivityStack prevStack = task.stack; final boolean wasFocused = isFocusedStack(prevStack) && (topRunningActivityLocked() == r); - final boolean wasResumed = wasFocused && (prevStack.mResumedActivity == r); + final boolean wasResumed = prevStack.mResumedActivity == r; // In some cases the focused stack isn't the front stack. E.g. pinned stack. // Whenever we are moving the top activity from the front stack we want to make sure to move // the stack to the front.