summaryrefslogtreecommitdiffstats
path: root/libs/gui/include
diff options
context:
space:
mode:
authorAdy Abraham <adyabr@google.com>2019-02-04 10:24:03 -0800
committerAdy Abraham <adyabr@google.com>2019-02-25 13:18:41 -0800
commit838de0622c700345fbfde270c065fdc97f4b9428 (patch)
treed4a6b688e28aeed2edb7696dec890804be054574 /libs/gui/include
parent705fad863861f59eea4668fb17d0752312287a33 (diff)
downloadandroid_frameworks_native-838de0622c700345fbfde270c065fdc97f4b9428.tar.gz
android_frameworks_native-838de0622c700345fbfde270c065fdc97f4b9428.tar.bz2
android_frameworks_native-838de0622c700345fbfde270c065fdc97f4b9428.zip
SurfaceFlinger: add setAllowedDisplayConfigs
Add an API to ISurfaceComposer to set allowed display configurations. This API is expected to be called by DisplayManager depends on the current policy in place. Once setAllowedDisplayConfigs is called, SF can only set a new display config if it is part of the allowed configurations list. Test: call setAllowedDisplayConfigs() from backdoor and observe config change. Bug: 122905403 Change-Id: I1d0a3649bbe7a08efeb72dc270f0b2df330b021c
Diffstat (limited to 'libs/gui/include')
-rw-r--r--libs/gui/include/gui/ISurfaceComposer.h10
-rw-r--r--libs/gui/include/gui/SurfaceComposerClient.h6
2 files changed, 15 insertions, 1 deletions
diff --git a/libs/gui/include/gui/ISurfaceComposer.h b/libs/gui/include/gui/ISurfaceComposer.h
index e6700e77d..0d5b7679e 100644
--- a/libs/gui/include/gui/ISurfaceComposer.h
+++ b/libs/gui/include/gui/ISurfaceComposer.h
@@ -359,6 +359,14 @@ public:
* Removes a listener that was streaming median luma updates from SurfaceFlinger.
*/
virtual status_t removeRegionSamplingListener(const sp<IRegionSamplingListener>& listener) = 0;
+
+ /*
+ * Sets the allowed display configurations to be used.
+ * The allowedConfigs in a vector of indexes corresponding to the configurations
+ * returned from getDisplayConfigs().
+ */
+ virtual status_t setAllowedDisplayConfigs(const sp<IBinder>& displayToken,
+ const std::vector<int32_t>& allowedConfigs) = 0;
};
// ----------------------------------------------------------------------------
@@ -406,7 +414,7 @@ public:
GET_PHYSICAL_DISPLAY_IDS,
ADD_REGION_SAMPLING_LISTENER,
REMOVE_REGION_SAMPLING_LISTENER,
-
+ SET_ALLOWED_DISPLAY_CONFIGS,
// Always append new enum to the end.
};
diff --git a/libs/gui/include/gui/SurfaceComposerClient.h b/libs/gui/include/gui/SurfaceComposerClient.h
index cb38209f6..3c52b105b 100644
--- a/libs/gui/include/gui/SurfaceComposerClient.h
+++ b/libs/gui/include/gui/SurfaceComposerClient.h
@@ -111,6 +111,12 @@ public:
// returned by getDisplayInfo
static status_t setActiveConfig(const sp<IBinder>& display, int id);
+ // Sets the allowed display configurations to be used.
+ // The allowedConfigs in a vector of indexes corresponding to the configurations
+ // returned from getDisplayConfigs().
+ static status_t setAllowedDisplayConfigs(const sp<IBinder>& displayToken,
+ const std::vector<int32_t>& allowedConfigs);
+
// Gets the list of supported color modes for the given display
static status_t getDisplayColorModes(const sp<IBinder>& display,
Vector<ui::ColorMode>* outColorModes);