Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7655ab93 authored by Christian Göllner's avatar Christian Göllner Committed by Android (Google) Code Review
Browse files

Merge "Partial screen sharing: show error notif when screen recording fails" into udc-dev

parents e349b03d 588bfe05
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -427,6 +427,7 @@ public class RecordingService extends Service implements ScreenMediaRecorderList
                Log.e(TAG, "stopRecording called, but there was an error when ending"
                        + "recording");
                exception.printStackTrace();
                createErrorNotification();
            } catch (Throwable throwable) {
                // Something unexpected happen, SystemUI will crash but let's delete
                // the temporary files anyway
+11 −0
Original line number Diff line number Diff line
@@ -203,6 +203,17 @@ public class RecordingServiceTest extends SysuiTestCase {
        verify(mScreenMediaRecorder).release();
    }

    @Test
    public void testOnSystemRequestedStop_recorderEndThrowsRuntimeException_showsErrorNotification()
            throws IOException {
        doReturn(true).when(mController).isRecording();
        doThrow(new RuntimeException()).when(mScreenMediaRecorder).end();

        mRecordingService.onStopped();

        verify(mRecordingService).createErrorNotification();
    }

    @Test
    public void testOnSystemRequestedStop_recorderEndThrowsOOMError_releasesRecording()
            throws IOException {