Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 0e3504c0 authored by jackqdyulei's avatar jackqdyulei
Browse files

Add static lock in PowerProfile

Before this cl, there exists nullpointer crash in PowerProfile in
following part:

"sPowerMap.containsKey(key) && (Double) sPowerMap.get(key) > 0"

To my best knowledge, it is because in
PowerUsageSummary.SummaryProvider, we may create batterystats in
meantime:
1. setListening is invoked in worker thread, in which we will force
update the batterystats.
2. In setListening we will register receiver, which may update
batterystats through onReceive in UI thread.

This cl adds static lock in PowerProfile, making the init part can
only be accessed by an thread at a time.

Bug: 64209576
Test: Manual
Change-Id: I00bc094f44416669b4f0e11e647b0fae2ff61013
parent 6a1dad91
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment