From 5007ddded6ec4b47c253d3c039806eb5dd77b40e Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Tue, 12 Jun 2012 13:08:18 -0700 Subject: Make sure to stop noHistory="true" activities properly The code was correctly inducing a 'finish' when such an activity was being stopped, but then was not continuing with the rest of the stop bookkeeping at that point. In some circumstances this could result in an inconsistent state, with the activity marked as finishing but neither in the foreground nor stopped. Bug 6585403 Change-Id: Ib5c5be885bc6534e099e040d87a8589f7b7454ce --- services/java/com/android/server/am/ActivityStack.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java index 6af7a88aed90..8a86fe7a28b1 100755 --- a/services/java/com/android/server/am/ActivityStack.java +++ b/services/java/com/android/server/am/ActivityStack.java @@ -3282,7 +3282,9 @@ final class ActivityStack { requestFinishActivityLocked(r.appToken, Activity.RESULT_CANCELED, null, "no-history"); } - } else if (r.app != null && r.app.thread != null) { + } + + if (r.app != null && r.app.thread != null) { if (mMainStack) { if (mService.mFocusedActivity == r) { mService.setFocusedActivityLocked(topRunningActivityLocked(null)); -- cgit v1.2.3-59-g8ed1b