refactoring

This commit is contained in:
Giemsa 2016-10-24 00:36:56 +09:00 committed by Samuel Carlsson
parent 76c9045b0c
commit af7b8ec5ab

View File

@ -48,23 +48,23 @@ public class JadbConnection implements ITransportFactory {
new Thread(new Runnable() { new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
try try {
{
devices.send("host:track-devices"); devices.send("host:track-devices");
devices.verifyResponse(); devices.verifyResponse();
boolean r = false; boolean r = false;
do { do {
List<JadbDevice> list = parseDevices(devices.readString()); List<JadbDevice> list = parseDevices(devices.readString());
r = listener.detect(list); r = listener.detect(list);
} while(r); } while (r);
} catch(SocketException e) { } catch (SocketException e) {
// socket closed from another thread // socket closed from another thread
} catch(Exception e) { } catch (Exception e) {
Thread t = Thread.currentThread(); Thread t = Thread.currentThread();
t.getUncaughtExceptionHandler().uncaughtException(t, e); t.getUncaughtExceptionHandler().uncaughtException(t, e);
} }
} }
}).start(); }).start();
return new DeviceDetectionHandler(devices); return new DeviceDetectionHandler(devices);
} }