From 1870389f7733c9135a6948603f53a7d9e28c6703 Mon Sep 17 00:00:00 2001 From: Naomi Musgrave Date: Mon, 19 Jun 2023 13:32:44 +0000 Subject: [PATCH] [MediaProjection] Clarify createVirtualDisplay flags javadoc A client currently has no idea that several of the flags are overridden based on the type passed into IMediaProjectionManager#createProjection (generally by SystemUI, but may be any component with MANAGE_MEDIA_PROJECTION permission). Bug: 286541207 Test: manual Change-Id: I43d155c6ac10dfada948606e43e113ab1b302ede --- media/java/android/media/projection/MediaProjection.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/media/java/android/media/projection/MediaProjection.java b/media/java/android/media/projection/MediaProjection.java index f1cffb63af07d..48367f92e8abd 100644 --- a/media/java/android/media/projection/MediaProjection.java +++ b/media/java/android/media/projection/MediaProjection.java @@ -159,7 +159,14 @@ public final class MediaProjection { * @param surface The surface to which the content of the virtual display should be rendered, * or null if there is none initially. * @param flags A combination of virtual display flags. See {@link DisplayManager} for the - * full list of flags. + * full list of flags. Note that + * {@link DisplayManager#VIRTUAL_DISPLAY_FLAG_PRESENTATION} + * is always enabled. The following flags may be overridden, depending on how + * the component with {android.Manifest.permission.MANAGE_MEDIA_PROJECTION} + * handles the user's consent: + * {@link DisplayManager#VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY}, + * {@link DisplayManager#VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR}, + * {@link DisplayManager#VIRTUAL_DISPLAY_FLAG_PUBLIC}. * @param callback Callback invoked when the virtual display's state changes, or null. * @param handler The {@link android.os.Handler} on which the callback should be invoked, or * null if the callback should be invoked on the calling thread's main