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

Commit 9950104f 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

Change-Id: I3ae1a99852d5c9c4a87ee402b3e2e1cc88b8bd0d
parents c71b1e71 dcadf193
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;