From c1d6436a6e372df59eff169926b82ceec568ae47 Mon Sep 17 00:00:00 2001 From: Shen Yao Date: Mon, 11 Mar 2019 11:44:54 +0800 Subject: [PATCH] Remove unnecessary permissionWatchdog 'permissionWatchdog' will lead to auto disconnect after 15 second if device requested permission. It is not necessary! --- .../impl/communication/connection/usb/UsbCDCConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ClientLib/src/main/java/org/droidplanner/services/android/impl/communication/connection/usb/UsbCDCConnection.java b/ClientLib/src/main/java/org/droidplanner/services/android/impl/communication/connection/usb/UsbCDCConnection.java index b75eae65fd..0004a9d32f 100644 --- a/ClientLib/src/main/java/org/droidplanner/services/android/impl/communication/connection/usb/UsbCDCConnection.java +++ b/ClientLib/src/main/java/org/droidplanner/services/android/impl/communication/connection/usb/UsbCDCConnection.java @@ -126,8 +126,8 @@ protected void openUsbConnection(Bundle extras) throws IOException { } else { removeWatchdog(); - scheduler = Executors.newSingleThreadScheduledExecutor(); - scheduler.schedule(permissionWatchdog, 15, TimeUnit.SECONDS); + //scheduler = Executors.newSingleThreadScheduledExecutor(); + //scheduler.schedule(permissionWatchdog, 15, TimeUnit.SECONDS); Log.d(TAG, "Requesting permission to access usb device " + device.getDeviceName()); manager.requestPermission(device, usbPermissionIntent); }