Loading core/java/android/view/ContentRecordingSession.java +20 −20 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ public final class ContentRecordingSession implements Parcelable { * * <p>Only set on the server side to sanitize any input from the client process. */ private boolean mWaitingToRecord = false; private boolean mWaitingForConsent = false; /** * Default instance, with recording the display. Loading Loading @@ -181,7 +181,7 @@ public final class ContentRecordingSession implements Parcelable { @RecordContent int contentToRecord, int displayToRecord, @Nullable IBinder tokenToRecord, boolean waitingToRecord) { boolean waitingForConsent) { this.mVirtualDisplayId = virtualDisplayId; this.mContentToRecord = contentToRecord; Loading @@ -195,7 +195,7 @@ public final class ContentRecordingSession implements Parcelable { this.mDisplayToRecord = displayToRecord; this.mTokenToRecord = tokenToRecord; this.mWaitingToRecord = waitingToRecord; this.mWaitingForConsent = waitingForConsent; // onConstructed(); // You can define this method to get a callback } Loading Loading @@ -246,8 +246,8 @@ public final class ContentRecordingSession implements Parcelable { * <p>Only set on the server side to sanitize any input from the client process. */ @DataClass.Generated.Member public boolean isWaitingToRecord() { return mWaitingToRecord; public boolean isWaitingForConsent() { return mWaitingForConsent; } /** Loading Loading @@ -309,8 +309,8 @@ public final class ContentRecordingSession implements Parcelable { * <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; public @NonNull ContentRecordingSession setWaitingForConsent( boolean value) { mWaitingForConsent = value; return this; } Loading @@ -325,7 +325,7 @@ public final class ContentRecordingSession implements Parcelable { "contentToRecord = " + recordContentToString(mContentToRecord) + ", " + "displayToRecord = " + mDisplayToRecord + ", " + "tokenToRecord = " + mTokenToRecord + ", " + "waitingToRecord = " + mWaitingToRecord + "waitingForConsent = " + mWaitingForConsent + " }"; } Loading @@ -346,7 +346,7 @@ public final class ContentRecordingSession implements Parcelable { && mContentToRecord == that.mContentToRecord && mDisplayToRecord == that.mDisplayToRecord && java.util.Objects.equals(mTokenToRecord, that.mTokenToRecord) && mWaitingToRecord == that.mWaitingToRecord; && mWaitingForConsent == that.mWaitingForConsent; } @Override Loading @@ -360,7 +360,7 @@ public final class ContentRecordingSession implements Parcelable { _hash = 31 * _hash + mContentToRecord; _hash = 31 * _hash + mDisplayToRecord; _hash = 31 * _hash + java.util.Objects.hashCode(mTokenToRecord); _hash = 31 * _hash + Boolean.hashCode(mWaitingToRecord); _hash = 31 * _hash + Boolean.hashCode(mWaitingForConsent); return _hash; } Loading @@ -371,7 +371,7 @@ public final class ContentRecordingSession implements Parcelable { // void parcelFieldName(Parcel dest, int flags) { ... } byte flg = 0; if (mWaitingToRecord) flg |= 0x10; if (mWaitingForConsent) flg |= 0x10; if (mTokenToRecord != null) flg |= 0x8; dest.writeByte(flg); dest.writeInt(mVirtualDisplayId); Loading @@ -392,7 +392,7 @@ public final class ContentRecordingSession implements Parcelable { // static FieldType unparcelFieldName(Parcel in) { ... } byte flg = in.readByte(); boolean waitingToRecord = (flg & 0x10) != 0; boolean waitingForConsent = (flg & 0x10) != 0; int virtualDisplayId = in.readInt(); int contentToRecord = in.readInt(); int displayToRecord = in.readInt(); Loading @@ -411,7 +411,7 @@ public final class ContentRecordingSession implements Parcelable { this.mDisplayToRecord = displayToRecord; this.mTokenToRecord = tokenToRecord; this.mWaitingToRecord = waitingToRecord; this.mWaitingForConsent = waitingForConsent; // onConstructed(); // You can define this method to get a callback } Loading Loading @@ -441,7 +441,7 @@ public final class ContentRecordingSession implements Parcelable { private @RecordContent int mContentToRecord; private int mDisplayToRecord; private @Nullable IBinder mTokenToRecord; private boolean mWaitingToRecord; private boolean mWaitingForConsent; private long mBuilderFieldsSet = 0L; Loading Loading @@ -506,10 +506,10 @@ public final class ContentRecordingSession implements Parcelable { * <p>Only set on the server side to sanitize any input from the client process. */ @DataClass.Generated.Member public @NonNull Builder setWaitingToRecord(boolean value) { public @NonNull Builder setWaitingForConsent(boolean value) { checkNotUsed(); mBuilderFieldsSet |= 0x10; mWaitingToRecord = value; mWaitingForConsent = value; return this; } Loading @@ -531,14 +531,14 @@ public final class ContentRecordingSession implements Parcelable { mTokenToRecord = null; } if ((mBuilderFieldsSet & 0x10) == 0) { mWaitingToRecord = false; mWaitingForConsent = false; } ContentRecordingSession o = new ContentRecordingSession( mVirtualDisplayId, mContentToRecord, mDisplayToRecord, mTokenToRecord, mWaitingToRecord); mWaitingForConsent); return o; } Loading @@ -551,10 +551,10 @@ public final class ContentRecordingSession implements Parcelable { } @DataClass.Generated( time = 1679855157534L, time = 1683628463074L, 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 mVirtualDisplayId\nprivate @android.view.ContentRecordingSession.RecordContent int mContentToRecord\nprivate int mDisplayToRecord\nprivate @android.annotation.Nullable android.os.IBinder mTokenToRecord\nprivate boolean mWaitingToRecord\npublic static android.view.ContentRecordingSession createDisplaySession(int)\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)") inputSignatures = "public static final int RECORD_CONTENT_DISPLAY\npublic static final int RECORD_CONTENT_TASK\nprivate int mVirtualDisplayId\nprivate @android.view.ContentRecordingSession.RecordContent int mContentToRecord\nprivate int mDisplayToRecord\nprivate @android.annotation.Nullable android.os.IBinder mTokenToRecord\nprivate boolean mWaitingForConsent\npublic static android.view.ContentRecordingSession createDisplaySession(int)\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() {} Loading data/etc/services.core.protolog.json +12 −0 Original line number Diff line number Diff line Loading @@ -1675,6 +1675,12 @@ "group": "WM_DEBUG_CONFIGURATION", "at": "com\/android\/server\/am\/ActivityManagerService.java" }, "-584061725": { "message": "Content Recording: Accept session updating same display %d with granted consent, with an existing session %s", "level": "VERBOSE", "group": "WM_DEBUG_CONTENT_RECORDING", "at": "com\/android\/server\/wm\/ContentRecordingController.java" }, "-583031528": { "message": "%s", "level": "INFO", Loading Loading @@ -2167,6 +2173,12 @@ "group": "WM_DEBUG_BACK_PREVIEW", "at": "com\/android\/server\/wm\/TaskFragment.java" }, "-125383273": { "message": "Content Recording: waiting to record, so do nothing", "level": "VERBOSE", "group": "WM_DEBUG_CONTENT_RECORDING", "at": "com\/android\/server\/wm\/ContentRecorder.java" }, "-124316973": { "message": "Translucent=%s Floating=%s ShowWallpaper=%s Disable=%s", "level": "VERBOSE", Loading services/core/java/com/android/server/display/DisplayManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -1560,7 +1560,7 @@ public final class DisplayManagerService extends SystemService { // VirtualDisplay has been successfully constructed. session.setVirtualDisplayId(displayId); // Don't start mirroring until user re-grants consent. session.setWaitingToRecord(waitForPermissionConsent); session.setWaitingForConsent(waitForPermissionConsent); // We set the content recording session here on the server side instead of using // a second AIDL call in MediaProjection. By ensuring that a virtual display has Loading services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java +3 −3 Original line number Diff line number Diff line Loading @@ -406,7 +406,7 @@ public final class MediaProjectionManagerService extends SystemService return; } if (mProjectionGrant.mSession == null || !mProjectionGrant.mSession.isWaitingToRecord()) { || !mProjectionGrant.mSession.isWaitingForConsent()) { Slog.w(TAG, "Reusing token: Ignore consent result " + consentResult + " if not waiting for the result."); return; Loading Loading @@ -445,7 +445,7 @@ public final class MediaProjectionManagerService extends SystemService */ private void setReviewedConsentSessionLocked(@Nullable ContentRecordingSession session) { if (session != null) { session.setWaitingToRecord(false); session.setWaitingForConsent(false); session.setVirtualDisplayId(mProjectionGrant.mVirtualDisplayId); } Loading Loading @@ -490,7 +490,7 @@ public final class MediaProjectionManagerService extends SystemService // Supposedly the package has re-used the user's consent; confirm the provided details // against the current projection token before re-using the current projection. if (mProjectionGrant == null || mProjectionGrant.mSession == null || !mProjectionGrant.mSession.isWaitingToRecord()) { || !mProjectionGrant.mSession.isWaitingForConsent()) { Slog.e(TAG, "Reusing token: Not possible to reuse the current projection " + "instance"); return null; Loading services/core/java/com/android/server/wm/ContentRecorder.java +6 −0 Original line number Diff line number Diff line Loading @@ -276,6 +276,12 @@ final class ContentRecorder implements WindowContainerListener { return; } if (mContentRecordingSession.isWaitingForConsent()) { ProtoLog.v(WM_DEBUG_CONTENT_RECORDING, "Content Recording: waiting to record, so do " + "nothing"); return; } mRecordedWindowContainer = retrieveRecordedWindowContainer(); if (mRecordedWindowContainer == null) { // Either the token is missing, or the window associated with the token is missing. Loading Loading
core/java/android/view/ContentRecordingSession.java +20 −20 Original line number Diff line number Diff line Loading @@ -87,7 +87,7 @@ public final class ContentRecordingSession implements Parcelable { * * <p>Only set on the server side to sanitize any input from the client process. */ private boolean mWaitingToRecord = false; private boolean mWaitingForConsent = false; /** * Default instance, with recording the display. Loading Loading @@ -181,7 +181,7 @@ public final class ContentRecordingSession implements Parcelable { @RecordContent int contentToRecord, int displayToRecord, @Nullable IBinder tokenToRecord, boolean waitingToRecord) { boolean waitingForConsent) { this.mVirtualDisplayId = virtualDisplayId; this.mContentToRecord = contentToRecord; Loading @@ -195,7 +195,7 @@ public final class ContentRecordingSession implements Parcelable { this.mDisplayToRecord = displayToRecord; this.mTokenToRecord = tokenToRecord; this.mWaitingToRecord = waitingToRecord; this.mWaitingForConsent = waitingForConsent; // onConstructed(); // You can define this method to get a callback } Loading Loading @@ -246,8 +246,8 @@ public final class ContentRecordingSession implements Parcelable { * <p>Only set on the server side to sanitize any input from the client process. */ @DataClass.Generated.Member public boolean isWaitingToRecord() { return mWaitingToRecord; public boolean isWaitingForConsent() { return mWaitingForConsent; } /** Loading Loading @@ -309,8 +309,8 @@ public final class ContentRecordingSession implements Parcelable { * <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; public @NonNull ContentRecordingSession setWaitingForConsent( boolean value) { mWaitingForConsent = value; return this; } Loading @@ -325,7 +325,7 @@ public final class ContentRecordingSession implements Parcelable { "contentToRecord = " + recordContentToString(mContentToRecord) + ", " + "displayToRecord = " + mDisplayToRecord + ", " + "tokenToRecord = " + mTokenToRecord + ", " + "waitingToRecord = " + mWaitingToRecord + "waitingForConsent = " + mWaitingForConsent + " }"; } Loading @@ -346,7 +346,7 @@ public final class ContentRecordingSession implements Parcelable { && mContentToRecord == that.mContentToRecord && mDisplayToRecord == that.mDisplayToRecord && java.util.Objects.equals(mTokenToRecord, that.mTokenToRecord) && mWaitingToRecord == that.mWaitingToRecord; && mWaitingForConsent == that.mWaitingForConsent; } @Override Loading @@ -360,7 +360,7 @@ public final class ContentRecordingSession implements Parcelable { _hash = 31 * _hash + mContentToRecord; _hash = 31 * _hash + mDisplayToRecord; _hash = 31 * _hash + java.util.Objects.hashCode(mTokenToRecord); _hash = 31 * _hash + Boolean.hashCode(mWaitingToRecord); _hash = 31 * _hash + Boolean.hashCode(mWaitingForConsent); return _hash; } Loading @@ -371,7 +371,7 @@ public final class ContentRecordingSession implements Parcelable { // void parcelFieldName(Parcel dest, int flags) { ... } byte flg = 0; if (mWaitingToRecord) flg |= 0x10; if (mWaitingForConsent) flg |= 0x10; if (mTokenToRecord != null) flg |= 0x8; dest.writeByte(flg); dest.writeInt(mVirtualDisplayId); Loading @@ -392,7 +392,7 @@ public final class ContentRecordingSession implements Parcelable { // static FieldType unparcelFieldName(Parcel in) { ... } byte flg = in.readByte(); boolean waitingToRecord = (flg & 0x10) != 0; boolean waitingForConsent = (flg & 0x10) != 0; int virtualDisplayId = in.readInt(); int contentToRecord = in.readInt(); int displayToRecord = in.readInt(); Loading @@ -411,7 +411,7 @@ public final class ContentRecordingSession implements Parcelable { this.mDisplayToRecord = displayToRecord; this.mTokenToRecord = tokenToRecord; this.mWaitingToRecord = waitingToRecord; this.mWaitingForConsent = waitingForConsent; // onConstructed(); // You can define this method to get a callback } Loading Loading @@ -441,7 +441,7 @@ public final class ContentRecordingSession implements Parcelable { private @RecordContent int mContentToRecord; private int mDisplayToRecord; private @Nullable IBinder mTokenToRecord; private boolean mWaitingToRecord; private boolean mWaitingForConsent; private long mBuilderFieldsSet = 0L; Loading Loading @@ -506,10 +506,10 @@ public final class ContentRecordingSession implements Parcelable { * <p>Only set on the server side to sanitize any input from the client process. */ @DataClass.Generated.Member public @NonNull Builder setWaitingToRecord(boolean value) { public @NonNull Builder setWaitingForConsent(boolean value) { checkNotUsed(); mBuilderFieldsSet |= 0x10; mWaitingToRecord = value; mWaitingForConsent = value; return this; } Loading @@ -531,14 +531,14 @@ public final class ContentRecordingSession implements Parcelable { mTokenToRecord = null; } if ((mBuilderFieldsSet & 0x10) == 0) { mWaitingToRecord = false; mWaitingForConsent = false; } ContentRecordingSession o = new ContentRecordingSession( mVirtualDisplayId, mContentToRecord, mDisplayToRecord, mTokenToRecord, mWaitingToRecord); mWaitingForConsent); return o; } Loading @@ -551,10 +551,10 @@ public final class ContentRecordingSession implements Parcelable { } @DataClass.Generated( time = 1679855157534L, time = 1683628463074L, 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 mVirtualDisplayId\nprivate @android.view.ContentRecordingSession.RecordContent int mContentToRecord\nprivate int mDisplayToRecord\nprivate @android.annotation.Nullable android.os.IBinder mTokenToRecord\nprivate boolean mWaitingToRecord\npublic static android.view.ContentRecordingSession createDisplaySession(int)\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)") inputSignatures = "public static final int RECORD_CONTENT_DISPLAY\npublic static final int RECORD_CONTENT_TASK\nprivate int mVirtualDisplayId\nprivate @android.view.ContentRecordingSession.RecordContent int mContentToRecord\nprivate int mDisplayToRecord\nprivate @android.annotation.Nullable android.os.IBinder mTokenToRecord\nprivate boolean mWaitingForConsent\npublic static android.view.ContentRecordingSession createDisplaySession(int)\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() {} Loading
data/etc/services.core.protolog.json +12 −0 Original line number Diff line number Diff line Loading @@ -1675,6 +1675,12 @@ "group": "WM_DEBUG_CONFIGURATION", "at": "com\/android\/server\/am\/ActivityManagerService.java" }, "-584061725": { "message": "Content Recording: Accept session updating same display %d with granted consent, with an existing session %s", "level": "VERBOSE", "group": "WM_DEBUG_CONTENT_RECORDING", "at": "com\/android\/server\/wm\/ContentRecordingController.java" }, "-583031528": { "message": "%s", "level": "INFO", Loading Loading @@ -2167,6 +2173,12 @@ "group": "WM_DEBUG_BACK_PREVIEW", "at": "com\/android\/server\/wm\/TaskFragment.java" }, "-125383273": { "message": "Content Recording: waiting to record, so do nothing", "level": "VERBOSE", "group": "WM_DEBUG_CONTENT_RECORDING", "at": "com\/android\/server\/wm\/ContentRecorder.java" }, "-124316973": { "message": "Translucent=%s Floating=%s ShowWallpaper=%s Disable=%s", "level": "VERBOSE", Loading
services/core/java/com/android/server/display/DisplayManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -1560,7 +1560,7 @@ public final class DisplayManagerService extends SystemService { // VirtualDisplay has been successfully constructed. session.setVirtualDisplayId(displayId); // Don't start mirroring until user re-grants consent. session.setWaitingToRecord(waitForPermissionConsent); session.setWaitingForConsent(waitForPermissionConsent); // We set the content recording session here on the server side instead of using // a second AIDL call in MediaProjection. By ensuring that a virtual display has Loading
services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java +3 −3 Original line number Diff line number Diff line Loading @@ -406,7 +406,7 @@ public final class MediaProjectionManagerService extends SystemService return; } if (mProjectionGrant.mSession == null || !mProjectionGrant.mSession.isWaitingToRecord()) { || !mProjectionGrant.mSession.isWaitingForConsent()) { Slog.w(TAG, "Reusing token: Ignore consent result " + consentResult + " if not waiting for the result."); return; Loading Loading @@ -445,7 +445,7 @@ public final class MediaProjectionManagerService extends SystemService */ private void setReviewedConsentSessionLocked(@Nullable ContentRecordingSession session) { if (session != null) { session.setWaitingToRecord(false); session.setWaitingForConsent(false); session.setVirtualDisplayId(mProjectionGrant.mVirtualDisplayId); } Loading Loading @@ -490,7 +490,7 @@ public final class MediaProjectionManagerService extends SystemService // Supposedly the package has re-used the user's consent; confirm the provided details // against the current projection token before re-using the current projection. if (mProjectionGrant == null || mProjectionGrant.mSession == null || !mProjectionGrant.mSession.isWaitingToRecord()) { || !mProjectionGrant.mSession.isWaitingForConsent()) { Slog.e(TAG, "Reusing token: Not possible to reuse the current projection " + "instance"); return null; Loading
services/core/java/com/android/server/wm/ContentRecorder.java +6 −0 Original line number Diff line number Diff line Loading @@ -276,6 +276,12 @@ final class ContentRecorder implements WindowContainerListener { return; } if (mContentRecordingSession.isWaitingForConsent()) { ProtoLog.v(WM_DEBUG_CONTENT_RECORDING, "Content Recording: waiting to record, so do " + "nothing"); return; } mRecordedWindowContainer = retrieveRecordedWindowContainer(); if (mRecordedWindowContainer == null) { // Either the token is missing, or the window associated with the token is missing. Loading