am ec565efe: am eb2153c7: am 093d8de2: Merge "Finish already paused activity if it should be finished after pausing" into mnc-dev

* commit 'ec565efe706746157883822a93470cb3ef0fe6c0':
  Finish already paused activity if it should be finished after pausing
This commit is contained in:
Wale Ogunwale
2015-07-14 00:39:22 +00:00
committed by Android Git Automerger

View File

@@ -2669,8 +2669,13 @@ final class ActivityStack {
if (!r.finishing) {
if (!mService.isSleeping()) {
if (DEBUG_STATES) Slog.d(TAG_STATES, "no-history finish of " + r);
requestFinishActivityLocked(r.appToken, Activity.RESULT_CANCELED, null,
"stop-no-history", false);
if (requestFinishActivityLocked(r.appToken, Activity.RESULT_CANCELED, null,
"stop-no-history", false)) {
// Activity was finished, no need to continue trying to schedule stop.
adjustFocusedActivityLocked(r, "stopActivityFinished");
r.resumeKeyDispatchingLocked();
return;
}
} else {
if (DEBUG_STATES) Slog.d(TAG_STATES, "Not finishing noHistory " + r
+ " on stop because we're just sleeping");
@@ -2963,6 +2968,7 @@ final class ActivityStack {
r.state = ActivityState.FINISHING;
if (mode == FINISH_IMMEDIATELY
|| (mode == FINISH_AFTER_PAUSE && prevState == ActivityState.PAUSED)
|| prevState == ActivityState.STOPPED
|| prevState == ActivityState.INITIALIZING) {
// If this activity is already stopped, we can just finish