diff options
| author | Bryce Lee <brycelee@google.com> | 2015-03-17 10:43:08 -0700 |
|---|---|---|
| committer | Bryce Lee <brycelee@google.com> | 2015-03-17 10:43:08 -0700 |
| commit | 84d6c0fbf6e513d68330234503b809751d0e3564 (patch) | |
| tree | da4605a8e06b552498b6a66baa6c828f7522c336 /core/java/android/os/PowerManager.java | |
| parent | 576801ff82a85c4de19404dfe364eef7184b84e0 (diff) | |
| download | frameworks_base-84d6c0fbf6e513d68330234503b809751d0e3564.zip frameworks_base-84d6c0fbf6e513d68330234503b809751d0e3564.tar.gz frameworks_base-84d6c0fbf6e513d68330234503b809751d0e3564.tar.bz2 | |
Add isScreenBrightnessBoosted and a broadcast when underlying
value changes.
Bug: 18334219
Change-Id: I20051e97633017711574a063b8061f95c3b616c5
Diffstat (limited to 'core/java/android/os/PowerManager.java')
| -rw-r--r-- | core/java/android/os/PowerManager.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java index e303f61..b11357e 100644 --- a/core/java/android/os/PowerManager.java +++ b/core/java/android/os/PowerManager.java @@ -706,6 +706,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. @@ -886,6 +902,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> |
