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

Commit ff8ad3a3 authored by emancebo's avatar emancebo Committed by Abhisek Devkota
Browse files

update call recording file format

Change-Id: I0534c1da11d946a078febc5efade8beb8d3dface
parent 570a0bf4
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ public class CallRecorderService extends Service {

    private static final String AUDIO_SOURCE_PROPERTY = "persist.call_recording.src";

    private SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyyMMddHHmmssSSS");
    private SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyMMdd_HHmmssSSS");

    private int mDefaultEncoder;

@@ -68,7 +68,7 @@ public class CallRecorderService extends Service {
        @Override
        public boolean startRecording(String phoneNumber, long creationTime)
                throws RemoteException {
            String fileName = generateFilename();
            String fileName = generateFilename(phoneNumber);
            mCurrentRecording = new CallRecording(phoneNumber, creationTime,
                    fileName, System.currentTimeMillis());
            return startRecordingInternal(mCurrentRecording.getFile());
@@ -201,13 +201,13 @@ public class CallRecorderService extends Service {
        return mState;
    }

    private String generateFilename() {
    private String generateFilename(String number) {
        String timestamp = DATE_FORMAT.format(new Date());
        int audioFormat = getAudioFormat();
        if (audioFormat == MediaRecorder.OutputFormat.AMR_WB){
            return "callrecorder_" + timestamp + ".amr";
            return number + "_" + timestamp + ".amr";
        } else {
            return "callrecorder_" + timestamp + ".m4a ";
            return number + "_" + timestamp + ".m4a ";
        }
    }