mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-19 19:15:08 +00:00
Do not create UHID thread if not used
The HandlerThread is used only via the looper queue.
This commit is contained in:
parent
dd47cefa47
commit
523f939532
1 changed files with 2 additions and 2 deletions
|
@ -33,13 +33,13 @@ public final class UhidManager {
|
|||
private final ByteBuffer buffer = ByteBuffer.allocate(SIZE_OF_UHID_EVENT).order(ByteOrder.nativeOrder());
|
||||
|
||||
private final DeviceMessageSender sender;
|
||||
private final HandlerThread thread = new HandlerThread("UHidManager");
|
||||
private final MessageQueue queue;
|
||||
|
||||
public UhidManager(DeviceMessageSender sender) {
|
||||
this.sender = sender;
|
||||
thread.start();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
HandlerThread thread = new HandlerThread("UHidManager");
|
||||
thread.start();
|
||||
queue = thread.getLooper().getQueue();
|
||||
} else {
|
||||
queue = null;
|
||||
|
|
Loading…
Add table
Reference in a new issue