OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Provides an interface to communicate with the device via the adb command. | 5 """Provides an interface to communicate with the device via the adb command. |
6 | 6 |
7 Assumes adb binary is currently on system path. | 7 Assumes adb binary is currently on system path. |
8 """ | 8 """ |
9 | 9 |
10 import collections | 10 import collections |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 while True: | 379 while True: |
380 try: | 380 try: |
381 if not keep_data: | 381 if not keep_data: |
382 assert package_name | 382 assert package_name |
383 self.Uninstall(package_name) | 383 self.Uninstall(package_name) |
384 install_status = self.Install(apk_path, reinstall=keep_data) | 384 install_status = self.Install(apk_path, reinstall=keep_data) |
385 if 'Success' in install_status: | 385 if 'Success' in install_status: |
386 return install_status | 386 return install_status |
387 except errors.WaitForResponseTimedOutError: | 387 except errors.WaitForResponseTimedOutError: |
388 print '@@@STEP_WARNINGS@@@' | 388 print '@@@STEP_WARNINGS@@@' |
389 logging.info('Timeout on installing %s' % apk_path) | 389 logging.info('Timeout on installing %s on device %s', apk_path, |
| 390 self._device) |
390 | 391 |
391 if reboots_left <= 0: | 392 if reboots_left <= 0: |
392 raise Exception('Install failure') | 393 raise Exception('Install failure') |
393 | 394 |
394 # Force a hard reboot on last attempt | 395 # Force a hard reboot on last attempt |
395 self.Reboot(full_reboot=(reboots_left == 1)) | 396 self.Reboot(full_reboot=(reboots_left == 1)) |
396 reboots_left -= 1 | 397 reboots_left -= 1 |
397 | 398 |
398 def MakeSystemFolderWritable(self): | 399 def MakeSystemFolderWritable(self): |
399 """Remounts the /system folder rw.""" | 400 """Remounts the /system folder rw.""" |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1312 """ | 1313 """ |
1313 def __init__(self, output): | 1314 def __init__(self, output): |
1314 self._output = output | 1315 self._output = output |
1315 | 1316 |
1316 def write(self, data): | 1317 def write(self, data): |
1317 data = data.replace('\r\r\n', '\n') | 1318 data = data.replace('\r\r\n', '\n') |
1318 self._output.write(data) | 1319 self._output.write(data) |
1319 | 1320 |
1320 def flush(self): | 1321 def flush(self): |
1321 self._output.flush() | 1322 self._output.flush() |
OLD | NEW |