diff options
author | p13451 <cheoloh.park@gmail.com> | 2012-04-18 11:39:23 +0900 |
---|---|---|
committer | Tanguy Pruvot <tanguy.pruvot@gmail.com> | 2012-06-07 16:51:49 +0200 |
commit | 3d50e44ed1e616d5a52548082aab02de142491c2 (patch) | |
tree | 67f050b0e8ea0723091005f080bd1ca62a8decdf | |
parent | b3f735fdcdbbe0d3b2f7cd2f0a5b0a09b0d3e521 (diff) | |
download | frameworks_base-3d50e44ed1e616d5a52548082aab02de142491c2.zip frameworks_base-3d50e44ed1e616d5a52548082aab02de142491c2.tar.gz frameworks_base-3d50e44ed1e616d5a52548082aab02de142491c2.tar.bz2 |
Issue: Foreground activity performs [Resume] and [Pause] when any process died in sleep mode.
Step to Reproduce
1) Turn off device’s screen. (Sleep mode)
2) Kill any process.
A. Engineer Version: kill [PID]
B. User Version: am force-stop [Package Name]
3) Foreground activity proceed [Resume] and [Pause] consecutively.
Reason: Since ICS version, activity goes to stopped status when screen turns off.
stopIfSleepingLocked( ) makes activity to stopped status but, pauseIfSleepingLocked( ) was used in GB
and, activity keep paused status and, this problem did not occur.
This change give effect to resuming activity when any process was killed.
Because, resume is proceed without exception for activity status.
The exception only filtered for [ActivityState.PAUSED] in sleep or shutdown mode.
and, resume complete flow when activity status was [ActivityState.STOPPED].
Solution for this issue:
We think that exception’s condition have to change if stopped activity status is intended in sleep mode.
According to activity life cycle, activity can not resume from stop status.
Also check [ActivityState.STOPPING]. :)
Change-Id: Icca3366ac30ffa3b18f6e2393e4d7309089ef26a
-rw-r--r-- | services/java/com/android/server/am/ActivityStack.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java index 351dbb8..86d3a1a 100644 --- a/services/java/com/android/server/am/ActivityStack.java +++ b/services/java/com/android/server/am/ActivityStack.java @@ -1314,7 +1314,10 @@ final class ActivityStack { // If we are sleeping, and there is no resumed activity, and the top // activity is paused, well that is the state we want. if ((mService.mSleeping || mService.mShuttingDown) - && mLastPausedActivity == next && next.state == ActivityState.PAUSED) { + && mLastPausedActivity == next + && (next.state == ActivityState.PAUSED + || next.state == ActivityState.STOPPED + || next.state == ActivityState.STOPPING)) { // Make sure we have executed any pending transitions, since there // should be nothing left to do at this point. mService.mWindowManager.executeAppTransition(); |