summaryrefslogtreecommitdiffstats
path: root/libs/gui/include
diff options
context:
space:
mode:
authorDan Gittik <dangittik@google.com>2019-01-18 16:37:54 +0000
committerMichael Wright <michaelwr@google.com>2019-03-08 17:10:11 +0000
commit57e63c5339381e7fdc8299608182a5c99b13f914 (patch)
tree71eb69f8f51fd8d278b47098b278ac128ecad13f /libs/gui/include
parent994ba6f6d38d283e5269eb22d32528bf5fcb5346 (diff)
downloadandroid_frameworks_native-57e63c5339381e7fdc8299608182a5c99b13f914.tar.gz
android_frameworks_native-57e63c5339381e7fdc8299608182a5c99b13f914.tar.bz2
android_frameworks_native-57e63c5339381e7fdc8299608182a5c99b13f914.zip
Moved brightness from Lights to SF.
Test: manual. Check that brightness works. Fixes: 111435292 Change-Id: I96dfdf0ad5d16fdb03e575cbe05ad4e1dbc8ee36
Diffstat (limited to 'libs/gui/include')
-rw-r--r--libs/gui/include/gui/ISurfaceComposer.h33
-rw-r--r--libs/gui/include/gui/SurfaceComposerClient.h26
2 files changed, 59 insertions, 0 deletions
diff --git a/libs/gui/include/gui/ISurfaceComposer.h b/libs/gui/include/gui/ISurfaceComposer.h
index 0e576ca95..3dffa8f8b 100644
--- a/libs/gui/include/gui/ISurfaceComposer.h
+++ b/libs/gui/include/gui/ISurfaceComposer.h
@@ -376,6 +376,37 @@ public:
*/
virtual status_t getAllowedDisplayConfigs(const sp<IBinder>& displayToken,
std::vector<int32_t>* outAllowedConfigs) = 0;
+ /*
+ * Gets whether brightness operations are supported on a display.
+ *
+ * displayToken
+ * The token of the display.
+ * outSupport
+ * An output parameter for whether brightness operations are supported.
+ *
+ * Returns NO_ERROR upon success. Otherwise,
+ * NAME_NOT_FOUND if the display is invalid, or
+ * BAD_VALUE if the output parameter is invalid.
+ */
+ virtual status_t getDisplayBrightnessSupport(const sp<IBinder>& displayToken,
+ bool* outSupport) const = 0;
+
+ /*
+ * Sets the brightness of a display.
+ *
+ * displayToken
+ * The token of the display whose brightness is set.
+ * brightness
+ * A number between 0.0f (minimum brightness) and 1.0 (maximum brightness), or -1.0f to
+ * turn the backlight off.
+ *
+ * Returns NO_ERROR upon success. Otherwise,
+ * NAME_NOT_FOUND if the display is invalid, or
+ * BAD_VALUE if the brightness is invalid, or
+ * INVALID_OPERATION if brightness operations are not supported.
+ */
+ virtual status_t setDisplayBrightness(const sp<IBinder>& displayToken,
+ float brightness) const = 0;
};
// ----------------------------------------------------------------------------
@@ -425,6 +456,8 @@ public:
REMOVE_REGION_SAMPLING_LISTENER,
SET_ALLOWED_DISPLAY_CONFIGS,
GET_ALLOWED_DISPLAY_CONFIGS,
+ GET_DISPLAY_BRIGHTNESS_SUPPORT,
+ SET_DISPLAY_BRIGHTNESS,
// Always append new enum to the end.
};
diff --git a/libs/gui/include/gui/SurfaceComposerClient.h b/libs/gui/include/gui/SurfaceComposerClient.h
index 48c978f20..39d6d1368 100644
--- a/libs/gui/include/gui/SurfaceComposerClient.h
+++ b/libs/gui/include/gui/SurfaceComposerClient.h
@@ -168,6 +168,32 @@ public:
// Queries whether a given display is wide color display.
static status_t isWideColorDisplay(const sp<IBinder>& display, bool* outIsWideColorDisplay);
+ /*
+ * Returns whether brightness operations are supported on a display.
+ *
+ * displayToken
+ * The token of the display.
+ *
+ * Returns whether brightness operations are supported on a display or not.
+ */
+ static bool getDisplayBrightnessSupport(const sp<IBinder>& displayToken);
+
+ /*
+ * Sets the brightness of a display.
+ *
+ * displayToken
+ * The token of the display whose brightness is set.
+ * brightness
+ * A number between 0.0 (minimum brightness) and 1.0 (maximum brightness), or -1.0f to
+ * turn the backlight off.
+ *
+ * Returns NO_ERROR upon success. Otherwise,
+ * NAME_NOT_FOUND if the display handle is invalid, or
+ * BAD_VALUE if the brightness value is invalid, or
+ * INVALID_OPERATION if brightness operaetions are not supported.
+ */
+ static status_t setDisplayBrightness(const sp<IBinder>& displayToken, float brightness);
+
// ------------------------------------------------------------------------
// surface creation / destruction