Only allow mirroring on a VirtualDisplay with a mirroring flag or
MediaProjection instance.

ContentRecordingSession is set on VirtualDisplayConfig via a hidden
API; it is not enough to check it's presence before setting up
mirroring in WindowManagerService (by passing through the
ContentRecordingSession). We also check that the VirtualDisplay
is associated with either a MediaProjection, or has the appropriate
flag set.

Bug: 273540791
Test: atest FrameworksServicesTests:DisplayManagerServiceTest
Change-Id: I113f49265af2faea7fdac08afb55fc077feac5cc
2 files changed