Merge "Always updateRecording in ContentRecordingController#setContentRecordingSession" into udc-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6f72903711
@@ -117,10 +117,11 @@ final class ContentRecordingController {
|
||||
}
|
||||
incomingDisplayContent.setContentRecordingSession(incomingSession);
|
||||
// Updating scenario: Explicitly ask ContentRecorder to update, since no config or
|
||||
// display change will trigger an update from the DisplayContent.
|
||||
if (hasSessionUpdatedWithConsent) {
|
||||
incomingDisplayContent.updateRecording();
|
||||
}
|
||||
// display change will trigger an update from the DisplayContent. There exists a
|
||||
// scenario where a DisplayContent is created, but it's ContentRecordingSession hasn't
|
||||
// been set yet due to a race condition. On creation, updateRecording fails to start
|
||||
// recording, so now this call guarantees recording will be started from somewhere.
|
||||
incomingDisplayContent.updateRecording();
|
||||
}
|
||||
// Takeover and stopping scenario: stop recording on the pre-existing session.
|
||||
if (mSession != null && !hasSessionUpdatedWithConsent) {
|
||||
|
||||
@@ -123,6 +123,7 @@ public class ContentRecordingControllerTests extends WindowTestsBase {
|
||||
controller.setContentRecordingSessionLocked(mWaitingDisplaySession, mWm);
|
||||
verify(mVirtualDisplayContent, atLeastOnce()).setContentRecordingSession(
|
||||
mWaitingDisplaySession);
|
||||
verify(mVirtualDisplayContent).updateRecording();
|
||||
|
||||
// WHEN updating the session on the same display, so no longer waiting to record.
|
||||
ContentRecordingSession sessionUpdate = ContentRecordingSession.createTaskSession(
|
||||
@@ -135,7 +136,7 @@ public class ContentRecordingControllerTests extends WindowTestsBase {
|
||||
// THEN the session was accepted.
|
||||
assertThat(resultingSession).isEqualTo(sessionUpdate);
|
||||
verify(mVirtualDisplayContent, atLeastOnce()).setContentRecordingSession(sessionUpdate);
|
||||
verify(mVirtualDisplayContent).updateRecording();
|
||||
verify(mVirtualDisplayContent, atLeastOnce()).updateRecording();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user