Home | History | Annotate | Download | only in cts

Lines Matching refs:device

37     /** Time to wait after device reports that boot is complete. */
42 /** This is used during device restart for blocking until the device has been reconnected. */
73 * @param num the number of required device
86 throw new DeviceNotAvailableException("The number of connected device("
101 + num + ") of idle device(s).");
109 * @return The device list.
131 * Append the device to the device list.
133 * @param device The device to be appended to the device list.
135 private void appendDevice(final IDevice device) {
136 if (-1 == getDeviceIndex(device)) {
137 TestDevice td = new TestDevice(device);
145 * @param device The device to be removed from the device list.
147 private void removeDevice(final IDevice device) {
148 int index = getDeviceIndex(device);
150 Log.d("Can't find " + device + " in device list of DeviceManager");
158 * Get the index of the specified device in the device array.
160 * @param device The device to be found.
161 * @return The index of the device if it exists; else -1.
163 private int getDeviceIndex(final IDevice device) {
168 if (td.getSerialNumber().equals(device.getSerialNumber())) {
178 * @param deviceSerialNumber The serial number of the device to be found.
179 * @return The test device, if it exists, otherwise null.
191 public void deviceChanged(IDevice device, int changeMask) {
192 Log.d("device " + device.getSerialNumber() + " changed with changeMask=" + changeMask);
193 Log.d("Device state:" + device.getState());
197 public void deviceConnected(IDevice device) {
198 new DeviceServiceMonitor(device).start();
204 * the sync service isn't null and device's build values are collected
205 * before appending device.
210 public DeviceServiceMonitor(IDevice device) {
211 mDevice = device;
224 CUIOutputStream.println("Device(" + mDevice + ") connected");
232 // FIXME: handle failed connection to device.
238 public void deviceDisconnected(IDevice device) {
239 removeDevice(device);
243 * Allocate device by specified Id for testing.
244 * @param deviceId the ID of the test device.
245 * @return a {@link TestDevice} if the specified device is free.
251 String msg = "The specifed device(" + deviceId + ") is " +
258 throw new DeviceNotAvailableException("The specified device(" +
265 * @param device of the specified {@link TestDevice}
267 public void resetTestDevice(final TestDevice device) {
268 if (device.getStatus() != TestDevice.STATUS_OFFLINE) {
269 device.setStatus(TestDevice.STATUS_IDLE);
281 Log.i("Restarting device ...");
290 * Reboot the device.
299 // try to reboot the device using the command line adb
304 // TODO: this is flaky, no guarantee device has actually rebooted, host should wait till
305 // device goes offline
313 // kill the server while the device is rebooting
316 // Reset the device counter semaphore. We will wait below until at least one device
319 // device is added.
325 // wait until at least one device has been added
327 TestDevice device = searchTestDevice(deviceSerialNumber);
328 if (device != null) {
329 ts.setTestDevice(device);
331 deviceConnected = device.waitForBootComplete();
344 if (newDevice != device) {