@Override public DeviceState getState() { return device.getState(); }
/** * Returns the state of the device. */ @Override public DeviceState getState() { return device.getState(); }
@Nullable @Override public IDevice.DeviceState getState() { return iDevice.getState(); }
@Nullable @Override public IDevice.DeviceState getState() { return iDevice.getState(); }
@NonNull public static DeviceListComparisonResult compare(@NonNull List<? extends IDevice> previous, @NonNull List<? extends IDevice> current) { current = Lists.newArrayList(current); final Map<IDevice,DeviceState> updated = Maps.newHashMapWithExpectedSize(current.size()); final List<IDevice> added = Lists.newArrayListWithExpectedSize(1); final List<IDevice> removed = Lists.newArrayListWithExpectedSize(1); for (IDevice device : previous) { IDevice currentDevice = find(current, device); if (currentDevice != null) { if (currentDevice.getState() != device.getState()) { updated.put(device, currentDevice.getState()); } current.remove(currentDevice); } else { removed.add(device); } } added.addAll(current); return new DeviceListComparisonResult(updated, added, removed); }
public ScreenImage getScreenImage() { try { RawImage rawImage = target.getScreenshot(); if (rawImage == null) return null; setState(target.getState()); return new ScreenImage(rawImage); } catch (IOException e) { setState(ConnectionState.error); log.error("Failed to get screenshot: " + e); } catch (TimeoutException e) { setState(ConnectionState.timeout); log.warn("Got timeout"); } catch (AdbCommandRejectedException e) { setState(ConnectionState.rejected); log.error("ADB command rejected: OFFLINE=" + e.isDeviceOffline()); } return null; }
if (device.getState() == IDevice.DeviceState.ONLINE) { localDevices.add(new ConnectedDevice(device)); } else { iLogger.info( "Skipping device '%s' (%s): Device is %s%s.", device.getName(), device.getSerialNumber(), device.getState(), device.getState() == IDevice.DeviceState.UNAUTHORIZED ? ",\n" + " see http://d.android.com/tools/help/adb.html#Enabling" : "");
if (device.getState() == IDevice.DeviceState.ONLINE) { localDevices.add(new ConnectedDevice(device, iLogger, timeOut, timeOutUnit)); } else { iLogger.info( "Skipping device '%s' (%s): Device is %s%s.", device.getName(), device.getSerialNumber(), device.getState(), device.getState() == IDevice.DeviceState.UNAUTHORIZED ? ",\n" + " see http://d.android.com/tools/help/adb.html#Enabling" : "");