summaryrefslogtreecommitdiff
path: root/api/api_test.go
diff options
context:
space:
mode:
author Nicolo' Mazzucato <nicomazz@google.com> 2023-03-13 20:15:37 +0000
committer Nicolò Mazzucato <nicomazz@google.com> 2023-03-16 13:50:51 +0000
commit83f8dbdaf1a0fa06b20b0bf3e485cd309b569950 (patch)
treee987a81219c702d086adedc2f067b52ad0a9bd31 /api/api_test.go
parent4626fa48c4c494208918c8141ddbf275dbc70616 (diff)
Use separate locks for BatteryController estimation and callbacks
Initially mFetchCallbacks was used as a lock for everything going on in the class. From droidfooders traces we noticed that getEstimatedTimeRemainingString was blocking the main thread because an estimate update was going on the in background, even if it was only waiting to add a callback to a list. This was causing priority inversion (ui thread depending on the background thread with less priority), ending up blocking the ui thread for 150ms. With this cl there are 2 locks: one just for the callbacks list, and one for the estimate computations Bug: 272677942 Test: BatteryControllerTest Change-Id: I31cc862161377678f60b70f5870a5295bb2625fa
Diffstat (limited to 'api/api_test.go')
0 files changed, 0 insertions, 0 deletions