Loading core/java/android/hardware/display/DisplayManagerInternal.java +0 −23 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 @@ -340,28 +339,6 @@ 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 * given display. * For now, only used for mirroring started from MediaProjection. */ public abstract void setWindowTokenClientToMirror(int displayId, IBinder windowToken); /** * 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. */ public abstract Point getDisplaySurfaceDefaultSize(int displayId); /** * Describes the requested power state of the display. * Loading core/java/android/hardware/display/VirtualDisplayConfig.java +8 −48 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.annotation.NonNull; import android.annotation.Nullable; 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 @@ -92,16 +91,9 @@ 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. */ @Nullable private IBinder mWindowTokenClientToMirror = null; // Code below generated by codegen v1.0.23. // Code below generated by codegen v1.0.20. // // DO NOT MODIFY! // CHECKSTYLE:OFF Generated code Loading @@ -123,8 +115,7 @@ public final class VirtualDisplayConfig implements Parcelable { int flags, @Nullable Surface surface, @Nullable String uniqueId, int displayIdToMirror, @Nullable IBinder windowTokenClientToMirror) { int displayIdToMirror) { this.mName = name; com.android.internal.util.AnnotationValidations.validate( NonNull.class, null, mName); Loading @@ -144,7 +135,6 @@ public final class VirtualDisplayConfig implements Parcelable { this.mSurface = surface; this.mUniqueId = uniqueId; this.mDisplayIdToMirror = displayIdToMirror; this.mWindowTokenClientToMirror = windowTokenClientToMirror; // onConstructed(); // You can define this method to get a callback } Loading Loading @@ -222,15 +212,6 @@ public final class VirtualDisplayConfig implements Parcelable { return mDisplayIdToMirror; } /** * The window token of the level of the WindowManager hierarchy to mirror, or null if mirroring * should not be performed. */ @DataClass.Generated.Member public @Nullable IBinder getWindowTokenClientToMirror() { return mWindowTokenClientToMirror; } @Override @DataClass.Generated.Member public void writeToParcel(@NonNull Parcel dest, int flags) { Loading @@ -240,7 +221,6 @@ public final class VirtualDisplayConfig implements Parcelable { int flg = 0; 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 @@ -250,7 +230,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 @@ -273,7 +252,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 @@ -294,7 +272,6 @@ public final class VirtualDisplayConfig implements Parcelable { this.mSurface = surface; this.mUniqueId = uniqueId; this.mDisplayIdToMirror = displayIdToMirror; this.mWindowTokenClientToMirror = windowTokenClientToMirror; // onConstructed(); // You can define this method to get a callback } Loading Loading @@ -328,7 +305,6 @@ public final class VirtualDisplayConfig implements Parcelable { private @Nullable Surface mSurface; private @Nullable String mUniqueId; private int mDisplayIdToMirror; private @Nullable IBinder mWindowTokenClientToMirror; private long mBuilderFieldsSet = 0L; Loading Loading @@ -463,22 +439,10 @@ public final class VirtualDisplayConfig implements Parcelable { return this; } /** * The window token of the level of the WindowManager hierarchy to mirror, or null if mirroring * should not be performed. */ @DataClass.Generated.Member public @NonNull Builder setWindowTokenClientToMirror(@NonNull IBinder value) { checkNotUsed(); mBuilderFieldsSet |= 0x100; mWindowTokenClientToMirror = value; return this; } /** Builds the instance. This builder should not be touched after calling this! */ public @NonNull VirtualDisplayConfig build() { checkNotUsed(); mBuilderFieldsSet |= 0x200; // Mark builder used mBuilderFieldsSet |= 0x100; // Mark builder used if ((mBuilderFieldsSet & 0x10) == 0) { mFlags = 0; Loading @@ -492,9 +456,6 @@ public final class VirtualDisplayConfig implements Parcelable { if ((mBuilderFieldsSet & 0x80) == 0) { mDisplayIdToMirror = DEFAULT_DISPLAY; } if ((mBuilderFieldsSet & 0x100) == 0) { mWindowTokenClientToMirror = null; } VirtualDisplayConfig o = new VirtualDisplayConfig( mName, mWidth, Loading @@ -503,13 +464,12 @@ public final class VirtualDisplayConfig implements Parcelable { mFlags, mSurface, mUniqueId, mDisplayIdToMirror, mWindowTokenClientToMirror); mDisplayIdToMirror); return o; } private void checkNotUsed() { if ((mBuilderFieldsSet & 0x200) != 0) { if ((mBuilderFieldsSet & 0x100) != 0) { throw new IllegalStateException( "This Builder should not be reused. Use a new Builder instance instead"); } Loading @@ -517,10 +477,10 @@ public final class VirtualDisplayConfig implements Parcelable { } @DataClass.Generated( time = 1620657851981L, codegenVersion = "1.0.23", time = 1604456298440L, codegenVersion = "1.0.20", 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 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 int mFlags\nprivate @android.annotation.Nullable android.view.Surface mSurface\nprivate @android.annotation.Nullable java.lang.String mUniqueId\nprivate int mDisplayIdToMirror\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/Surface.java +0 −15 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.graphics.Canvas; import android.graphics.ColorSpace; import android.graphics.HardwareRenderer; import android.graphics.Matrix; import android.graphics.Point; import android.graphics.RecordingCanvas; import android.graphics.Rect; import android.graphics.RenderNode; Loading Loading @@ -408,20 +407,6 @@ public class Surface implements Parcelable { } } /** * Returns the default size of this Surface provided by the consumer of the surface. * Should only be used by the producer of the surface. * * @hide */ @NonNull public Point getDefaultSize() { synchronized (mLock) { checkNotReleasedLocked(); return new Point(nativeGetWidth(mNativeObject), nativeGetHeight(mNativeObject)); } } /** * Gets a {@link Canvas} for drawing into this surface. * Loading media/java/android/media/projection/MediaProjection.java +4 −24 Original line number Diff line number Diff line Loading @@ -16,14 +16,14 @@ package android.media.projection; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION; import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; import android.hardware.display.DisplayManager; import android.hardware.display.VirtualDisplay; import android.hardware.display.VirtualDisplayConfig; import android.media.projection.IMediaProjection; import android.media.projection.IMediaProjectionCallback; import android.os.Handler; import android.os.RemoteException; import android.util.ArrayMap; Loading Loading @@ -106,7 +106,7 @@ public final class MediaProjection { if (isSecure) { flags |= DisplayManager.VIRTUAL_DISPLAY_FLAG_SECURE; } final VirtualDisplayConfig.Builder builder = buildMirroredVirtualDisplay(name, width, final VirtualDisplayConfig.Builder builder = new VirtualDisplayConfig.Builder(name, width, height, dpi); builder.setFlags(flags); if (surface != null) { Loading Loading @@ -141,7 +141,7 @@ public final class MediaProjection { public VirtualDisplay createVirtualDisplay(@NonNull String name, int width, int height, int dpi, int flags, @Nullable Surface surface, @Nullable VirtualDisplay.Callback callback, @Nullable Handler handler) { final VirtualDisplayConfig.Builder builder = buildMirroredVirtualDisplay(name, width, final VirtualDisplayConfig.Builder builder = new VirtualDisplayConfig.Builder(name, width, height, dpi); builder.setFlags(flags); if (surface != null) { Loading @@ -150,26 +150,6 @@ public final class MediaProjection { return createVirtualDisplay(builder.build(), callback, handler); } /** * Constructs a {@link VirtualDisplayConfig.Builder}, which will mirror the contents of a * DisplayArea. The DisplayArea to mirror is from the DisplayArea the caller is launched on. * * @param name The name of the virtual display, must be non-empty. * @param width The width of the virtual display in pixels. Must be greater than 0. * @param height The height of the virtual display in pixels. Must be greater than 0. * @param dpi The density of the virtual display in dpi. Must be greater than 0. * @return a config representing a VirtualDisplay */ private VirtualDisplayConfig.Builder buildMirroredVirtualDisplay(@NonNull String name, int width, int height, int dpi) { Context windowContext = mContext.createWindowContext(mContext.getDisplayNoVerify(), TYPE_APPLICATION, null /* options */); final VirtualDisplayConfig.Builder builder = new VirtualDisplayConfig.Builder(name, width, height, dpi); builder.setWindowTokenClientToMirror(windowContext.getWindowContextToken()); return builder; } /** * Creates a {@link android.hardware.display.VirtualDisplay} to capture the * contents of the screen. Loading services/core/java/com/android/server/display/DisplayDevice.java +0 −30 Original line number Diff line number Diff line Loading @@ -16,9 +16,7 @@ package com.android.server.display; import android.annotation.Nullable; import android.content.Context; import android.graphics.Point; import android.graphics.Rect; import android.hardware.display.DisplayViewport; import android.os.IBinder; Loading Loading @@ -106,34 +104,6 @@ abstract class DisplayDevice { return Display.DEFAULT_DISPLAY; } /** * Returns the window token of the level of the WindowManager hierarchy to mirror, or null * if layer mirroring by SurfaceFlinger should not be performed. * For now, only used for mirroring started from MediaProjection. */ @Nullable public IBinder getWindowTokenClientToMirrorLocked() { return null; } /** * Updates the window token of the level of the level of the WindowManager hierarchy to mirror. * If windowToken is null, then no layer mirroring by SurfaceFlinger to should be performed. * For now, only used for mirroring started from MediaProjection. */ public void setWindowTokenClientToMirrorLocked(IBinder windowToken) { } /** * 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. */ @Nullable public Point getDisplaySurfaceDefaultSize() { return null; } /** * Gets the name of the display device. * Loading Loading
core/java/android/hardware/display/DisplayManagerInternal.java +0 −23 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 @@ -340,28 +339,6 @@ 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 * given display. * For now, only used for mirroring started from MediaProjection. */ public abstract void setWindowTokenClientToMirror(int displayId, IBinder windowToken); /** * 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. */ public abstract Point getDisplaySurfaceDefaultSize(int displayId); /** * Describes the requested power state of the display. * Loading
core/java/android/hardware/display/VirtualDisplayConfig.java +8 −48 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.annotation.NonNull; import android.annotation.Nullable; 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 @@ -92,16 +91,9 @@ 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. */ @Nullable private IBinder mWindowTokenClientToMirror = null; // Code below generated by codegen v1.0.23. // Code below generated by codegen v1.0.20. // // DO NOT MODIFY! // CHECKSTYLE:OFF Generated code Loading @@ -123,8 +115,7 @@ public final class VirtualDisplayConfig implements Parcelable { int flags, @Nullable Surface surface, @Nullable String uniqueId, int displayIdToMirror, @Nullable IBinder windowTokenClientToMirror) { int displayIdToMirror) { this.mName = name; com.android.internal.util.AnnotationValidations.validate( NonNull.class, null, mName); Loading @@ -144,7 +135,6 @@ public final class VirtualDisplayConfig implements Parcelable { this.mSurface = surface; this.mUniqueId = uniqueId; this.mDisplayIdToMirror = displayIdToMirror; this.mWindowTokenClientToMirror = windowTokenClientToMirror; // onConstructed(); // You can define this method to get a callback } Loading Loading @@ -222,15 +212,6 @@ public final class VirtualDisplayConfig implements Parcelable { return mDisplayIdToMirror; } /** * The window token of the level of the WindowManager hierarchy to mirror, or null if mirroring * should not be performed. */ @DataClass.Generated.Member public @Nullable IBinder getWindowTokenClientToMirror() { return mWindowTokenClientToMirror; } @Override @DataClass.Generated.Member public void writeToParcel(@NonNull Parcel dest, int flags) { Loading @@ -240,7 +221,6 @@ public final class VirtualDisplayConfig implements Parcelable { int flg = 0; 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 @@ -250,7 +230,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 @@ -273,7 +252,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 @@ -294,7 +272,6 @@ public final class VirtualDisplayConfig implements Parcelable { this.mSurface = surface; this.mUniqueId = uniqueId; this.mDisplayIdToMirror = displayIdToMirror; this.mWindowTokenClientToMirror = windowTokenClientToMirror; // onConstructed(); // You can define this method to get a callback } Loading Loading @@ -328,7 +305,6 @@ public final class VirtualDisplayConfig implements Parcelable { private @Nullable Surface mSurface; private @Nullable String mUniqueId; private int mDisplayIdToMirror; private @Nullable IBinder mWindowTokenClientToMirror; private long mBuilderFieldsSet = 0L; Loading Loading @@ -463,22 +439,10 @@ public final class VirtualDisplayConfig implements Parcelable { return this; } /** * The window token of the level of the WindowManager hierarchy to mirror, or null if mirroring * should not be performed. */ @DataClass.Generated.Member public @NonNull Builder setWindowTokenClientToMirror(@NonNull IBinder value) { checkNotUsed(); mBuilderFieldsSet |= 0x100; mWindowTokenClientToMirror = value; return this; } /** Builds the instance. This builder should not be touched after calling this! */ public @NonNull VirtualDisplayConfig build() { checkNotUsed(); mBuilderFieldsSet |= 0x200; // Mark builder used mBuilderFieldsSet |= 0x100; // Mark builder used if ((mBuilderFieldsSet & 0x10) == 0) { mFlags = 0; Loading @@ -492,9 +456,6 @@ public final class VirtualDisplayConfig implements Parcelable { if ((mBuilderFieldsSet & 0x80) == 0) { mDisplayIdToMirror = DEFAULT_DISPLAY; } if ((mBuilderFieldsSet & 0x100) == 0) { mWindowTokenClientToMirror = null; } VirtualDisplayConfig o = new VirtualDisplayConfig( mName, mWidth, Loading @@ -503,13 +464,12 @@ public final class VirtualDisplayConfig implements Parcelable { mFlags, mSurface, mUniqueId, mDisplayIdToMirror, mWindowTokenClientToMirror); mDisplayIdToMirror); return o; } private void checkNotUsed() { if ((mBuilderFieldsSet & 0x200) != 0) { if ((mBuilderFieldsSet & 0x100) != 0) { throw new IllegalStateException( "This Builder should not be reused. Use a new Builder instance instead"); } Loading @@ -517,10 +477,10 @@ public final class VirtualDisplayConfig implements Parcelable { } @DataClass.Generated( time = 1620657851981L, codegenVersion = "1.0.23", time = 1604456298440L, codegenVersion = "1.0.20", 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 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 int mFlags\nprivate @android.annotation.Nullable android.view.Surface mSurface\nprivate @android.annotation.Nullable java.lang.String mUniqueId\nprivate int mDisplayIdToMirror\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/Surface.java +0 −15 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.graphics.Canvas; import android.graphics.ColorSpace; import android.graphics.HardwareRenderer; import android.graphics.Matrix; import android.graphics.Point; import android.graphics.RecordingCanvas; import android.graphics.Rect; import android.graphics.RenderNode; Loading Loading @@ -408,20 +407,6 @@ public class Surface implements Parcelable { } } /** * Returns the default size of this Surface provided by the consumer of the surface. * Should only be used by the producer of the surface. * * @hide */ @NonNull public Point getDefaultSize() { synchronized (mLock) { checkNotReleasedLocked(); return new Point(nativeGetWidth(mNativeObject), nativeGetHeight(mNativeObject)); } } /** * Gets a {@link Canvas} for drawing into this surface. * Loading
media/java/android/media/projection/MediaProjection.java +4 −24 Original line number Diff line number Diff line Loading @@ -16,14 +16,14 @@ package android.media.projection; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION; import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; import android.hardware.display.DisplayManager; import android.hardware.display.VirtualDisplay; import android.hardware.display.VirtualDisplayConfig; import android.media.projection.IMediaProjection; import android.media.projection.IMediaProjectionCallback; import android.os.Handler; import android.os.RemoteException; import android.util.ArrayMap; Loading Loading @@ -106,7 +106,7 @@ public final class MediaProjection { if (isSecure) { flags |= DisplayManager.VIRTUAL_DISPLAY_FLAG_SECURE; } final VirtualDisplayConfig.Builder builder = buildMirroredVirtualDisplay(name, width, final VirtualDisplayConfig.Builder builder = new VirtualDisplayConfig.Builder(name, width, height, dpi); builder.setFlags(flags); if (surface != null) { Loading Loading @@ -141,7 +141,7 @@ public final class MediaProjection { public VirtualDisplay createVirtualDisplay(@NonNull String name, int width, int height, int dpi, int flags, @Nullable Surface surface, @Nullable VirtualDisplay.Callback callback, @Nullable Handler handler) { final VirtualDisplayConfig.Builder builder = buildMirroredVirtualDisplay(name, width, final VirtualDisplayConfig.Builder builder = new VirtualDisplayConfig.Builder(name, width, height, dpi); builder.setFlags(flags); if (surface != null) { Loading @@ -150,26 +150,6 @@ public final class MediaProjection { return createVirtualDisplay(builder.build(), callback, handler); } /** * Constructs a {@link VirtualDisplayConfig.Builder}, which will mirror the contents of a * DisplayArea. The DisplayArea to mirror is from the DisplayArea the caller is launched on. * * @param name The name of the virtual display, must be non-empty. * @param width The width of the virtual display in pixels. Must be greater than 0. * @param height The height of the virtual display in pixels. Must be greater than 0. * @param dpi The density of the virtual display in dpi. Must be greater than 0. * @return a config representing a VirtualDisplay */ private VirtualDisplayConfig.Builder buildMirroredVirtualDisplay(@NonNull String name, int width, int height, int dpi) { Context windowContext = mContext.createWindowContext(mContext.getDisplayNoVerify(), TYPE_APPLICATION, null /* options */); final VirtualDisplayConfig.Builder builder = new VirtualDisplayConfig.Builder(name, width, height, dpi); builder.setWindowTokenClientToMirror(windowContext.getWindowContextToken()); return builder; } /** * Creates a {@link android.hardware.display.VirtualDisplay} to capture the * contents of the screen. Loading
services/core/java/com/android/server/display/DisplayDevice.java +0 −30 Original line number Diff line number Diff line Loading @@ -16,9 +16,7 @@ package com.android.server.display; import android.annotation.Nullable; import android.content.Context; import android.graphics.Point; import android.graphics.Rect; import android.hardware.display.DisplayViewport; import android.os.IBinder; Loading Loading @@ -106,34 +104,6 @@ abstract class DisplayDevice { return Display.DEFAULT_DISPLAY; } /** * Returns the window token of the level of the WindowManager hierarchy to mirror, or null * if layer mirroring by SurfaceFlinger should not be performed. * For now, only used for mirroring started from MediaProjection. */ @Nullable public IBinder getWindowTokenClientToMirrorLocked() { return null; } /** * Updates the window token of the level of the level of the WindowManager hierarchy to mirror. * If windowToken is null, then no layer mirroring by SurfaceFlinger to should be performed. * For now, only used for mirroring started from MediaProjection. */ public void setWindowTokenClientToMirrorLocked(IBinder windowToken) { } /** * 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. */ @Nullable public Point getDisplaySurfaceDefaultSize() { return null; } /** * Gets the name of the display device. * Loading