Loading packages/SystemUI/src/com/android/systemui/screenrecord/RecordingService.java +1 −0 Original line number Diff line number Diff line Loading @@ -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 Loading packages/SystemUI/tests/src/com/android/systemui/screenrecord/RecordingServiceTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -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 { Loading Loading
packages/SystemUI/src/com/android/systemui/screenrecord/RecordingService.java +1 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
packages/SystemUI/tests/src/com/android/systemui/screenrecord/RecordingServiceTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -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 { Loading