Merge "Add static lock in PowerProfile" into oc-mr1-dev

am: dcadf1934a

Change-Id: I3ae1a99852d5c9c4a87ee402b3e2e1cc88b8bd0d
This commit is contained in:
jackqdyulei
2017-08-31 00:06:06 +00:00
committed by android-build-merger

View File

@@ -205,13 +205,17 @@ public class PowerProfile {
private static final String TAG_ARRAYITEM = "value";
private static final String ATTR_NAME = "name";
private static final Object sLock = new Object();
public PowerProfile(Context context) {
// Read the XML file for the given profile (normally only one per
// device)
if (sPowerMap.size() == 0) {
readPowerValuesFromXml(context);
synchronized (sLock) {
if (sPowerMap.size() == 0) {
readPowerValuesFromXml(context);
}
initCpuClusters();
}
initCpuClusters();
}
private void readPowerValuesFromXml(Context context) {