OSDN Git Service

Clear app token mAppStopped when app resumes.
authorWale Ogunwale <ogunwale@google.com>
Fri, 4 Mar 2016 02:28:21 +0000 (18:28 -0800)
committerWale Ogunwale <ogunwale@google.com>
Fri, 4 Mar 2016 02:59:26 +0000 (18:59 -0800)
commit8d5a542f66beae774354038f15dd1afe7fcf754b
treefea20281d9e72db7c86fdd31bd4e90ed996d6e04
parent6d6bbf5f2808e822326322e03c9d336906ff12e4
Clear app token mAppStopped when app resumes.

It is possible for an activity to be in the stopped state without
setting it's visiblility to false in window manager.
For example, the home acitivty behind the lock screen. Since the
lock screen isn't an activity it doesn't affect the visiblity set
of the home activity, so AM doesn't tell WM to hide the app token.
However, AM uses another channel to detect that the device is locked
and moves the activity into stopped state. WM on the other hand also
detects that the device is locked and hides the window surfaces of
all windows behind the lock screen. So, at this point AM has also
told WM that the activity is stopped. Once you unlock the screen
AM resumes the activity but doesn't report any visiblility changes to WM
since it's internal state didn't change. So, if you go from the home
activity to another app the home activity window will be destroyed
before the activity is stopped because mAppStopped is set to true.
We now set mAppStopped to false when the activity is resumed.

Bug: 27286867
Change-Id: Ic75456d30abd582fa44f932f5aeeb449950157ee
core/java/android/view/IWindowManager.aidl
services/core/java/com/android/server/am/ActivityStack.java
services/core/java/com/android/server/wm/AppWindowToken.java
services/core/java/com/android/server/wm/WindowManagerService.java
tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java