OSDN Git Service

Fix navigation bar flaky tests
authorCharles Chen <charlesccchen@google.com>
Tue, 18 Dec 2018 09:51:56 +0000 (17:51 +0800)
committerCharles Chen <charlesccchen@google.com>
Tue, 18 Dec 2018 11:51:47 +0000 (19:51 +0800)
commit5bdd3e27fb04a4cbba97cccb9562f520c4f2949d
treeb924727016d51eba62e7a07c7317986afe302009
parent29ca21ba8ed11ef369d8047da6dad1b05e798486
Fix navigation bar flaky tests

The flakiness is because the timing issue on hasNavigationBar.
When a new display is added, onDisplayAdded is called and we may try to
add nav bar before DisplayPolicy#configure is called, which sets
mHasNavigationBar value. Therefore, we may get false from
hasNavigationBar even if a display does support system decorations.

Fixes: 120748674
Test: atest ActivityManagerMultiDisplayTests
Test: atest
ActivityManagerMultiDisplayTests#testNavBarShowingOnDisplayWithDecor *
100

Change-Id: Idb3c3d0874c15a466d179cc471ade5cea890e20e
services/core/java/com/android/server/wm/DisplayPolicy.java