Loading services/core/java/com/android/server/wm/ContentRecorder.java +13 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,19 @@ final class ContentRecorder implements WindowContainerListener { } } /** Called when the surface of display is changed to a different instance. */ void resetRecordingDisplay(int displayId) { if (!isCurrentlyRecording() || mContentRecordingSession.getDisplayToRecord() != displayId) { return; } ProtoLog.v(WM_DEBUG_CONTENT_RECORDING, "Content Recording: Display %d changed surface so stop recording", displayId); mDisplayContent.mWmService.mTransactionFactory.get().remove(mRecordedSurface).apply(); mRecordedSurface = null; // Do not un-set the token, in case new surface is ready and recording should begin again. } /** * Pauses recording on this display content. Note the session does not need to be updated, * since recording can be resumed still. Loading services/core/java/com/android/server/wm/DisplayContent.java +7 −1 Original line number Diff line number Diff line Loading @@ -1272,7 +1272,13 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp @Override void migrateToNewSurfaceControl(Transaction t) { t.remove(mSurfaceControl); // Reset the recording displays which were mirroring this display. for (int i = mRootWindowContainer.getChildCount() - 1; i >= 0; i--) { final ContentRecorder recorder = mRootWindowContainer.getChildAt(i).mContentRecorder; if (recorder != null) { recorder.resetRecordingDisplay(mDisplayId); } } mLastSurfacePosition.set(0, 0); mLastDeltaRotation = Surface.ROTATION_0; Loading Loading
services/core/java/com/android/server/wm/ContentRecorder.java +13 −0 Original line number Diff line number Diff line Loading @@ -243,6 +243,19 @@ final class ContentRecorder implements WindowContainerListener { } } /** Called when the surface of display is changed to a different instance. */ void resetRecordingDisplay(int displayId) { if (!isCurrentlyRecording() || mContentRecordingSession.getDisplayToRecord() != displayId) { return; } ProtoLog.v(WM_DEBUG_CONTENT_RECORDING, "Content Recording: Display %d changed surface so stop recording", displayId); mDisplayContent.mWmService.mTransactionFactory.get().remove(mRecordedSurface).apply(); mRecordedSurface = null; // Do not un-set the token, in case new surface is ready and recording should begin again. } /** * Pauses recording on this display content. Note the session does not need to be updated, * since recording can be resumed still. Loading
services/core/java/com/android/server/wm/DisplayContent.java +7 −1 Original line number Diff line number Diff line Loading @@ -1272,7 +1272,13 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp @Override void migrateToNewSurfaceControl(Transaction t) { t.remove(mSurfaceControl); // Reset the recording displays which were mirroring this display. for (int i = mRootWindowContainer.getChildCount() - 1; i >= 0; i--) { final ContentRecorder recorder = mRootWindowContainer.getChildAt(i).mContentRecorder; if (recorder != null) { recorder.resetRecordingDisplay(mDisplayId); } } mLastSurfacePosition.set(0, 0); mLastDeltaRotation = Surface.ROTATION_0; Loading