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

Commit dcadf193 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents 3eda5f4f 0e3504c0
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;