summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/view/ContentRecordingSession.java95
-rw-r--r--core/java/com/android/internal/protolog/ProtoLogGroup.java2
-rw-r--r--core/tests/coretests/src/android/view/ContentRecordingSessionTest.java12
-rw-r--r--data/etc/services.core.protolog.json298
-rw-r--r--services/core/java/com/android/server/wm/ContentRecorder.java67
-rw-r--r--services/core/java/com/android/server/wm/ContentRecordingController.java52
-rw-r--r--services/core/java/com/android/server/wm/DisplayContent.java18
7 files changed, 318 insertions, 226 deletions
diff --git a/core/java/android/view/ContentRecordingSession.java b/core/java/android/view/ContentRecordingSession.java
index c66c70af0656..c1c13171f83c 100644
--- a/core/java/android/view/ContentRecordingSession.java
+++ b/core/java/android/view/ContentRecordingSession.java
@@ -25,7 +25,6 @@ import android.os.IBinder;
import android.os.Parcel;
import android.os.Parcelable;
-import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.DataClass;
import java.lang.annotation.Retention;
@@ -72,11 +71,18 @@ public final class ContentRecordingSession implements Parcelable {
* If {@link #getContentToRecord()} is {@link RecordContent#RECORD_CONTENT_TASK}, then
* represents the {@link android.window.WindowContainerToken} of the Task to record.
*/
- @VisibleForTesting
@Nullable
private IBinder mTokenToRecord = null;
/**
+ * When {@code true}, no mirroring should take place until the user has re-granted access to
+ * the consent token. When {@code false}, recording can begin immediately.
+ *
+ * <p>Only set on the server side to sanitize any input from the client process.
+ */
+ private boolean mWaitingToRecord = false;
+
+ /**
* Default instance, with recording the display.
*/
private ContentRecordingSession() {
@@ -109,9 +115,10 @@ public final class ContentRecordingSession implements Parcelable {
}
/**
- * Returns {@code true} when both sessions are for the same display.
+ * Returns {@code true} when both sessions are on the same
+ * {@link android.hardware.display.VirtualDisplay}.
*/
- public static boolean isSameDisplay(ContentRecordingSession session,
+ public static boolean isProjectionOnSameDisplay(ContentRecordingSession session,
ContentRecordingSession incomingSession) {
return session != null && incomingSession != null
&& session.getDisplayId() == incomingSession.getDisplayId();
@@ -156,7 +163,8 @@ public final class ContentRecordingSession implements Parcelable {
/* package-private */ ContentRecordingSession(
int displayId,
@RecordContent int contentToRecord,
- @VisibleForTesting @Nullable IBinder tokenToRecord) {
+ @Nullable IBinder tokenToRecord,
+ boolean waitingToRecord) {
this.mDisplayId = displayId;
this.mContentToRecord = contentToRecord;
@@ -169,8 +177,7 @@ public final class ContentRecordingSession implements Parcelable {
}
this.mTokenToRecord = tokenToRecord;
- com.android.internal.util.AnnotationValidations.validate(
- VisibleForTesting.class, null, mTokenToRecord);
+ this.mWaitingToRecord = waitingToRecord;
// onConstructed(); // You can define this method to get a callback
}
@@ -200,11 +207,22 @@ public final class ContentRecordingSession implements Parcelable {
* represents the {@link android.window.WindowContainerToken} of the Task to record.
*/
@DataClass.Generated.Member
- public @VisibleForTesting @Nullable IBinder getTokenToRecord() {
+ public @Nullable IBinder getTokenToRecord() {
return mTokenToRecord;
}
/**
+ * When {@code true}, no mirroring should take place until the user has re-granted access to
+ * the consent token. When {@code false}, recording can begin immediately.
+ *
+ * <p>Only set on the server side to sanitize any input from the client process.
+ */
+ @DataClass.Generated.Member
+ public boolean isWaitingToRecord() {
+ return mWaitingToRecord;
+ }
+
+ /**
* Unique logical identifier of the {@link android.hardware.display.VirtualDisplay} that has
* recorded content rendered to its surface.
*/
@@ -240,10 +258,20 @@ public final class ContentRecordingSession implements Parcelable {
* represents the {@link android.window.WindowContainerToken} of the Task to record.
*/
@DataClass.Generated.Member
- public @NonNull ContentRecordingSession setTokenToRecord(@VisibleForTesting @NonNull IBinder value) {
+ public @NonNull ContentRecordingSession setTokenToRecord(@NonNull IBinder value) {
mTokenToRecord = value;
- com.android.internal.util.AnnotationValidations.validate(
- VisibleForTesting.class, null, mTokenToRecord);
+ return this;
+ }
+
+ /**
+ * When {@code true}, no mirroring should take place until the user has re-granted access to
+ * the consent token. When {@code false}, recording can begin immediately.
+ *
+ * <p>Only set on the server side to sanitize any input from the client process.
+ */
+ @DataClass.Generated.Member
+ public @NonNull ContentRecordingSession setWaitingToRecord( boolean value) {
+ mWaitingToRecord = value;
return this;
}
@@ -256,7 +284,8 @@ public final class ContentRecordingSession implements Parcelable {
return "ContentRecordingSession { " +
"displayId = " + mDisplayId + ", " +
"contentToRecord = " + recordContentToString(mContentToRecord) + ", " +
- "tokenToRecord = " + mTokenToRecord +
+ "tokenToRecord = " + mTokenToRecord + ", " +
+ "waitingToRecord = " + mWaitingToRecord +
" }";
}
@@ -275,7 +304,8 @@ public final class ContentRecordingSession implements Parcelable {
return true
&& mDisplayId == that.mDisplayId
&& mContentToRecord == that.mContentToRecord
- && java.util.Objects.equals(mTokenToRecord, that.mTokenToRecord);
+ && java.util.Objects.equals(mTokenToRecord, that.mTokenToRecord)
+ && mWaitingToRecord == that.mWaitingToRecord;
}
@Override
@@ -288,6 +318,7 @@ public final class ContentRecordingSession implements Parcelable {
_hash = 31 * _hash + mDisplayId;
_hash = 31 * _hash + mContentToRecord;
_hash = 31 * _hash + java.util.Objects.hashCode(mTokenToRecord);
+ _hash = 31 * _hash + Boolean.hashCode(mWaitingToRecord);
return _hash;
}
@@ -298,6 +329,7 @@ public final class ContentRecordingSession implements Parcelable {
// void parcelFieldName(Parcel dest, int flags) { ... }
byte flg = 0;
+ if (mWaitingToRecord) flg |= 0x8;
if (mTokenToRecord != null) flg |= 0x4;
dest.writeByte(flg);
dest.writeInt(mDisplayId);
@@ -317,6 +349,7 @@ public final class ContentRecordingSession implements Parcelable {
// static FieldType unparcelFieldName(Parcel in) { ... }
byte flg = in.readByte();
+ boolean waitingToRecord = (flg & 0x8) != 0;
int displayId = in.readInt();
int contentToRecord = in.readInt();
IBinder tokenToRecord = (flg & 0x4) == 0 ? null : (IBinder) in.readStrongBinder();
@@ -333,8 +366,7 @@ public final class ContentRecordingSession implements Parcelable {
}
this.mTokenToRecord = tokenToRecord;
- com.android.internal.util.AnnotationValidations.validate(
- VisibleForTesting.class, null, mTokenToRecord);
+ this.mWaitingToRecord = waitingToRecord;
// onConstructed(); // You can define this method to get a callback
}
@@ -362,7 +394,8 @@ public final class ContentRecordingSession implements Parcelable {
private int mDisplayId;
private @RecordContent int mContentToRecord;
- private @VisibleForTesting @Nullable IBinder mTokenToRecord;
+ private @Nullable IBinder mTokenToRecord;
+ private boolean mWaitingToRecord;
private long mBuilderFieldsSet = 0L;
@@ -400,17 +433,31 @@ public final class ContentRecordingSession implements Parcelable {
* represents the {@link android.window.WindowContainerToken} of the Task to record.
*/
@DataClass.Generated.Member
- public @NonNull Builder setTokenToRecord(@VisibleForTesting @NonNull IBinder value) {
+ public @NonNull Builder setTokenToRecord(@NonNull IBinder value) {
checkNotUsed();
mBuilderFieldsSet |= 0x4;
mTokenToRecord = value;
return this;
}
+ /**
+ * When {@code true}, no mirroring should take place until the user has re-granted access to
+ * the consent token. When {@code false}, recording can begin immediately.
+ *
+ * <p>Only set on the server side to sanitize any input from the client process.
+ */
+ @DataClass.Generated.Member
+ public @NonNull Builder setWaitingToRecord(boolean value) {
+ checkNotUsed();
+ mBuilderFieldsSet |= 0x8;
+ mWaitingToRecord = value;
+ return this;
+ }
+
/** Builds the instance. This builder should not be touched after calling this! */
public @NonNull ContentRecordingSession build() {
checkNotUsed();
- mBuilderFieldsSet |= 0x8; // Mark builder used
+ mBuilderFieldsSet |= 0x10; // Mark builder used
if ((mBuilderFieldsSet & 0x1) == 0) {
mDisplayId = INVALID_DISPLAY;
@@ -421,15 +468,19 @@ public final class ContentRecordingSession implements Parcelable {
if ((mBuilderFieldsSet & 0x4) == 0) {
mTokenToRecord = null;
}
+ if ((mBuilderFieldsSet & 0x8) == 0) {
+ mWaitingToRecord = false;
+ }
ContentRecordingSession o = new ContentRecordingSession(
mDisplayId,
mContentToRecord,
- mTokenToRecord);
+ mTokenToRecord,
+ mWaitingToRecord);
return o;
}
private void checkNotUsed() {
- if ((mBuilderFieldsSet & 0x8) != 0) {
+ if ((mBuilderFieldsSet & 0x10) != 0) {
throw new IllegalStateException(
"This Builder should not be reused. Use a new Builder instance instead");
}
@@ -437,10 +488,10 @@ public final class ContentRecordingSession implements Parcelable {
}
@DataClass.Generated(
- time = 1645803878639L,
+ time = 1678817765846L,
codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/view/ContentRecordingSession.java",
- inputSignatures = "public static final int RECORD_CONTENT_DISPLAY\npublic static final int RECORD_CONTENT_TASK\nprivate int mDisplayId\nprivate @android.view.ContentRecordingSession.RecordContent int mContentToRecord\nprivate @com.android.internal.annotations.VisibleForTesting @android.annotation.Nullable android.os.IBinder mTokenToRecord\npublic static android.view.ContentRecordingSession createDisplaySession(android.os.IBinder)\npublic static android.view.ContentRecordingSession createTaskSession(android.os.IBinder)\npublic static boolean isValid(android.view.ContentRecordingSession)\npublic static boolean isSameDisplay(android.view.ContentRecordingSession,android.view.ContentRecordingSession)\nclass ContentRecordingSession extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genConstructor=false, genToString=true, genSetters=true, genEqualsHashCode=true)")
+ inputSignatures = "public static final int RECORD_CONTENT_DISPLAY\npublic static final int RECORD_CONTENT_TASK\nprivate int mDisplayId\nprivate @android.view.ContentRecordingSession.RecordContent int mContentToRecord\nprivate @android.annotation.Nullable android.os.IBinder mTokenToRecord\nprivate boolean mWaitingToRecord\npublic static android.view.ContentRecordingSession createDisplaySession(android.os.IBinder)\npublic static android.view.ContentRecordingSession createTaskSession(android.os.IBinder)\npublic static boolean isValid(android.view.ContentRecordingSession)\npublic static boolean isProjectionOnSameDisplay(android.view.ContentRecordingSession,android.view.ContentRecordingSession)\nclass ContentRecordingSession extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genConstructor=false, genToString=true, genSetters=true, genEqualsHashCode=true)")
@Deprecated
private void __metadata() {}
diff --git a/core/java/com/android/internal/protolog/ProtoLogGroup.java b/core/java/com/android/internal/protolog/ProtoLogGroup.java
index ad1fdbae037d..ec525f09fa88 100644
--- a/core/java/com/android/internal/protolog/ProtoLogGroup.java
+++ b/core/java/com/android/internal/protolog/ProtoLogGroup.java
@@ -85,7 +85,7 @@ public enum ProtoLogGroup implements IProtoLogGroup {
Consts.TAG_WM),
WM_DEBUG_WINDOW_INSETS(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
Consts.TAG_WM),
- WM_DEBUG_CONTENT_RECORDING(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
+ WM_DEBUG_CONTENT_RECORDING(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, true,
Consts.TAG_WM),
WM_DEBUG_WALLPAPER(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false, Consts.TAG_WM),
WM_DEBUG_BACK_PREVIEW(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, true,
diff --git a/core/tests/coretests/src/android/view/ContentRecordingSessionTest.java b/core/tests/coretests/src/android/view/ContentRecordingSessionTest.java
index df96a7d4568a..b3fe5c8addfd 100644
--- a/core/tests/coretests/src/android/view/ContentRecordingSessionTest.java
+++ b/core/tests/coretests/src/android/view/ContentRecordingSessionTest.java
@@ -89,20 +89,22 @@ public class ContentRecordingSessionTest {
}
@Test
- public void testIsSameDisplay() {
- assertThat(ContentRecordingSession.isSameDisplay(null, null)).isFalse();
+ public void testIsProjectionOnSameDisplay() {
+ assertThat(ContentRecordingSession.isProjectionOnSameDisplay(null, null)).isFalse();
ContentRecordingSession session = ContentRecordingSession.createDisplaySession(
WINDOW_TOKEN);
session.setDisplayId(DEFAULT_DISPLAY);
- assertThat(ContentRecordingSession.isSameDisplay(session, null)).isFalse();
+ assertThat(ContentRecordingSession.isProjectionOnSameDisplay(session, null)).isFalse();
ContentRecordingSession incomingSession = ContentRecordingSession.createDisplaySession(
WINDOW_TOKEN);
incomingSession.setDisplayId(DEFAULT_DISPLAY);
- assertThat(ContentRecordingSession.isSameDisplay(session, incomingSession)).isTrue();
+ assertThat(ContentRecordingSession.isProjectionOnSameDisplay(session,
+ incomingSession)).isTrue();
incomingSession.setDisplayId(DEFAULT_DISPLAY + 1);
- assertThat(ContentRecordingSession.isSameDisplay(session, incomingSession)).isFalse();
+ assertThat(ContentRecordingSession.isProjectionOnSameDisplay(session,
+ incomingSession)).isFalse();
}
@Test
diff --git a/data/etc/services.core.protolog.json b/data/etc/services.core.protolog.json
index 5549f88b65e0..a73010ba0e41 100644
--- a/data/etc/services.core.protolog.json
+++ b/data/etc/services.core.protolog.json
@@ -7,24 +7,12 @@
"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",
@@ -67,12 +55,24 @@
"group": "WM_DEBUG_WINDOW_TRANSITIONS",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
+ "-2074882083": {
+ "message": "Content Recording: Unable to retrieve task to start recording for display %d",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"-2072089308": {
"message": "Attempted to add window with token that is a sub-window: %s. Aborting.",
"level": "WARN",
"group": "WM_ERROR",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
+ "-2072029833": {
+ "message": "Content Recording: 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"
+ },
"-2054442123": {
"message": "Setting Intent of %s to %s",
"level": "VERBOSE",
@@ -175,12 +175,6 @@
"group": "WM_ERROR",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
- "-1944652783": {
- "message": "Unable to tell MediaProjectionManagerService to stop the active projection: %s",
- "level": "ERROR",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"-1941440781": {
"message": "Creating Pending Move-to-back: %s",
"level": "VERBOSE",
@@ -253,12 +247,24 @@
"group": "WM_DEBUG_STATES",
"at": "com\/android\/server\/wm\/TaskFragment.java"
},
+ "-1885450608": {
+ "message": "Content Recording: 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"
+ },
"-1884933373": {
"message": "enableScreenAfterBoot: mDisplayEnabled=%b mForceDisplayEnabled=%b mShowingBootMessages=%b mSystemBooted=%b. %s",
"level": "INFO",
"group": "WM_DEBUG_BOOT",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
+ "-1883484959": {
+ "message": "Content Recording: Display %d state is now (%d), so update recording?",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/DisplayContent.java"
+ },
"-1872288685": {
"message": "applyAnimation: anim=%s nextAppTransition=%s transit=%s isEntrance=%b Callers=%s",
"level": "VERBOSE",
@@ -355,12 +361,6 @@
"group": "WM_DEBUG_STARTING_WINDOW",
"at": "com\/android\/server\/wm\/ActivityRecord.java"
},
- "-1781861035": {
- "message": "Display %d has content (%b) so pause recording",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"-1777196134": {
"message": "goodToGo(): No apps to animate, mPendingAnimations=%d",
"level": "DEBUG",
@@ -505,12 +505,6 @@
"group": "WM_DEBUG_LOCKTASK",
"at": "com\/android\/server\/wm\/LockTaskController.java"
},
- "-1605829532": {
- "message": "Unable to start recording due to null token for display %d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"-1598452494": {
"message": "activityDestroyedLocked: r=%s",
"level": "DEBUG",
@@ -571,6 +565,12 @@
"group": "WM_DEBUG_IME",
"at": "com\/android\/server\/wm\/ImeInsetsSourceProvider.java"
},
+ "-1549923951": {
+ "message": "Content Recording: Unable to retrieve window container to start recording for display %d",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"-1545962566": {
"message": "View server did not start",
"level": "WARN",
@@ -649,6 +649,12 @@
"group": "WM_DEBUG_ORIENTATION",
"at": "com\/android\/server\/wm\/DisplayContent.java"
},
+ "-1480264178": {
+ "message": "Content Recording: Unable to update recording for display %d to new bounds %s and\/or orientation %d, since the surface is not available.",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"-1478175541": {
"message": "No longer animating wallpaper targets!",
"level": "VERBOSE",
@@ -721,12 +727,6 @@
"group": "WM_DEBUG_ADD_REMOVE",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
- "-1423223548": {
- "message": "Unable to tell MediaProjectionManagerService about resizing the active projection: %s",
- "level": "ERROR",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"-1421296808": {
"message": "Moving to RESUMED: %s (in existing)",
"level": "VERBOSE",
@@ -787,12 +787,6 @@
"group": "WM_DEBUG_TASKS",
"at": "com\/android\/server\/wm\/RootWindowContainer.java"
},
- "-1373875178": {
- "message": "Going ahead with updating recording for display %d to new bounds %s and\/or orientation %d.",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"-1364754753": {
"message": "Task vanished taskId=%d",
"level": "VERBOSE",
@@ -817,12 +811,6 @@
"group": "WM_DEBUG_STARTING_WINDOW",
"at": "com\/android\/server\/wm\/ActivityRecord.java"
},
- "-1326876381": {
- "message": "Provided surface for recording on display %d is not present, so do not update the surface",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"-1323783276": {
"message": "performEnableScreen: bootFinished() failed.",
"level": "WARN",
@@ -943,6 +931,12 @@
"group": "WM_DEBUG_RECENTS_ANIMATIONS",
"at": "com\/android\/server\/wm\/RecentsAnimationController.java"
},
+ "-1217596375": {
+ "message": "Content Recording: Display %d has no content and is on, so start recording for state %d",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"-1209252064": {
"message": "Clear animatingExit: reason=clearAnimatingFlags win=%s",
"level": "DEBUG",
@@ -991,6 +985,12 @@
"group": "WM_DEBUG_STATES",
"at": "com\/android\/server\/wm\/Task.java"
},
+ "-1156314529": {
+ "message": "Content Recording: Unexpectedly null window container; unable to update recording for display %d",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"-1156118957": {
"message": "Updated config=%s",
"level": "DEBUG",
@@ -1015,6 +1015,12 @@
"group": "WM_DEBUG_FOCUS",
"at": "com\/android\/server\/wm\/DisplayContent.java"
},
+ "-1136734598": {
+ "message": "Content Recording: Ignoring session on same display %d, with an existing session %s",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecordingController.java"
+ },
"-1136467585": {
"message": "The listener does not exist.",
"level": "INFO",
@@ -1087,6 +1093,12 @@
"group": "WM_DEBUG_STATES",
"at": "com\/android\/server\/wm\/TaskFragment.java"
},
+ "-1097851684": {
+ "message": "Content Recording: Unable to start recording due to null token for display %d",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"-1089874824": {
"message": "SURFACE SHOW (performLayout): %s",
"level": "INFO",
@@ -1147,12 +1159,6 @@
"group": "WM_DEBUG_TASKS",
"at": "com\/android\/server\/wm\/RootWindowContainer.java"
},
- "-1018968224": {
- "message": "Recorded task is removed, so stop recording on display %d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"-1016578046": {
"message": "Moving to %s Relaunching %s callers=%s",
"level": "INFO",
@@ -1297,6 +1303,12 @@
"group": "WM_DEBUG_BOOT",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
+ "-869242375": {
+ "message": "Content Recording: Unable to start recording due to invalid region for display %d",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"-863438038": {
"message": "Aborting Transition: %d",
"level": "VERBOSE",
@@ -1351,12 +1363,6 @@
"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",
@@ -1429,6 +1435,12 @@
"group": "WM_DEBUG_FOCUS_LIGHT",
"at": "com\/android\/server\/wm\/ActivityRecord.java"
},
+ "-767091913": {
+ "message": "Content Recording: Handle incoming session on display %d, with a pre-existing session %s",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecordingController.java"
+ },
"-766059044": {
"message": "Display id=%d selected orientation %s (%d), got rotation %s (%d)",
"level": "VERBOSE",
@@ -1453,12 +1465,6 @@
"group": "WM_DEBUG_SCREEN_ON",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
- "-751255162": {
- "message": "Unable to update recording for display %d to new bounds %s and\/or orientation %d, since the surface is not available.",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"-743856570": {
"message": "shouldWaitAnimatingExit: isAnimating: %s",
"level": "DEBUG",
@@ -1471,18 +1477,6 @@
"group": "WM_DEBUG_CONFIGURATION",
"at": "com\/android\/server\/wm\/ActivityRecord.java"
},
- "-732715767": {
- "message": "Unable to retrieve window container to start recording for display %d",
- "level": "VERBOSE",
- "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",
@@ -1717,6 +1711,12 @@
"group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
"at": "com\/android\/server\/wm\/AppTransition.java"
},
+ "-517666355": {
+ "message": "Content Recording: Display %d has content (%b) so pause recording",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"-509601642": {
"message": " checking %s",
"level": "VERBOSE",
@@ -1771,6 +1771,12 @@
"group": "WM_DEBUG_ADD_REMOVE",
"at": "com\/android\/server\/wm\/Task.java"
},
+ "-452750194": {
+ "message": "Content Recording: Going ahead with updating recording for display %d to new bounds %s and\/or orientation %d.",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"-451552570": {
"message": "Current focused window being animated by recents. Overriding back callback to recents controller callback.",
"level": "DEBUG",
@@ -1855,12 +1861,6 @@
"group": "WM_DEBUG_KEEP_SCREEN_ON",
"at": "com\/android\/server\/wm\/DisplayContent.java"
},
- "-381522987": {
- "message": "Display %d state is now (%d), so update recording?",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
"-381475323": {
"message": "DisplayContent: boot is waiting for window of type %d to be drawn",
"level": "DEBUG",
@@ -1969,12 +1969,6 @@
"group": "WM_DEBUG_RECENTS_ANIMATIONS",
"at": "com\/android\/server\/wm\/RecentsAnimation.java"
},
- "-302468137": {
- "message": "Display %d was already recording, so apply transformations if necessary",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"-292790591": {
"message": "Attempted to set IME policy to a display that does not exist: %d",
"level": "WARN",
@@ -1993,12 +1987,6 @@
"group": "WM_DEBUG_STATES",
"at": "com\/android\/server\/wm\/ActivityRecord.java"
},
- "-254406860": {
- "message": "Unable to tell MediaProjectionManagerService about visibility change on the active projection: %s",
- "level": "ERROR",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"-251259736": {
"message": "No longer freezing: %s",
"level": "VERBOSE",
@@ -2017,12 +2005,6 @@
"group": "WM_DEBUG_APP_TRANSITIONS",
"at": "com\/android\/server\/wm\/AppTransitionController.java"
},
- "-237664290": {
- "message": "Pause the recording session on display %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecordingController.java"
- },
"-235225312": {
"message": "Skipping config check for initializing activity: %s",
"level": "VERBOSE",
@@ -2077,6 +2059,12 @@
"group": "WM_DEBUG_WALLPAPER",
"at": "com\/android\/server\/wm\/DisplayContent.java"
},
+ "-180594244": {
+ "message": "Content Recording: Unable to tell MediaProjectionManagerService about visibility change on the active projection: %s",
+ "level": "ERROR",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"-177040661": {
"message": "Start rotation animation. customAnim=%s, mCurRotation=%s, mOriginalRotation=%s",
"level": "DEBUG",
@@ -2113,12 +2101,6 @@
"group": "WM_DEBUG_STATES",
"at": "com\/android\/server\/wm\/Task.java"
},
- "-142844021": {
- "message": "Unable to start recording for display %d since the surface is not available.",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"-134091882": {
"message": "Screenshotting Activity %s",
"level": "VERBOSE",
@@ -2161,6 +2143,12 @@
"group": "WM_DEBUG_CONFIGURATION",
"at": "com\/android\/server\/wm\/ActivityRecord.java"
},
+ "-88873335": {
+ "message": "Content Recording: Unable to tell MediaProjectionManagerService to stop the active projection: %s",
+ "level": "ERROR",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"-87705714": {
"message": "findFocusedWindow: focusedApp=null using new focus @ %s",
"level": "VERBOSE",
@@ -2347,12 +2335,6 @@
"group": "WM_DEBUG_FOCUS",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
- "96494268": {
- "message": "Stop MediaProjection on virtual display %d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"100936473": {
"message": "Wallpaper animation!",
"level": "VERBOSE",
@@ -2551,12 +2533,6 @@
"group": "WM_DEBUG_WINDOW_TRANSITIONS",
"at": "com\/android\/server\/wm\/TransitionController.java"
},
- "264036181": {
- "message": "Unable to retrieve task to start recording for display %d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"269576220": {
"message": "Resuming rotation after drag",
"level": "DEBUG",
@@ -2665,6 +2641,12 @@
"group": "WM_DEBUG_STATES",
"at": "com\/android\/server\/wm\/TaskFragment.java"
},
+ "339482207": {
+ "message": "Content Recording: Display %d was already recording, so apply transformations if necessary",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"341055768": {
"message": "resumeTopActivity: Skip resume: need to start pausing",
"level": "VERBOSE",
@@ -2959,8 +2941,8 @@
"group": "WM_SHOW_TRANSACTIONS",
"at": "com\/android\/server\/wm\/Session.java"
},
- "609880497": {
- "message": "Display %d has no content and is on, so start recording for state %d",
+ "612856628": {
+ "message": "Content Recording: Stop MediaProjection on virtual display %d",
"level": "VERBOSE",
"group": "WM_DEBUG_CONTENT_RECORDING",
"at": "com\/android\/server\/wm\/ContentRecorder.java"
@@ -3139,12 +3121,6 @@
"group": "WM_DEBUG_ANIM",
"at": "com\/android\/server\/wm\/WindowContainer.java"
},
- "778774915": {
- "message": "Unable to record task since feature is disabled %d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"781471998": {
"message": "moveWindowTokenToDisplay: Cannot move to the original display for token: %s",
"level": "WARN",
@@ -3181,6 +3157,12 @@
"group": "WM_DEBUG_SYNC_ENGINE",
"at": "com\/android\/server\/wm\/BLASTSyncEngine.java"
},
+ "801521566": {
+ "message": "Content Recording: 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"
+ },
"806891543": {
"message": "Setting mOrientationChangeComplete=true because wtoken %s numInteresting=%d numDrawn=%d",
"level": "INFO",
@@ -3271,6 +3253,12 @@
"group": "WM_DEBUG_STATES",
"at": "com\/android\/server\/wm\/TaskFragment.java"
},
+ "937080808": {
+ "message": "Content Recording: Recorded task is removed, so stop recording on display %d",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"939638078": {
"message": "config_deviceTabletopRotations is not defined. Half-fold letterboxing will work inconsistently.",
"level": "WARN",
@@ -3517,6 +3505,12 @@
"group": "WM_DEBUG_SCREEN_ON",
"at": "com\/android\/server\/wm\/DisplayPolicy.java"
},
+ "1145016093": {
+ "message": "Content Recording: Attempting to mirror self on %d",
+ "level": "WARN",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/DisplayContent.java"
+ },
"1149424314": {
"message": "Unregister display organizer=%s uid=%d",
"level": "VERBOSE",
@@ -3745,12 +3739,6 @@
"group": "WM_DEBUG_WINDOW_ORGANIZER",
"at": "com\/android\/server\/wm\/TaskOrganizerController.java"
},
- "1401287081": {
- "message": "Handle incoming session on display %d, with a pre-existing session %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecordingController.java"
- },
"1401295262": {
"message": "Mode default, asking user",
"level": "WARN",
@@ -3787,12 +3775,6 @@
"group": "WM_ERROR",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
- "1444064727": {
- "message": "Unexpectedly null window container; unable to update recording for display %d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"1448683958": {
"message": "Override pending remote transitionSet=%b adapter=%s",
"level": "INFO",
@@ -3877,6 +3859,12 @@
"group": "WM_DEBUG_APP_TRANSITIONS",
"at": "com\/android\/server\/wm\/ActivityRecord.java"
},
+ "1546187372": {
+ "message": "Content Recording: Pause the recording session on display %s",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecordingController.java"
+ },
"1557732761": {
"message": "For Intent %s bringing to top: %s",
"level": "DEBUG",
@@ -3889,6 +3877,12 @@
"group": "WM_ERROR",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
+ "1563836923": {
+ "message": "Content Recording: Unable to record task since feature is disabled %d",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"1577579529": {
"message": "win=%s destroySurfaces: appStopped=%b win.mWindowRemovalAllowed=%b win.mRemoveOnExit=%b",
"level": "ERROR",
@@ -3907,12 +3901,6 @@
"group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
"at": "com\/android\/server\/wm\/AppTransition.java"
},
- "1608402305": {
- "message": "Unable to start recording due to invalid region for display %d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_CONTENT_RECORDING",
- "at": "com\/android\/server\/wm\/ContentRecorder.java"
- },
"1610646518": {
"message": "Enqueueing pending finish: %s",
"level": "VERBOSE",
@@ -3973,6 +3961,12 @@
"group": "WM_DEBUG_IME",
"at": "com\/android\/server\/wm\/InsetsStateController.java"
},
+ "1661414284": {
+ "message": "Content Recording: Unable to tell MediaProjectionManagerService about resizing the active projection: %s",
+ "level": "ERROR",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"1667162379": {
"message": "Creating Pending Transition: %s",
"level": "VERBOSE",
@@ -4021,6 +4015,12 @@
"group": "WM_DEBUG_WINDOW_ORGANIZER",
"at": "com\/android\/server\/wm\/DisplayAreaOrganizerController.java"
},
+ "1712935427": {
+ "message": "Content Recording: Unable to start recording for display %d since the surface is not available.",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"1720229827": {
"message": "Creating animation bounds layer",
"level": "INFO",
@@ -4051,6 +4051,12 @@
"group": "WM_DEBUG_ORIENTATION",
"at": "com\/android\/server\/wm\/ActivityRecord.java"
},
+ "1750878635": {
+ "message": "Content Recording: Provided surface for recording on display %d is not present, so do not update the surface",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_CONTENT_RECORDING",
+ "at": "com\/android\/server\/wm\/ContentRecorder.java"
+ },
"1756082882": {
"message": "Orientation change skips hidden %s",
"level": "VERBOSE",
diff --git a/services/core/java/com/android/server/wm/ContentRecorder.java b/services/core/java/com/android/server/wm/ContentRecorder.java
index 9e258cbc2ec6..d358eb5d38db 100644
--- a/services/core/java/com/android/server/wm/ContentRecorder.java
+++ b/services/core/java/com/android/server/wm/ContentRecorder.java
@@ -143,14 +143,15 @@ final class ContentRecorder implements WindowContainerListener {
// Recording has already begun, but update recording since the display is now on.
if (mRecordedWindowContainer == null) {
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Unexpectedly null window container; unable to update recording for "
- + "display %d",
+ "Content Recording: Unexpectedly null window container; unable to update "
+ + "recording for display %d",
mDisplayContent.getDisplayId());
return;
}
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Display %d was already recording, so apply transformations if necessary",
+ "Content Recording: Display %d was already recording, so apply "
+ + "transformations if necessary",
mDisplayContent.getDisplayId());
// Retrieve the size of the region to record, and continue with the update
// if the bounds or orientation has changed.
@@ -161,8 +162,8 @@ final class ContentRecorder implements WindowContainerListener {
Point surfaceSize = fetchSurfaceSizeIfPresent();
if (surfaceSize != null) {
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Going ahead with updating recording for display %d to new "
- + "bounds %s and/or orientation %d.",
+ "Content Recording: Going ahead with updating recording for display "
+ + "%d to new bounds %s and/or orientation %d.",
mDisplayContent.getDisplayId(), recordedContentBounds,
recordedContentOrientation);
updateMirroredSurface(mDisplayContent.mWmService.mTransactionFactory.get(),
@@ -171,8 +172,9 @@ final class ContentRecorder implements WindowContainerListener {
// If the surface removed, do nothing. We will handle this via onDisplayChanged
// (the display will be off if the surface is removed).
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Unable to update recording for display %d to new bounds %s"
- + " and/or orientation %d, since the surface is not available.",
+ "Content Recording: Unable to update recording for display %d to new "
+ + "bounds %s and/or orientation %d, since the surface is not "
+ + "available.",
mDisplayContent.getDisplayId(), recordedContentBounds,
recordedContentOrientation);
}
@@ -189,8 +191,8 @@ final class ContentRecorder implements WindowContainerListener {
return;
}
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Display %d has content (%b) so pause recording", mDisplayContent.getDisplayId(),
- mDisplayContent.getLastHasContent());
+ "Content Recording: Display %d has content (%b) so pause recording",
+ mDisplayContent.getDisplayId(), mDisplayContent.getLastHasContent());
// If the display is not on and it is a virtual display, then it no longer has an
// associated surface to write output to.
// If the display now has content, stop mirroring to it.
@@ -231,7 +233,8 @@ final class ContentRecorder implements WindowContainerListener {
*/
private void stopMediaProjection() {
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Stop MediaProjection on virtual display %d", mDisplayContent.getDisplayId());
+ "Content Recording: Stop MediaProjection on virtual display %d",
+ mDisplayContent.getDisplayId());
if (mMediaProjectionManager != null) {
mMediaProjectionManager.stopActiveProjection();
}
@@ -283,13 +286,14 @@ final class ContentRecorder implements WindowContainerListener {
final Point surfaceSize = fetchSurfaceSizeIfPresent();
if (surfaceSize == null) {
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Unable to start recording for display %d since the surface is not "
- + "available.",
+ "Content Recording: Unable to start recording for display %d since the "
+ + "surface is not available.",
mDisplayContent.getDisplayId());
return;
}
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Display %d has no content and is on, so start recording for state %d",
+ "Content Recording: Display %d has no content and is on, so start recording for "
+ + "state %d",
mDisplayContent.getDisplayId(), mDisplayContent.getDisplay().getState());
// Create a mirrored hierarchy for the SurfaceControl of the DisplayArea to capture.
@@ -349,7 +353,7 @@ final class ContentRecorder implements WindowContainerListener {
if (tokenToRecord == null) {
handleStartRecordingFailed();
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Unable to start recording due to null token for display %d",
+ "Content Recording: Unable to start recording due to null token for display %d",
mDisplayContent.getDisplayId());
return null;
}
@@ -359,13 +363,14 @@ final class ContentRecorder implements WindowContainerListener {
mDisplayContent.mWmService.mWindowContextListenerController.getContainer(
tokenToRecord);
if (wc == null) {
- // Fall back to screenrecording using the data sent to DisplayManager
+ // Fall back to mirroring using the data sent to DisplayManager
mDisplayContent.mWmService.mDisplayManagerInternal.setWindowManagerMirroring(
mDisplayContent.getDisplayId(), false);
handleStartRecordingFailed();
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Unable to retrieve window container to start recording for "
- + "display %d", mDisplayContent.getDisplayId());
+ "Content Recording: Unable to retrieve window container to start "
+ + "recording for display %d",
+ mDisplayContent.getDisplayId());
return null;
}
// TODO(206461622) Migrate to using the RootDisplayArea
@@ -375,7 +380,7 @@ final class ContentRecorder implements WindowContainerListener {
KEY_RECORD_TASK_FEATURE, false)) {
handleStartRecordingFailed();
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Unable to record task since feature is disabled %d",
+ "Content Recording: Unable to record task since feature is disabled %d",
mDisplayContent.getDisplayId());
return null;
}
@@ -383,8 +388,9 @@ final class ContentRecorder implements WindowContainerListener {
if (taskToRecord == null) {
handleStartRecordingFailed();
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Unable to retrieve task to start recording for "
- + "display %d", mDisplayContent.getDisplayId());
+ "Content Recording: Unable to retrieve task to start recording for "
+ + "display %d",
+ mDisplayContent.getDisplayId());
} else {
taskToRecord.registerWindowContainerListener(this);
}
@@ -394,7 +400,8 @@ final class ContentRecorder implements WindowContainerListener {
// capture for the entire display.
handleStartRecordingFailed();
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Unable to start recording due to invalid region for display %d",
+ "Content Recording: Unable to start recording due to invalid region for "
+ + "display %d",
mDisplayContent.getDisplayId());
return null;
}
@@ -488,8 +495,8 @@ final class ContentRecorder implements WindowContainerListener {
// State of virtual display will change to 'ON' when the surface is set.
// will get event DISPLAY_DEVICE_EVENT_CHANGED
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Provided surface for recording on display %d is not present, so do not"
- + " update the surface",
+ "Content Recording: Provided surface for recording on display %d is not "
+ + "present, so do not update the surface",
mDisplayContent.getDisplayId());
return null;
}
@@ -500,7 +507,7 @@ final class ContentRecorder implements WindowContainerListener {
@Override
public void onRemoved() {
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Recorded task is removed, so stop recording on display %d",
+ "Content Recording: Recorded task is removed, so stop recording on display %d",
mDisplayContent.getDisplayId());
unregisterListener();
@@ -551,8 +558,8 @@ final class ContentRecorder implements WindowContainerListener {
mIMediaProjectionManager.stopActiveProjection();
} catch (RemoteException e) {
ProtoLog.e(WM_DEBUG_CONTENT_RECORDING,
- "Unable to tell MediaProjectionManagerService to stop the active "
- + "projection: %s",
+ "Content Recording: Unable to tell MediaProjectionManagerService to stop "
+ + "the active projection: %s",
e);
}
}
@@ -568,8 +575,8 @@ final class ContentRecorder implements WindowContainerListener {
height);
} catch (RemoteException e) {
ProtoLog.e(WM_DEBUG_CONTENT_RECORDING,
- "Unable to tell MediaProjectionManagerService about resizing the active "
- + "projection: %s",
+ "Content Recording: Unable to tell MediaProjectionManagerService about "
+ + "resizing the active projection: %s",
e);
}
}
@@ -585,8 +592,8 @@ final class ContentRecorder implements WindowContainerListener {
isVisible);
} catch (RemoteException e) {
ProtoLog.e(WM_DEBUG_CONTENT_RECORDING,
- "Unable to tell MediaProjectionManagerService about visibility change on "
- + "the active projection: %s",
+ "Content Recording: Unable to tell MediaProjectionManagerService about "
+ + "visibility change on the active projection: %s",
e);
}
}
diff --git a/services/core/java/com/android/server/wm/ContentRecordingController.java b/services/core/java/com/android/server/wm/ContentRecordingController.java
index 1efc202a49ae..d60addc42831 100644
--- a/services/core/java/com/android/server/wm/ContentRecordingController.java
+++ b/services/core/java/com/android/server/wm/ContentRecordingController.java
@@ -53,35 +53,59 @@ final class ContentRecordingController {
}
/**
- * Updates the current recording session. If a new display is taking over recording, then
- * stops the prior display from recording.
+ * Updates the current recording session.
+ * <p>Handles the following scenarios:
+ * <ul>
+ * <li>Invalid scenarios: The incoming session is malformed, or the incoming session is
+ * identical to the current session</li>
+ * <li>Start Scenario: Starting a new session. Recording begins immediately.</li>
+ * <li>Takeover Scenario: Occurs during a Start Scenario, if a pre-existing session was
+ * in-progress. For example, recording on VirtualDisplay "app_foo" was ongoing. A
+ * session for VirtualDisplay "app_bar" arrives. The controller stops the session on
+ * VirtualDisplay "app_foo" and allows the session for VirtualDisplay "app_bar" to
+ * begin.</li>
+ * <li>Stopping scenario: The incoming session is null and there is currently an ongoing
+ * session. The controller stops recording.</li>
+ * </ul>
*
- * @param incomingSession the new recording session. Should either have a {@code null} token, to
- * stop the current session, or a session on a new/different display
- * than the current session.
- * @param wmService the window manager service
+ * @param incomingSession The incoming recording session (either an update to a current session
+ * or a new session), or null to stop the current session.
+ * @param wmService The window manager service.
*/
void setContentRecordingSessionLocked(@Nullable ContentRecordingSession incomingSession,
@NonNull WindowManagerService wmService) {
- if (incomingSession != null && (!ContentRecordingSession.isValid(incomingSession)
- || ContentRecordingSession.isSameDisplay(mSession, incomingSession))) {
- // Ignore an invalid session, or a session for the same display as currently recording.
+ // Invalid scenario: ignore invalid incoming session.
+ if (incomingSession != null && !ContentRecordingSession.isValid(incomingSession)) {
+ return;
+ }
+ // Invalid scenario: ignore identical incoming session.
+ if (ContentRecordingSession.isProjectionOnSameDisplay(mSession, incomingSession)) {
+ // TODO(242833866) if incoming session is no longer waiting to record, allow
+ // the update through.
+
+ ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
+ "Content Recording: Ignoring session on same display %d, with an existing "
+ + "session %s",
+ incomingSession.getDisplayId(), mSession.getDisplayId());
return;
}
DisplayContent incomingDisplayContent = null;
+ // Start scenario: recording begins immediately.
if (incomingSession != null) {
- // Recording will start on a new display, possibly taking over from a current session.
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Handle incoming session on display %d, with a pre-existing session %s",
- incomingSession.getDisplayId(),
+ "Content Recording: Handle incoming session on display %d, with a "
+ + "pre-existing session %s", incomingSession.getDisplayId(),
mSession == null ? null : mSession.getDisplayId());
incomingDisplayContent = wmService.mRoot.getDisplayContentOrCreate(
incomingSession.getDisplayId());
incomingDisplayContent.setContentRecordingSession(incomingSession);
+ // TODO(b/270118861) When user grants consent to re-use, explicitly ask ContentRecorder
+ // to update, since no config/display change arrives. Mark recording as black.
}
+ // Takeover and stopping scenario: stop recording on the pre-existing session.
if (mSession != null) {
- // Update the pre-existing display about the new session.
- ProtoLog.v(WM_DEBUG_CONTENT_RECORDING, "Pause the recording session on display %s",
+ ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
+ "Content Recording: Pause the recording session on display %s",
mDisplayContent.getDisplayId());
mDisplayContent.pauseRecording();
mDisplayContent.setContentRecordingSession(null);
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 1344788d0314..ef01cc8cd61a 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -5936,7 +5936,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
mOffTokenAcquirer.release(mDisplayId);
}
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Display %d state is now (%d), so update recording?",
+ "Content Recording: Display %d state is now (%d), so update recording?",
mDisplayId, displayState);
if (lastDisplayState != displayState) {
// If state is on due to surface being added, then start recording.
@@ -6561,7 +6561,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
if (mirrorDisplayId == mDisplayId) {
if (mDisplayId != DEFAULT_DISPLAY) {
ProtoLog.w(WM_DEBUG_CONTENT_RECORDING,
- "Attempting to mirror self on %d", mirrorDisplayId);
+ "Content Recording: Attempting to mirror self on %d", mirrorDisplayId);
}
return false;
}
@@ -6571,16 +6571,18 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
// to mirror the DEFAULT_DISPLAY so instead we just return
DisplayContent mirrorDc = mRootWindowContainer.getDisplayContentOrCreate(mirrorDisplayId);
if (mirrorDc == null && mDisplayId == DEFAULT_DISPLAY) {
- ProtoLog.w(WM_DEBUG_CONTENT_RECORDING, "Found no matching mirror display for id=%d for"
- + " DEFAULT_DISPLAY. Nothing to mirror.", mirrorDisplayId);
+ ProtoLog.w(WM_DEBUG_CONTENT_RECORDING,
+ "Content Recording: Found no matching mirror display for id=%d for "
+ + "DEFAULT_DISPLAY. Nothing to mirror.",
+ mirrorDisplayId);
return false;
}
if (mirrorDc == null) {
mirrorDc = mRootWindowContainer.getDefaultDisplay();
ProtoLog.w(WM_DEBUG_CONTENT_RECORDING,
- "Attempting to mirror %d from %d but no DisplayContent associated. Changing "
- + "to mirror default display.",
+ "Content Recording: Attempting to mirror %d from %d but no DisplayContent "
+ + "associated. Changing to mirror default display.",
mirrorDisplayId, mDisplayId);
}
@@ -6589,8 +6591,8 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
.setDisplayId(mDisplayId);
setContentRecordingSession(session);
ProtoLog.v(WM_DEBUG_CONTENT_RECORDING,
- "Successfully created a ContentRecordingSession for displayId=%d to mirror "
- + "content from displayId=%d",
+ "Content Recording: Successfully created a ContentRecordingSession for "
+ + "displayId=%d to mirror content from displayId=%d",
mDisplayId, mirrorDisplayId);
return true;
}