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
This commit is contained in:
Wale Ogunwale
2016-04-07 16:39:43 -07:00
parent 03f1e02699
commit 35cdd6dd8d

View File

@@ -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.