diff options
| author | 2014-01-28 18:38:06 +0800 | |
|---|---|---|
| committer | 2014-01-28 18:38:06 +0800 | |
| commit | d5c91ece7bfea74ee7ab2bc86f3cb3f5c531f866 (patch) | |
| tree | e25bab302ca193c2e594958f9c7e278f1b332be9 | |
| parent | 1ff4293e33f98e6dc19e4f154cb497af9bd88c9d (diff) | |
[ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager
Symptom:
When press Home key to home screen, user is able to see the activity's window shown on top of wallpaper and below launcher(widgets).
Root Cause:
The ensureActivitiesVisibleLocked() is called pretty often (for example when a new process bound).
If the top activity "B" was finishing, then the previous activity "A" should be visible.
Therefore, the activity "A" window will be set to visible and then launched activity "A", but it does not updates the visible state in ActivityRecord for "A".
There has a timing issue that if a new activity "C" is started, "C" becomes the new top activity and be resumed.
In that case, Activity "A" window will remain visible even if it is behind a full screen activity "C" because the ActivityRecord.visble of "A" is still false, so the window visibility won't be update.
So when user press home key and back to launcher, the surface of activity "A" will be composed on top of wallpaper.
Solution:
Updates ActivityRecord.visible to true for "A". After "C" is started, the "A" will be called WindowManagerService.setAppVisibility() to set invisible, then called onStop() when execute ensureActivitiesVisibleLocked() again.
Change-Id: I536ba04b95d8d274fea6d679a6493e620bc981e2
| -rwxr-xr-x | services/java/com/android/server/am/ActivityStack.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java index e9c78a7a31a7..d651a6217c49 100755 --- a/services/java/com/android/server/am/ActivityStack.java +++ b/services/java/com/android/server/am/ActivityStack.java @@ -1094,6 +1094,7 @@ final class ActivityStack { if (!r.visible) { if (DEBUG_VISBILITY) Slog.v( TAG, "Starting and making visible: " + r); + r.visible = true; mWindowManager.setAppVisibility(r.appToken, true); } if (r != starting) { |