mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-17 05:24:19 +01:00
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:
@@ -97,7 +97,6 @@ public final class Server {
|
|||||||
boolean audio = options.getAudio();
|
boolean audio = options.getAudio();
|
||||||
boolean sendDummyByte = options.getSendDummyByte();
|
boolean sendDummyByte = options.getSendDummyByte();
|
||||||
|
|
||||||
prepareMainLooper();
|
|
||||||
Workarounds.apply();
|
Workarounds.apply();
|
||||||
|
|
||||||
List<AsyncProcessor> asyncProcessors = new ArrayList<>();
|
List<AsyncProcessor> asyncProcessors = new ArrayList<>();
|
||||||
@@ -230,6 +229,8 @@ public final class Server {
|
|||||||
Ln.e("Exception on thread " + t, e);
|
Ln.e("Exception on thread " + t, e);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
prepareMainLooper();
|
||||||
|
|
||||||
Options options = Options.parse(args);
|
Options options = Options.parse(args);
|
||||||
|
|
||||||
Ln.disableSystemStreams();
|
Ln.disableSystemStreams();
|
||||||
|
|||||||
Reference in New Issue
Block a user