summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2021-01-15 13:18:37 -0800
committerTim Murray <timmurray@google.com>2021-02-01 18:34:20 +0000
commitabffa29b651d0bf75f63843244ea3ae364d3bb24 (patch)
tree91d031755bc28b488d10ed21772246476bc67fc0 /tools/aapt2/java/JavaClassGenerator_test.cpp
parent5d9b76bd83c9e60f6502b2d1dc7bb91b6654aa0e (diff)
UsageStatsService: rewrite locking to avoid contention post-unlock
Various ActivityManager actions require calls to UsageStatsService.reportEventOrAddToQueue(), but that function can block for hundreds of milliseconds while UsageStatsService is initialized during post-unlock. However, the only important part of reportEventOrAddToQueue is the check to see if a user has been unlocked, at which point the action is enqueued on a Handler. Move mUserUnlockedStates to a CopyOnWriteArraySet, which should be updated very infrequently, and allow the common case of "the user is unlocked and an event should be added to the queue" to run concurrently with other UsageStatsService operations. Test: atest android.app.usage.cts.UsageStatsTest Test: atest android.app.usage.UsageStatsTest Test: atest UsageStatsDatabaseTest Bug: 161866124 Change-Id: I11743d78f20db5e5a9471544ae5a1c0ab492202d
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions