Allow pinned activities to finish immediately

Pinned activities are normally in the paused state so when finishing
they can finish immediately as there might not be additional transition
in the system to finish them.

Bug: 28434641
Bug: 28350881
Change-Id: I5f1eaf0969a7eb08292cb9cc123bf8c0fddc9ea8
This commit is contained in:
Wale Ogunwale
2016-05-02 10:35:45 -07:00
parent f4810f5506
commit ae30f308ee

View File

@@ -3488,11 +3488,10 @@ final class ActivityStack {
r.state = ActivityState.FINISHING;
if (mode == FINISH_IMMEDIATELY
|| (mode == FINISH_AFTER_PAUSE && prevState == ActivityState.PAUSED)
|| (prevState == ActivityState.PAUSED
&& (mode == FINISH_AFTER_PAUSE || mStackId == PINNED_STACK_ID))
|| prevState == ActivityState.STOPPED
|| prevState == ActivityState.INITIALIZING) {
// If this activity is already stopped, we can just finish
// it right now.
r.makeFinishingLocked();
boolean activityRemoved = destroyActivityLocked(r, true, "finish-imm");
if (activityRemoved) {