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

Commit a9e81c1d authored by Jay Aliomer's avatar Jay Aliomer
Browse files

Imporove screen audio recorder logs and code

Bugs: 169492619
Test: manual
Change-Id: Ic862f102a76b25eccec2653a9955075d402563ed
parent 40388abe
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ public class ScreenInternalAudioRecorder {
    private long mTotalBytes;
    private MediaMuxer mMuxer;
    private boolean mMic;
    private boolean mStarted;

    private int mTrackId = -1;

@@ -263,10 +264,14 @@ public class ScreenInternalAudioRecorder {
    * start recording
     * @throws IllegalStateException if recording fails to initialize
    */
    public void start() throws IllegalStateException {
        if (mThread != null) {
            Log.e(TAG, "a recording is being done in parallel or stop is not called");
    public synchronized void start() throws IllegalStateException {
        if (mStarted) {
            if (mThread == null) {
                throw new IllegalStateException("Recording stopped and can't restart (single use)");
            }
            throw new IllegalStateException("Recording already started");
        }
        mStarted = true;
        mAudioRecord.startRecording();
        if (mMic) mAudioRecordMic.startRecording();
        Log.d(TAG, "channel count " + mAudioRecord.getChannelCount());