summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorAdy Abraham <adyabr@google.com>2019-01-24 18:48:58 -0800
committerAdy Abraham <adyabr@google.com>2019-02-22 17:04:03 -0800
commit6070ce1be356df378857504ea0e586da523034a5 (patch)
treef32578c2e20073c29a5d8c749496595b7349d40a /core/java/android
parent01dd1a233ddae45ef8731ca1d50ea0349910aa6c (diff)
SurfaceControl: add setAllowedDisplayConfigs
expose ISurfaceComposer::setAllowedDisplayConfigs to SurfaceControl. 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 SurfaceControl and observe config change. Bug: 122905403 Change-Id: I7f8cc09dbec352701f5dcf2595bee66b8380bc00
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/SurfaceControl.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
index aaf85aff2e8f..070cf110ac6f 100644
--- a/core/java/android/view/SurfaceControl.java
+++ b/core/java/android/view/SurfaceControl.java
@@ -157,6 +157,8 @@ public final class SurfaceControl implements Parcelable {
IBinder displayToken, long numFrames, long timestamp);
private static native int nativeGetActiveConfig(IBinder displayToken);
private static native boolean nativeSetActiveConfig(IBinder displayToken, int id);
+ private static native boolean nativeSetAllowedDisplayConfigs(IBinder displayToken,
+ int[] allowedConfigs);
private static native int[] nativeGetDisplayColorModes(IBinder displayToken);
private static native SurfaceControl.DisplayPrimaries nativeGetDisplayNativePrimaries(
IBinder displayToken);
@@ -1521,6 +1523,20 @@ public final class SurfaceControl implements Parcelable {
/**
* @hide
*/
+ public static boolean setAllowedDisplayConfigs(IBinder displayToken, int[] allowedConfigs) {
+ if (displayToken == null) {
+ throw new IllegalArgumentException("displayToken must not be null");
+ }
+ if (allowedConfigs == null) {
+ throw new IllegalArgumentException("allowedConfigs must not be null");
+ }
+
+ return nativeSetAllowedDisplayConfigs(displayToken, allowedConfigs);
+ }
+
+ /**
+ * @hide
+ */
public static int[] getDisplayColorModes(IBinder displayToken) {
if (displayToken == null) {
throw new IllegalArgumentException("displayToken must not be null");