summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Biswarup Pal <biswarupp@google.com> 2023-12-29 12:46:04 +0000
committer Biswarup Pal <biswarupp@google.com> 2023-12-30 10:33:27 +0000
commit2cce441b1a981d2b1343c3d89597f876faa25382 (patch)
tree1e47f52bb67423782997f6e0a48a21d4b627bf75
parent7e02e421f7d750828baad12fc6c9b61ea5876a59 (diff)
Ignore home support for auto-mirror virtual displays
Test: atest VirtualDeviceHomeTest Fixes: 318016676 Change-Id: I618491076e08da22607541e8072e6a4949c2116d
-rw-r--r--core/java/android/hardware/display/VirtualDisplayConfig.java7
-rw-r--r--services/core/java/com/android/server/display/DisplayManagerService.java4
2 files changed, 9 insertions, 2 deletions
diff --git a/core/java/android/hardware/display/VirtualDisplayConfig.java b/core/java/android/hardware/display/VirtualDisplayConfig.java
index 9e09759a4282..56f69a67c0b5 100644
--- a/core/java/android/hardware/display/VirtualDisplayConfig.java
+++ b/core/java/android/hardware/display/VirtualDisplayConfig.java
@@ -450,11 +450,14 @@ public final class VirtualDisplayConfig implements Parcelable {
* automatically launched upon the display creation. If unset or set to {@code false}, the
* display will not host any activities upon creation.</p>
*
- * <p>Note: setting to {@code true} requires the display to be trusted. If the display is
- * not trusted, this property is ignored.</p>
+ * <p>Note: setting to {@code true} requires the display to be trusted and to not mirror
+ * content of other displays. If the display is not trusted, or if it mirrors content of
+ * other displays, this property is ignored.</p>
*
* @param isHomeSupported whether home activities are supported on the display
* @see DisplayManager#VIRTUAL_DISPLAY_FLAG_TRUSTED
+ * @see DisplayManager#VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR
+ * @see DisplayManager#VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY
* @hide
*/
@FlaggedApi(android.companion.virtual.flags.Flags.FLAG_VDM_CUSTOM_HOME)
diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java
index bc3f9dd3cb8c..fbac924be283 100644
--- a/services/core/java/com/android/server/display/DisplayManagerService.java
+++ b/services/core/java/com/android/server/display/DisplayManagerService.java
@@ -1615,6 +1615,10 @@ public final class DisplayManagerService extends SystemService {
if ((flags & VIRTUAL_DISPLAY_FLAG_TRUSTED) == 0) {
Slog.w(TAG, "Display created with home support but lacks "
+ "VIRTUAL_DISPLAY_FLAG_TRUSTED, ignoring the home support request.");
+ } else if ((flags & VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR) != 0) {
+ Slog.w(TAG, "Display created with home support but has "
+ + "VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR, ignoring the home support "
+ + "request.");
} else {
mWindowManagerInternal.setHomeSupportedOnDisplay(displayUniqueId,
Display.TYPE_VIRTUAL, true);