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

Commit f334560a authored by jackqdyulei's avatar jackqdyulei Committed by android-build-merger
Browse files

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

am: 9950104f

Change-Id: I9e9c2399969d57f389c4cbe37c77d57d5e4e7175
parents 5731a1ef 9950104f
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -205,14 +205,18 @@ 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)
        synchronized (sLock) {
            if (sPowerMap.size() == 0) {
                readPowerValuesFromXml(context);
            }
            initCpuClusters();
        }
    }

    private void readPowerValuesFromXml(Context context) {
        int id = com.android.internal.R.xml.power_profile;