Prepare the main looper earlier

The looper must be initialized before listing apps, to avoid the
following error:

> Can't create handler inside thread that has not called
> Looper.prepare()

Refs 283326b2f6
Fixes #6165 <https://github.com/Genymobile/scrcpy/issues/6165>
This commit is contained in:
Romain Vimont 2025-06-17 21:02:41 +02:00
commit 98d30288f7

View file

@ -97,7 +97,6 @@ public final class Server {
boolean audio = options.getAudio();
boolean sendDummyByte = options.getSendDummyByte();
prepareMainLooper();
Workarounds.apply();
List<AsyncProcessor> asyncProcessors = new ArrayList<>();
@ -230,6 +229,8 @@ public final class Server {
Ln.e("Exception on thread " + t, e);
});
prepareMainLooper();
Options options = Options.parse(args);
Ln.disableSystemStreams();