Finish stopping activities if requested

If activity was in process of becoming invisible and it needed to be
finished, we weren't actually finishing it if we tried to do it while
in STOPPING state. This lead to activity being removed from stopping
list and stuck in FINISHING state.

Bug: 34195099
Test: android.server.cts.ActivityManagerActivityVisibilityTests
Test: #testFinishActivityWithMoveTaskToBackAfterPause
Test: #testFinishActivityWithMoveTaskToBackAfterStop
Change-Id: Ic892f998b7fda7d5ede9a84b1ab837dbef40af21
This commit is contained in:
Andrii Kulian
2017-01-30 18:57:44 -08:00
parent 9f5d2b0886
commit 2fec90513c

View File

@@ -3584,6 +3584,7 @@ final class ActivityStack extends ConfigurationContainer implements StackWindowL
|| (prevState == ActivityState.PAUSED
&& (mode == FINISH_AFTER_PAUSE || mStackId == PINNED_STACK_ID))
|| finishingActivityInNonFocusedStack
|| prevState == ActivityState.STOPPING
|| prevState == ActivityState.STOPPED
|| prevState == ActivityState.INITIALIZING) {
r.makeFinishingLocked();