OSDN Git Service

Setting a wallpaper must be synchronous
authorChristopher Tate <ctate@google.com>
Tue, 29 Aug 2017 23:50:13 +0000 (16:50 -0700)
committerChristopher Tate <ctate@google.com>
Tue, 29 Aug 2017 23:50:13 +0000 (16:50 -0700)
commit8efbe0d7ef86ea54566dd89429ebd137cce1033d
tree1e9a4a66d2a95ecbf8ad75e9142e95c18a29c1a1
parent156955898fe8a533ab5eafd9f41b5cb98f860e5b
Setting a wallpaper must be synchronous

Observable state needs to be fully established by the time the
caller is allowed to proceed, otherwise they might read stale
information.  In particular, we hadn't yet committed changes to
the backing store by the time observers were released, so they
could then read a stale generation number as the "current" state.

With this fix, the flaky CTS test is now reliably passing.

Test: cts-tradefed run cts-dev -m CtsAppTestCases -t android.app.cts.WallpaperManagerTest\#setBitmapTest
Bug: 65016846
Change-Id: I93fc690caedfbcd455a91625a3c67fff9168483b
services/core/java/com/android/server/wallpaper/WallpaperManagerService.java