OSDN Git Service

Never consider windows visible if appToken is hidden
authorJorim Jaggi <jjaggi@google.com>
Thu, 3 Aug 2017 13:00:01 +0000 (15:00 +0200)
committerJorim Jaggi <jjaggi@google.com>
Thu, 3 Aug 2017 13:00:01 +0000 (15:00 +0200)
commit6dfd9baff1a6f08eaa66a1febae9116dac35323f
tree9d51b3b4c9ff96d6eac86de5ad653411b52b86e4
parent27eb322ed2d04bab3850e05e9a0a5fb08f65026f
Never consider windows visible if appToken is hidden

This fixes a bug with trampoline activities: T1 starts T2 in
onCreate. Now T2 finished itself and in activityResult in T1
T1 starts TNoDisplay that finishes and starts T1' which starts
T2'. Since T1' didn't get the request yet to be hidden
mViewVisibility for the main window is still VISIBLE. Thus, we
note that all windows for T1' are visible and report that to
AM. Note that since visibility of T1' never changed (it was always
hidden) we also don't have an animation set so we don't block
visibility on the fact that there is an animation set.

However, AM was waiting for things to be visible before
destroying T2, and thus destroy T2 before the animation is
actually done, leading to a black hole.

We fix this by only reporting AM things to be visible if our app
token is not hidden.

Test: Above flow, ensure no black hole
Test: go/wm-smoke

Change-Id: Ifde0e9fa1f1381a5b3a1ac9c88fd209d0903e513
Fixes: 62802161
services/core/java/com/android/server/wm/AppWindowToken.java