summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/services/callrecorder/CallRecorderService.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/services/callrecorder/CallRecorderService.java b/src/com/android/services/callrecorder/CallRecorderService.java
index 7b5602365..455b38430 100644
--- a/src/com/android/services/callrecorder/CallRecorderService.java
+++ b/src/com/android/services/callrecorder/CallRecorderService.java
@@ -169,12 +169,18 @@ public class CallRecorderService extends Service {
return true;
} catch (IOException e) {
Log.w(TAG, "Could not start recording for file " + outputPath, e);
+ Log.w(TAG, "Deleting failed recording " + outputPath);
+ file.delete();
} catch (IllegalStateException e) {
Log.w(TAG, "Could not start recording for file " + outputPath, e);
+ Log.w(TAG, "Deleting failed recording " + outputPath);
+ file.delete();
} catch (RuntimeException e) {
// only catch exceptions thrown by the MediaRecorder JNI code
if (e.getMessage().indexOf("start failed") >= 0) {
Log.w(TAG, "Could not start recording for file " + outputPath, e);
+ Log.w(TAG, "Deleting failed recording " + outputPath);
+ file.delete();
} else {
throw e;
}