summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorBryce Lee <brycelee@google.com>2015-03-25 16:52:30 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-03-25 16:52:30 +0000
commita223d658306fea5c0a6d30c9850058d5afadb2d1 (patch)
tree7101f58c2c1384d8b83e514850ae1aded8307b7f /core/java
parentd4b1676f5715d3a92a573a90ccd1cbf6f39f51da (diff)
parent3309be5e7bc782d89adaf4abca5f1f81649c655f (diff)
downloadframeworks_base-a223d658306fea5c0a6d30c9850058d5afadb2d1.zip
frameworks_base-a223d658306fea5c0a6d30c9850058d5afadb2d1.tar.gz
frameworks_base-a223d658306fea5c0a6d30c9850058d5afadb2d1.tar.bz2
am 3309be5e: am 21b7e6de: am c831b978: Merge "Add isScreenBrightnessBoosted and a broadcast when underlying value changes." into lmp-mr1-modular-dev
* commit '3309be5e7bc782d89adaf4abca5f1f81649c655f': 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 418641f..804d3d0 100644
--- a/core/java/android/os/IPowerManager.aidl
+++ b/core/java/android/os/IPowerManager.aidl
@@ -51,6 +51,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 81745b3..01c9a21 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.
@@ -917,6 +933,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>