summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Fabian Kozynski <kozynski@google.com> 2022-07-21 11:50:22 -0400
committer Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2022-08-19 18:43:47 +0000
commit82bcb2a43449caedc18a300f2dd2a7bc81541602 (patch)
tree9eafdce08434f383233049951477b83fc8ab8597 /libs/androidfw/StringPool.cpp
parentc6f280af4d647c4066f4ef33c55c62d4285fb2da (diff)
Fix race condition in QSTileHost
QSTileHost had three problems that caused a race condition: * Calls to add/remove tiles could come and be executed in any thread. * Different paths to add/remove tiles used different ground truths on what tiles were currently active. * The list of tiles contained in mTileSpecs was not necessarily the same as the visible tiles. This caused the following problem: * If two tiles (usually CustomTile) were removed roughly at the same time, only one of them would actually be removed from the Setting, as both of them would race to remove from the same list. This caused... * There would be leftover tiles that cannot connect to a TileService and therefore show empty UI. The solution is as follows: * Make sure that all operations that modify the tiles are performed in the main thread. * Make sure that all operations that modify the tiles use the same truth for the current state. * Make sure that mTileSpecs always reflects the setting at the end of onTuningChanged. This means that tiles that are destroyed or removed will never be in this list. Test: atest com.android.systemui.qs Test: manual, start Guest user and notice that there are no blank tiles. Fixes: 235561921 Change-Id: I6ffbb7510e6854f18bc427d1ae1e782918c799dc Merged-In: I6ffbb7510e6854f18bc427d1ae1e782918c799dc (cherry picked from commit 7f2bb15f4e40c0e1d1d0b2308444f4f9f449bd3f) (cherry picked from commit 2d3949485591a31a90e7abec5ac7a3dc8597072a) Merged-In: I6ffbb7510e6854f18bc427d1ae1e782918c799dc
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions