summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorBryce Lee <brycelee@google.com>2015-03-25 16:16:42 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-03-25 16:16:42 +0000
commit3309be5e7bc782d89adaf4abca5f1f81649c655f (patch)
tree7eff6568f655f986a77fdda2b15c41a7878a0998 /core/java
parentb0d49833be8a00a8466aeea6a839869371a90425 (diff)
parent21b7e6de94b1e4d0bbe2f1a13ac19f491ff466ed (diff)
downloadframeworks_base-3309be5e7bc782d89adaf4abca5f1f81649c655f.zip
frameworks_base-3309be5e7bc782d89adaf4abca5f1f81649c655f.tar.gz
frameworks_base-3309be5e7bc782d89adaf4abca5f1f81649c655f.tar.bz2
am 21b7e6de: am c831b978: Merge "Add isScreenBrightnessBoosted and a broadcast when underlying value changes." into lmp-mr1-modular-dev
* commit '21b7e6de94b1e4d0bbe2f1a13ac19f491ff466ed': Add isScreenBrightnessBoosted and a broadcast when underlying value changes.
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/os/IPowerManager.aidl1
-rw-r--r--core/java/android/os/PowerManager.java26
2 files changed, 27 insertions, 0 deletions
diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl
index 16dac7d..f187934 100644
--- a/core/java/android/os/IPowerManager.aidl
+++ b/core/java/android/os/IPowerManager.aidl
@@ -50,6 +50,7 @@ interface IPowerManager
void setStayOnSetting(int val);
void boostScreenBrightness(long time);
+ boolean isScreenBrightnessBoosted();
// temporarily overrides the screen brightness settings to allow the user to
// see the effect of a settings change without applying it immediately
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index de970cb..0145c96 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -712,6 +712,22 @@ public final class PowerManager {
}
/**
+ * Returns whether the screen brightness is currently boosted to maximum, caused by a call
+ * to {@link #boostScreenBrightness(long)}.
+ * @return {@code True} if the screen brightness is currently boosted. {@code False} otherwise.
+ *
+ * @hide
+ */
+ @SystemApi
+ public boolean isScreenBrightnessBoosted() {
+ try {
+ return mService.isScreenBrightnessBoosted();
+ } catch (RemoteException e) {
+ return false;
+ }
+ }
+
+ /**
* Sets the brightness of the backlights (screen, keyboard, button).
* <p>
* Requires the {@link android.Manifest.permission#DEVICE_POWER} permission.
@@ -892,6 +908,16 @@ public final class PowerManager {
public static final String EXTRA_POWER_SAVE_MODE = "mode";
/**
+ * Intent that is broadcast when the state of {@link #isScreenBrightnessBoosted()} has changed.
+ * This broadcast is only sent to registered receivers.
+ *
+ * @hide
+ **/
+ @SystemApi
+ public static final String ACTION_SCREEN_BRIGHTNESS_BOOST_CHANGED
+ = "android.os.action.SCREEN_BRIGHTNESS_BOOST_CHANGED";
+
+ /**
* A wake lock is a mechanism to indicate that your application needs
* to have the device stay on.
* <p>