int VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR Virtual display flag: Allows content to be mirrored on private displays when no content is being shown. This flag is mutually exclusive with VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY. If both flags are specified then the own-content only behavior will be applied. The behavior of this flag is implied whenever VIRTUAL_DISPLAY_FLAG_PUBLIC is set and VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY has not been set. This flag is only required to override the default behavior when creating a private display. Creating an auto-mirroing virtual display requires the CAPTURE_VIDEO_OUTPUTorCAPTURE_SECURE_VIDEO_OUTPUT permission. These permissions are reserved for use by system components and are not available to third-party applications. Alternatively, an appropriate MediaProjection may be used to create an auto-mirroring virtual display. createVirtualDisplay(String, int, int, int, Surface, int) createVirtualDisplay Code: VirtualDisplaycreateVirtualDisplay (Stringname, int width, int height, int densityDpi,Surfacesurface, int flags) Creates a virtual display. Parameters nameStringwidthintheightintdensityDpiintsurfaceSurfaceflagsint