Use JadbDevice.send() where possible

This commit is contained in:
Jano Svitok 2018-08-06 10:24:54 +02:00
parent bad9f11441
commit 1bd60cd946

View File

@ -46,11 +46,9 @@ public class JadbDevice {
private Transport getTransport() throws IOException, JadbException {
Transport transport = transportFactory.createTransport();
if (serial == null) {
transport.send("host:transport-any");
transport.verifyResponse();
send(transport,"host:transport-any");
} else {
transport.send("host:transport:" + serial);
transport.verifyResponse();
send(transport,"host:transport:" + serial);
}
return transport;
}
@ -62,11 +60,9 @@ public class JadbDevice {
public State getState() throws IOException, JadbException {
Transport transport = transportFactory.createTransport();
if (serial == null) {
transport.send("host:get-state");
transport.verifyResponse();
send(transport, "host:get-state");
} else {
transport.send("host-serial:" + serial + ":get-state");
transport.verifyResponse();
send(transport, "host-serial:" + serial + ":get-state");
}
State state = convertState(transport.readString());