diff --git a/api/current.txt b/api/current.txt index 1b331ac3f07d6..051ad92630f8f 100644 --- a/api/current.txt +++ b/api/current.txt @@ -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); diff --git a/api/system-current.txt b/api/system-current.txt index f50602dd8b5d3..8834461ecadb4 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -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); diff --git a/api/test-current.txt b/api/test-current.txt index f60aab14c1723..2165b327f6cf6 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -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); diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java index a0a16f1a89305..ce176a3691867 100644 --- a/core/java/android/os/PowerManager.java +++ b/core/java/android/os/PowerManager.java @@ -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. diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 1a3d9fb888154..79d6de15669bb 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -2507,4 +2507,7 @@ false + + + false diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 7d19e99f65eb7..1e10f863f0fbe 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -2542,4 +2542,6 @@ + +