Loading core/java/android/hardware/display/DisplayManagerInternal.java +5 −13 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.annotation.Nullable; import android.graphics.Point; import android.hardware.SensorManager; import android.os.Handler; import android.os.IBinder; import android.os.PowerManager; import android.util.IntArray; import android.util.Slog; Loading Loading @@ -351,24 +350,17 @@ public abstract class DisplayManagerInternal { public abstract List<RefreshRateLimitation> getRefreshRateLimitations(int displayId); /** * Returns the window token of the level of the WindowManager hierarchy to mirror. Returns null * if layer mirroring by SurfaceFlinger should not be performed for the given displayId. * For now, only used for mirroring started from MediaProjection. */ public abstract IBinder getWindowTokenClientToMirror(int displayId); /** * For the given displayId, updates the window token of the level of the WindowManager hierarchy * to mirror. If windowToken is null, then SurfaceFlinger performs no layer mirroring to the * For the given displayId, updates if WindowManager is responsible for mirroring on that * display. If {@code false}, then SurfaceFlinger performs no layer mirroring to the * given display. * For now, only used for mirroring started from MediaProjection. * Only used for mirroring started from MediaProjection. */ public abstract void setWindowTokenClientToMirror(int displayId, IBinder windowToken); public abstract void setWindowManagerMirroring(int displayId, boolean isMirroring); /** * Returns the default size of the surface associated with the display, or null if the surface * is not provided for layer mirroring by SurfaceFlinger. * For now, only used for mirroring started from MediaProjection. * Only used for mirroring started from MediaProjection. */ public abstract Point getDisplaySurfaceDefaultSize(int displayId); Loading core/java/android/hardware/display/VirtualDisplayConfig.java +21 −24 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.annotation.Nullable; import android.hardware.display.DisplayManager.VirtualDisplayFlag; import android.media.projection.MediaProjection; import android.os.Handler; import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; import android.view.Surface; Loading Loading @@ -95,11 +94,10 @@ public final class VirtualDisplayConfig implements Parcelable { private int mDisplayIdToMirror = DEFAULT_DISPLAY; /** * The window token of the level of the WindowManager hierarchy to mirror, or null if mirroring * should not be performed. * Indicates if WindowManager is responsible for mirroring content to this VirtualDisplay, or * if DisplayManager should record contents instead. */ @Nullable private IBinder mWindowTokenClientToMirror = null; private boolean mWindowManagerMirroring = false; Loading @@ -126,7 +124,7 @@ public final class VirtualDisplayConfig implements Parcelable { @Nullable Surface surface, @Nullable String uniqueId, int displayIdToMirror, @Nullable IBinder windowTokenClientToMirror) { boolean windowManagerMirroring) { this.mName = name; com.android.internal.util.AnnotationValidations.validate( NonNull.class, null, mName); Loading @@ -148,7 +146,7 @@ public final class VirtualDisplayConfig implements Parcelable { this.mSurface = surface; this.mUniqueId = uniqueId; this.mDisplayIdToMirror = displayIdToMirror; this.mWindowTokenClientToMirror = windowTokenClientToMirror; this.mWindowManagerMirroring = windowManagerMirroring; // onConstructed(); // You can define this method to get a callback } Loading Loading @@ -227,12 +225,12 @@ public final class VirtualDisplayConfig implements Parcelable { } /** * The window token of the level of the WindowManager hierarchy to mirror, or null if mirroring * should not be performed. * Indicates if WindowManager is responsible for mirroring content to this VirtualDisplay, or * if DisplayManager should record contents instead. */ @DataClass.Generated.Member public @Nullable IBinder getWindowTokenClientToMirror() { return mWindowTokenClientToMirror; public boolean isWindowManagerMirroring() { return mWindowManagerMirroring; } @Override Loading @@ -242,9 +240,9 @@ public final class VirtualDisplayConfig implements Parcelable { // void parcelFieldName(Parcel dest, int flags) { ... } int flg = 0; if (mWindowManagerMirroring) flg |= 0x100; if (mSurface != null) flg |= 0x20; if (mUniqueId != null) flg |= 0x40; if (mWindowTokenClientToMirror != null) flg |= 0x100; dest.writeInt(flg); dest.writeString(mName); dest.writeInt(mWidth); Loading @@ -254,7 +252,6 @@ public final class VirtualDisplayConfig implements Parcelable { if (mSurface != null) dest.writeTypedObject(mSurface, flags); if (mUniqueId != null) dest.writeString(mUniqueId); dest.writeInt(mDisplayIdToMirror); if (mWindowTokenClientToMirror != null) dest.writeStrongBinder(mWindowTokenClientToMirror); } @Override Loading @@ -269,6 +266,7 @@ public final class VirtualDisplayConfig implements Parcelable { // static FieldType unparcelFieldName(Parcel in) { ... } int flg = in.readInt(); boolean windowManagerMirroring = (flg & 0x100) != 0; String name = in.readString(); int width = in.readInt(); int height = in.readInt(); Loading @@ -277,7 +275,6 @@ public final class VirtualDisplayConfig implements Parcelable { Surface surface = (flg & 0x20) == 0 ? null : (Surface) in.readTypedObject(Surface.CREATOR); String uniqueId = (flg & 0x40) == 0 ? null : in.readString(); int displayIdToMirror = in.readInt(); IBinder windowTokenClientToMirror = (flg & 0x100) == 0 ? null : (IBinder) in.readStrongBinder(); this.mName = name; com.android.internal.util.AnnotationValidations.validate( Loading @@ -300,7 +297,7 @@ public final class VirtualDisplayConfig implements Parcelable { this.mSurface = surface; this.mUniqueId = uniqueId; this.mDisplayIdToMirror = displayIdToMirror; this.mWindowTokenClientToMirror = windowTokenClientToMirror; this.mWindowManagerMirroring = windowManagerMirroring; // onConstructed(); // You can define this method to get a callback } Loading Loading @@ -334,7 +331,7 @@ public final class VirtualDisplayConfig implements Parcelable { private @Nullable Surface mSurface; private @Nullable String mUniqueId; private int mDisplayIdToMirror; private @Nullable IBinder mWindowTokenClientToMirror; private boolean mWindowManagerMirroring; private long mBuilderFieldsSet = 0L; Loading Loading @@ -470,14 +467,14 @@ public final class VirtualDisplayConfig implements Parcelable { } /** * The window token of the level of the WindowManager hierarchy to mirror, or null if mirroring * should not be performed. * Indicates if WindowManager is responsible for mirroring content to this VirtualDisplay, or * if DisplayManager should record contents instead. */ @DataClass.Generated.Member public @NonNull Builder setWindowTokenClientToMirror(@NonNull IBinder value) { public @NonNull Builder setWindowManagerMirroring(boolean value) { checkNotUsed(); mBuilderFieldsSet |= 0x100; mWindowTokenClientToMirror = value; mWindowManagerMirroring = value; return this; } Loading @@ -499,7 +496,7 @@ public final class VirtualDisplayConfig implements Parcelable { mDisplayIdToMirror = DEFAULT_DISPLAY; } if ((mBuilderFieldsSet & 0x100) == 0) { mWindowTokenClientToMirror = null; mWindowManagerMirroring = false; } VirtualDisplayConfig o = new VirtualDisplayConfig( mName, Loading @@ -510,7 +507,7 @@ public final class VirtualDisplayConfig implements Parcelable { mSurface, mUniqueId, mDisplayIdToMirror, mWindowTokenClientToMirror); mWindowManagerMirroring); return o; } Loading @@ -523,10 +520,10 @@ public final class VirtualDisplayConfig implements Parcelable { } @DataClass.Generated( time = 1643938791506L, time = 1646227247934L, codegenVersion = "1.0.23", sourceFile = "frameworks/base/core/java/android/hardware/display/VirtualDisplayConfig.java", inputSignatures = "private @android.annotation.NonNull java.lang.String mName\nprivate @android.annotation.IntRange int mWidth\nprivate @android.annotation.IntRange int mHeight\nprivate @android.annotation.IntRange int mDensityDpi\nprivate @android.hardware.display.DisplayManager.VirtualDisplayFlag int mFlags\nprivate @android.annotation.Nullable android.view.Surface mSurface\nprivate @android.annotation.Nullable java.lang.String mUniqueId\nprivate int mDisplayIdToMirror\nprivate @android.annotation.Nullable android.os.IBinder mWindowTokenClientToMirror\nclass VirtualDisplayConfig extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genParcelable=true, genAidl=true, genBuilder=true)") inputSignatures = "private @android.annotation.NonNull java.lang.String mName\nprivate @android.annotation.IntRange int mWidth\nprivate @android.annotation.IntRange int mHeight\nprivate @android.annotation.IntRange int mDensityDpi\nprivate @android.hardware.display.DisplayManager.VirtualDisplayFlag int mFlags\nprivate @android.annotation.Nullable android.view.Surface mSurface\nprivate @android.annotation.Nullable java.lang.String mUniqueId\nprivate int mDisplayIdToMirror\nprivate boolean mWindowManagerMirroring\nclass VirtualDisplayConfig extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genParcelable=true, genAidl=true, genBuilder=true)") @Deprecated private void __metadata() {} Loading core/java/android/view/ContentRecordingSession.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /** * Copyright (c) 2022, The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.view; parcelable ContentRecordingSession; core/java/android/view/ContentRecordingSession.java 0 → 100644 +447 −0 File added.Preview size limit exceeded, changes collapsed. Show changes core/java/android/view/IWindowManager.aidl +12 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.graphics.Region; import android.os.Bundle; import android.os.IRemoteCallback; import android.os.ParcelFileDescriptor; import android.view.ContentRecordingSession; import android.view.DisplayCutout; import android.view.DisplayInfo; import android.view.IAppTransitionAnimationSpecsFuture; Loading Loading @@ -878,6 +879,17 @@ interface IWindowManager */ void detachWindowContextFromWindowContainer(IBinder clientToken); /** * Updates the content recording session. If a different session is already in progress, then * the pre-existing session is stopped, and the new incoming session takes over. * * The DisplayContent for the new session will begin recording when * {@link RootWindowContainer#onDisplayChanged} is invoked for the new {@link VirtualDisplay}. * * @param incomingSession the nullable incoming content recording session */ void setContentRecordingSession(in ContentRecordingSession incomingSession); /** * Registers a listener, which is to be called whenever cross-window blur is enabled/disabled. * Loading Loading
core/java/android/hardware/display/DisplayManagerInternal.java +5 −13 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.annotation.Nullable; import android.graphics.Point; import android.hardware.SensorManager; import android.os.Handler; import android.os.IBinder; import android.os.PowerManager; import android.util.IntArray; import android.util.Slog; Loading Loading @@ -351,24 +350,17 @@ public abstract class DisplayManagerInternal { public abstract List<RefreshRateLimitation> getRefreshRateLimitations(int displayId); /** * Returns the window token of the level of the WindowManager hierarchy to mirror. Returns null * if layer mirroring by SurfaceFlinger should not be performed for the given displayId. * For now, only used for mirroring started from MediaProjection. */ public abstract IBinder getWindowTokenClientToMirror(int displayId); /** * For the given displayId, updates the window token of the level of the WindowManager hierarchy * to mirror. If windowToken is null, then SurfaceFlinger performs no layer mirroring to the * For the given displayId, updates if WindowManager is responsible for mirroring on that * display. If {@code false}, then SurfaceFlinger performs no layer mirroring to the * given display. * For now, only used for mirroring started from MediaProjection. * Only used for mirroring started from MediaProjection. */ public abstract void setWindowTokenClientToMirror(int displayId, IBinder windowToken); public abstract void setWindowManagerMirroring(int displayId, boolean isMirroring); /** * Returns the default size of the surface associated with the display, or null if the surface * is not provided for layer mirroring by SurfaceFlinger. * For now, only used for mirroring started from MediaProjection. * Only used for mirroring started from MediaProjection. */ public abstract Point getDisplaySurfaceDefaultSize(int displayId); Loading
core/java/android/hardware/display/VirtualDisplayConfig.java +21 −24 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.annotation.Nullable; import android.hardware.display.DisplayManager.VirtualDisplayFlag; import android.media.projection.MediaProjection; import android.os.Handler; import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; import android.view.Surface; Loading Loading @@ -95,11 +94,10 @@ public final class VirtualDisplayConfig implements Parcelable { private int mDisplayIdToMirror = DEFAULT_DISPLAY; /** * The window token of the level of the WindowManager hierarchy to mirror, or null if mirroring * should not be performed. * Indicates if WindowManager is responsible for mirroring content to this VirtualDisplay, or * if DisplayManager should record contents instead. */ @Nullable private IBinder mWindowTokenClientToMirror = null; private boolean mWindowManagerMirroring = false; Loading @@ -126,7 +124,7 @@ public final class VirtualDisplayConfig implements Parcelable { @Nullable Surface surface, @Nullable String uniqueId, int displayIdToMirror, @Nullable IBinder windowTokenClientToMirror) { boolean windowManagerMirroring) { this.mName = name; com.android.internal.util.AnnotationValidations.validate( NonNull.class, null, mName); Loading @@ -148,7 +146,7 @@ public final class VirtualDisplayConfig implements Parcelable { this.mSurface = surface; this.mUniqueId = uniqueId; this.mDisplayIdToMirror = displayIdToMirror; this.mWindowTokenClientToMirror = windowTokenClientToMirror; this.mWindowManagerMirroring = windowManagerMirroring; // onConstructed(); // You can define this method to get a callback } Loading Loading @@ -227,12 +225,12 @@ public final class VirtualDisplayConfig implements Parcelable { } /** * The window token of the level of the WindowManager hierarchy to mirror, or null if mirroring * should not be performed. * Indicates if WindowManager is responsible for mirroring content to this VirtualDisplay, or * if DisplayManager should record contents instead. */ @DataClass.Generated.Member public @Nullable IBinder getWindowTokenClientToMirror() { return mWindowTokenClientToMirror; public boolean isWindowManagerMirroring() { return mWindowManagerMirroring; } @Override Loading @@ -242,9 +240,9 @@ public final class VirtualDisplayConfig implements Parcelable { // void parcelFieldName(Parcel dest, int flags) { ... } int flg = 0; if (mWindowManagerMirroring) flg |= 0x100; if (mSurface != null) flg |= 0x20; if (mUniqueId != null) flg |= 0x40; if (mWindowTokenClientToMirror != null) flg |= 0x100; dest.writeInt(flg); dest.writeString(mName); dest.writeInt(mWidth); Loading @@ -254,7 +252,6 @@ public final class VirtualDisplayConfig implements Parcelable { if (mSurface != null) dest.writeTypedObject(mSurface, flags); if (mUniqueId != null) dest.writeString(mUniqueId); dest.writeInt(mDisplayIdToMirror); if (mWindowTokenClientToMirror != null) dest.writeStrongBinder(mWindowTokenClientToMirror); } @Override Loading @@ -269,6 +266,7 @@ public final class VirtualDisplayConfig implements Parcelable { // static FieldType unparcelFieldName(Parcel in) { ... } int flg = in.readInt(); boolean windowManagerMirroring = (flg & 0x100) != 0; String name = in.readString(); int width = in.readInt(); int height = in.readInt(); Loading @@ -277,7 +275,6 @@ public final class VirtualDisplayConfig implements Parcelable { Surface surface = (flg & 0x20) == 0 ? null : (Surface) in.readTypedObject(Surface.CREATOR); String uniqueId = (flg & 0x40) == 0 ? null : in.readString(); int displayIdToMirror = in.readInt(); IBinder windowTokenClientToMirror = (flg & 0x100) == 0 ? null : (IBinder) in.readStrongBinder(); this.mName = name; com.android.internal.util.AnnotationValidations.validate( Loading @@ -300,7 +297,7 @@ public final class VirtualDisplayConfig implements Parcelable { this.mSurface = surface; this.mUniqueId = uniqueId; this.mDisplayIdToMirror = displayIdToMirror; this.mWindowTokenClientToMirror = windowTokenClientToMirror; this.mWindowManagerMirroring = windowManagerMirroring; // onConstructed(); // You can define this method to get a callback } Loading Loading @@ -334,7 +331,7 @@ public final class VirtualDisplayConfig implements Parcelable { private @Nullable Surface mSurface; private @Nullable String mUniqueId; private int mDisplayIdToMirror; private @Nullable IBinder mWindowTokenClientToMirror; private boolean mWindowManagerMirroring; private long mBuilderFieldsSet = 0L; Loading Loading @@ -470,14 +467,14 @@ public final class VirtualDisplayConfig implements Parcelable { } /** * The window token of the level of the WindowManager hierarchy to mirror, or null if mirroring * should not be performed. * Indicates if WindowManager is responsible for mirroring content to this VirtualDisplay, or * if DisplayManager should record contents instead. */ @DataClass.Generated.Member public @NonNull Builder setWindowTokenClientToMirror(@NonNull IBinder value) { public @NonNull Builder setWindowManagerMirroring(boolean value) { checkNotUsed(); mBuilderFieldsSet |= 0x100; mWindowTokenClientToMirror = value; mWindowManagerMirroring = value; return this; } Loading @@ -499,7 +496,7 @@ public final class VirtualDisplayConfig implements Parcelable { mDisplayIdToMirror = DEFAULT_DISPLAY; } if ((mBuilderFieldsSet & 0x100) == 0) { mWindowTokenClientToMirror = null; mWindowManagerMirroring = false; } VirtualDisplayConfig o = new VirtualDisplayConfig( mName, Loading @@ -510,7 +507,7 @@ public final class VirtualDisplayConfig implements Parcelable { mSurface, mUniqueId, mDisplayIdToMirror, mWindowTokenClientToMirror); mWindowManagerMirroring); return o; } Loading @@ -523,10 +520,10 @@ public final class VirtualDisplayConfig implements Parcelable { } @DataClass.Generated( time = 1643938791506L, time = 1646227247934L, codegenVersion = "1.0.23", sourceFile = "frameworks/base/core/java/android/hardware/display/VirtualDisplayConfig.java", inputSignatures = "private @android.annotation.NonNull java.lang.String mName\nprivate @android.annotation.IntRange int mWidth\nprivate @android.annotation.IntRange int mHeight\nprivate @android.annotation.IntRange int mDensityDpi\nprivate @android.hardware.display.DisplayManager.VirtualDisplayFlag int mFlags\nprivate @android.annotation.Nullable android.view.Surface mSurface\nprivate @android.annotation.Nullable java.lang.String mUniqueId\nprivate int mDisplayIdToMirror\nprivate @android.annotation.Nullable android.os.IBinder mWindowTokenClientToMirror\nclass VirtualDisplayConfig extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genParcelable=true, genAidl=true, genBuilder=true)") inputSignatures = "private @android.annotation.NonNull java.lang.String mName\nprivate @android.annotation.IntRange int mWidth\nprivate @android.annotation.IntRange int mHeight\nprivate @android.annotation.IntRange int mDensityDpi\nprivate @android.hardware.display.DisplayManager.VirtualDisplayFlag int mFlags\nprivate @android.annotation.Nullable android.view.Surface mSurface\nprivate @android.annotation.Nullable java.lang.String mUniqueId\nprivate int mDisplayIdToMirror\nprivate boolean mWindowManagerMirroring\nclass VirtualDisplayConfig extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genParcelable=true, genAidl=true, genBuilder=true)") @Deprecated private void __metadata() {} Loading
core/java/android/view/ContentRecordingSession.aidl 0 → 100644 +19 −0 Original line number Diff line number Diff line /** * Copyright (c) 2022, The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.view; parcelable ContentRecordingSession;
core/java/android/view/ContentRecordingSession.java 0 → 100644 +447 −0 File added.Preview size limit exceeded, changes collapsed. Show changes
core/java/android/view/IWindowManager.aidl +12 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.graphics.Region; import android.os.Bundle; import android.os.IRemoteCallback; import android.os.ParcelFileDescriptor; import android.view.ContentRecordingSession; import android.view.DisplayCutout; import android.view.DisplayInfo; import android.view.IAppTransitionAnimationSpecsFuture; Loading Loading @@ -878,6 +879,17 @@ interface IWindowManager */ void detachWindowContextFromWindowContainer(IBinder clientToken); /** * Updates the content recording session. If a different session is already in progress, then * the pre-existing session is stopped, and the new incoming session takes over. * * The DisplayContent for the new session will begin recording when * {@link RootWindowContainer#onDisplayChanged} is invoked for the new {@link VirtualDisplay}. * * @param incomingSession the nullable incoming content recording session */ void setContentRecordingSession(in ContentRecordingSession incomingSession); /** * Registers a listener, which is to be called whenever cross-window blur is enabled/disabled. * Loading