Merge "DO NOT MERGE -- Correctly finish activity in non-focused stack" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
128a4419e9
@@ -3545,11 +3545,18 @@ final class ActivityStack {
|
||||
|
||||
if (mode == FINISH_IMMEDIATELY
|
||||
|| (prevState == ActivityState.PAUSED
|
||||
&& (mode == FINISH_AFTER_PAUSE || mStackId == PINNED_STACK_ID))
|
||||
&& (mode == FINISH_AFTER_PAUSE || mode == FINISH_AFTER_VISIBLE
|
||||
|| mStackId == PINNED_STACK_ID))
|
||||
|| prevState == ActivityState.STOPPED
|
||||
|| prevState == ActivityState.INITIALIZING) {
|
||||
r.makeFinishingLocked();
|
||||
boolean activityRemoved = destroyActivityLocked(r, true, "finish-imm");
|
||||
|
||||
if (prevState == ActivityState.PAUSED && mode == FINISH_AFTER_VISIBLE) {
|
||||
// Finishing activity that was in paused state - this can happen if it was in
|
||||
// not currently focused stack. Need to make something visible in its place.
|
||||
mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
|
||||
}
|
||||
if (activityRemoved) {
|
||||
mStackSupervisor.resumeFocusedStackTopActivityLocked();
|
||||
}
|
||||
|
||||
@@ -1049,7 +1049,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
|
||||
return r;
|
||||
}
|
||||
|
||||
// Return to the home stack.
|
||||
// Look in other non-focused and non-home stacks.
|
||||
final ArrayList<ActivityStack> stacks = mHomeStack.mStacks;
|
||||
for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
|
||||
final ActivityStack stack = stacks.get(stackNdx);
|
||||
|
||||
Reference in New Issue
Block a user