summaryrefslogtreecommitdiff
path: root/android/hardware/display/DisplayManagerGlobal.java
diff options
context:
space:
mode:
authorJustin Klaassen <justinklaassen@google.com>2018-04-03 23:21:57 -0400
committerJustin Klaassen <justinklaassen@google.com>2018-04-03 23:21:57 -0400
commit4d01eeaffaa720e4458a118baa137a11614f00f7 (patch)
tree66751893566986236788e3c796a7cc5e90d05f52 /android/hardware/display/DisplayManagerGlobal.java
parenta192cc2a132cb0ee8588e2df755563ec7008c179 (diff)
downloadandroid-28-4d01eeaffaa720e4458a118baa137a11614f00f7.tar.gz
Import Android SDK Platform P [4697573]
/google/data/ro/projects/android/fetch_artifact \ --bid 4697573 \ --target sdk_phone_armv7-win_sdk \ sdk-repo-linux-sources-4697573.zip AndroidVersion.ApiLevel has been modified to appear as 28 Change-Id: If80578c3c657366cc9cf75f8db13d46e2dd4e077
Diffstat (limited to 'android/hardware/display/DisplayManagerGlobal.java')
-rw-r--r--android/hardware/display/DisplayManagerGlobal.java52
1 files changed, 52 insertions, 0 deletions
diff --git a/android/hardware/display/DisplayManagerGlobal.java b/android/hardware/display/DisplayManagerGlobal.java
index 2d5f5e04..2d0ef2f2 100644
--- a/android/hardware/display/DisplayManagerGlobal.java
+++ b/android/hardware/display/DisplayManagerGlobal.java
@@ -384,6 +384,17 @@ public final class DisplayManagerGlobal {
}
}
+ /**
+ * Set the level of color saturation to apply to the display.
+ */
+ public void setSaturationLevel(float level) {
+ try {
+ mDm.setSaturationLevel(level);
+ } catch (RemoteException ex) {
+ throw ex.rethrowFromSystemServer();
+ }
+ }
+
public VirtualDisplay createVirtualDisplay(Context context, MediaProjection projection,
String name, int width, int height, int densityDpi, Surface surface, int flags,
VirtualDisplay.Callback callback, Handler handler, String uniqueId) {
@@ -490,6 +501,32 @@ public final class DisplayManagerGlobal {
}
/**
+ * Gets the global brightness configuration for a given user or null if one hasn't been set.
+ *
+ * @hide
+ */
+ public BrightnessConfiguration getBrightnessConfigurationForUser(int userId) {
+ try {
+ return mDm.getBrightnessConfigurationForUser(userId);
+ } catch (RemoteException ex) {
+ throw ex.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Gets the default brightness configuration or null if one hasn't been configured.
+ *
+ * @hide
+ */
+ public BrightnessConfiguration getDefaultBrightnessConfiguration() {
+ try {
+ return mDm.getDefaultBrightnessConfiguration();
+ } catch (RemoteException ex) {
+ throw ex.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Temporarily sets the brightness of the display.
* <p>
* Requires the {@link android.Manifest.permission#CONTROL_DISPLAY_BRIGHTNESS} permission.
@@ -525,6 +562,21 @@ public final class DisplayManagerGlobal {
}
}
+ /**
+ * Retrieves ambient brightness stats.
+ */
+ public List<AmbientBrightnessDayStats> getAmbientBrightnessStats() {
+ try {
+ ParceledListSlice<AmbientBrightnessDayStats> stats = mDm.getAmbientBrightnessStats();
+ if (stats == null) {
+ return Collections.emptyList();
+ }
+ return stats.getList();
+ } catch (RemoteException ex) {
+ throw ex.rethrowFromSystemServer();
+ }
+ }
+
private final class DisplayManagerCallback extends IDisplayManagerCallback.Stub {
@Override
public void onDisplayEvent(int displayId, int event) {