Use layer mirroring when screen recording via VD
When a Display has the flag VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR, the
content on the display is expected to mirror another display. This was
previously done by setting the same layerStack. This change removes that
behavior and instead will create a mirror hierarchy of the other display
and place it at the root of the new Display. This is leveraging the work
done for ContentRecorder, but using it as default for all displays
instead of only for VD created by MediaProjection.
Test: Screen record via MediaProjection
Test: Screen record via DisplayManager
Test: ContentRecorderTests
Test: DisplayContentTests
Bug: 237664947
Change-Id: I18b36dadc43ba1c37f9516ff10d24bb8683c04ac
diff --git a/data/etc/services.core.protolog.json b/data/etc/services.core.protolog.json
index ae1c9461..b327bf0 100644
--- a/data/etc/services.core.protolog.json
+++ b/data/etc/services.core.protolog.json
@@ -13,12 +13,24 @@
"group": "WM_DEBUG_STARTING_WINDOW",
"at": "com\/android\/server\/wm\/ActivityRecord.java"
},
+ "-2123789565": {
+ "message": "Found no matching mirror display for id=%d for DEFAULT_DISPLAY. Nothing to mirror.",
+ "level": "WARN",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/DisplayContent.java"
+ },
"-2121056984": {
"message": "%s",
"level": "WARN",
"group": "WM_DEBUG_LOCKTASK",
"at": "com\/android\/server\/wm\/LockTaskController.java"
},
+ "-2113780196": {
+ "message": "Successfully created a ContentRecordingSession for displayId=%d to mirror content from displayId=%d",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/DisplayContent.java"
+ },
"-2111539867": {
"message": "remove IME snapshot, caller=%s",
"level": "INFO",
@@ -1297,6 +1309,12 @@
"group": "WM_DEBUG_CONFIGURATION",
"at": "com\/android\/server\/wm\/ActivityRecord.java"
},
+ "-838378223": {
+ "message": "Attempting to mirror self on %d",
+ "level": "WARN",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/DisplayContent.java"
+ },
"-814760297": {
"message": "Looking for task of %s in %s",
"level": "DEBUG",
@@ -1405,6 +1423,12 @@
"group": "WM_DEBUG_CONTENT_RECORDING",
"at": "com\/android\/server\/wm\/ContentRecorder.java"
},
+ "-729864558": {
+ "message": "Attempting to mirror %d from %d but no DisplayContent associated. Changing to mirror default display.",
+ "level": "WARN",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/DisplayContent.java"
+ },
"-729530161": {
"message": "Moving to DESTROYED: %s (no app)",
"level": "VERBOSE",