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

Commit 67c21fd4 authored by Lucchetto's avatar Lucchetto Committed by Luca Stefani
Browse files

ScreenService: start recording on a background Thread



 * Avoid blocking the main thread which may cause system freeze
   ANR Input dispatching timed out (window's input channel is full)

Signed-off-by: default avatarLucchetto <lucchetto.tie@live.com>
Signed-off-by: default avatarLuca Stefani <luca.stefani.ge1@gmail.com>
Change-Id: I1be5d166ae70b52e21e6acf7826c0b553ca07ab0
parent 5c17bfef
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -47,8 +47,8 @@ import androidx.core.app.NotificationCompat;

import org.lineageos.recorder.R;
import org.lineageos.recorder.RecorderActivity;
import org.lineageos.recorder.utils.MediaProviderHelper;
import org.lineageos.recorder.utils.LastRecordHelper;
import org.lineageos.recorder.utils.MediaProviderHelper;
import org.lineageos.recorder.utils.Utils;

import java.io.File;
@@ -231,7 +231,7 @@ public class ScreencastService extends Service implements MediaProviderHelper.On
        Intent data = intent.getParcelableExtra(EXTRA_DATA);
        if (data != null) {
            mMediaProjection = mMediaProjectionManager.getMediaProjection(resultCode, data);
            startRecording();
            new Thread(this::startRecording).start();
        }
        return START_STICKY;
    }