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

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
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment