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

Commit b4aa2e9c authored by Ruchi Kandoi's avatar Ruchi Kandoi
Browse files

PowerManager: Adds isSustainedPerformanceModeSupported()



isSustainedPerformanceModeSupported() returns true if the device
supports the mode. It checks for the boolean config
"config_sustainedPerformanceModeSupported" to be set.

Bug: 22864186
Change-Id: I0f9f0bcbb8c02b19f37e9c87570d88e8f78f7992
Signed-off-by: default avatarRuchi Kandoi <kandoiruchi@google.com>
parent cd1e9ad8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29074,6 +29074,7 @@ package android.os {
    method public boolean isInteractive();
    method public boolean isPowerSaveMode();
    method public deprecated boolean isScreenOn();
    method public boolean isSustainedPerformanceModeSupported();
    method public boolean isWakeLockLevelSupported(int);
    method public android.os.PowerManager.WakeLock newWakeLock(int, java.lang.String);
    method public void reboot(java.lang.String);
+1 −0
Original line number Diff line number Diff line
@@ -31307,6 +31307,7 @@ package android.os {
    method public boolean isPowerSaveMode();
    method public boolean isScreenBrightnessBoosted();
    method public deprecated boolean isScreenOn();
    method public boolean isSustainedPerformanceModeSupported();
    method public boolean isWakeLockLevelSupported(int);
    method public android.os.PowerManager.WakeLock newWakeLock(int, java.lang.String);
    method public void reboot(java.lang.String);
+1 −0
Original line number Diff line number Diff line
@@ -29139,6 +29139,7 @@ package android.os {
    method public boolean isInteractive();
    method public boolean isPowerSaveMode();
    method public deprecated boolean isScreenOn();
    method public boolean isSustainedPerformanceModeSupported();
    method public boolean isWakeLockLevelSupported(int);
    method public android.os.PowerManager.WakeLock newWakeLock(int, java.lang.String);
    method public void reboot(java.lang.String);
+10 −0
Original line number Diff line number Diff line
@@ -1030,6 +1030,16 @@ public final class PowerManager {
        }
    }

    /**
     * Returns True if the device supports Sustained Performance Mode.
     * Applications Should check if the device supports this mode, before
     * using {@link #SUSTAINED_PERFORMANCE_WAKE_LOCK}.
     */
    public boolean isSustainedPerformanceModeSupported() {
        return mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_sustainedPerformanceModeSupported);
    }

    /**
     * Intent that is broadcast when the state of {@link #isPowerSaveMode()} changes.
     * This broadcast is only sent to registered receivers.
+3 −0
Original line number Diff line number Diff line
@@ -2504,4 +2504,7 @@
    <!-- True if the device requires AppWidgetService even if it does not have
         the PackageManager.FEATURE_APP_WIDGETS feature -->
    <bool name="config_enableAppWidgetService">false</bool>

    <!-- True if the device supports Sustained Performance Mode-->
    <bool name="config_sustainedPerformanceModeSupported">false</bool>
</resources>
Loading