Release virtual display before stopping projection

As described in b/140399127, if the media projection is stopped first,
the virtual display will not get released. So we need to release the
display first and stop projection after that.

Bug: 174800535
Bug: 179931688
Test: 'Recording Display' no longer appears in dumpsys after ending a screen recording
Change-Id: I8775068677b3ea5d0836a64579b0539e2e1aafae
This commit is contained in:
Beth Thibodeau
2021-02-10 15:48:03 -05:00
parent 2d29d2d82b
commit 1ca4873295

View File

@@ -187,12 +187,12 @@ public class ScreenMediaRecorder {
*/
void end() {
mMediaRecorder.stop();
mMediaProjection.stop();
mMediaRecorder.release();
mMediaRecorder = null;
mMediaProjection = null;
mInputSurface.release();
mVirtualDisplay.release();
mMediaProjection.stop();
mMediaRecorder = null;
mMediaProjection = null;
stopInternalAudioRecording();
Log.d(TAG, "end recording");