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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 """ | 347 """ |
348 reboots_left = reboots_on_failure | 348 reboots_left = reboots_on_failure |
349 while True: | 349 while True: |
350 try: | 350 try: |
351 if not keep_data: | 351 if not keep_data: |
352 self.Uninstall(package_name) | 352 self.Uninstall(package_name) |
353 install_status = self.Install(apk_path, keep_data) | 353 install_status = self.Install(apk_path, keep_data) |
354 if 'Success' in install_status: | 354 if 'Success' in install_status: |
355 return install_status | 355 return install_status |
356 except errors.WaitForResponseTimedOutError: | 356 except errors.WaitForResponseTimedOutError: |
357 logging.info('Timout on installing %s' % apk_path) | 357 print '@@@STEP_WARNINGS@@@' |
| 358 logging.info('Timeout on installing %s' % apk_path) |
358 | 359 |
359 if reboots_left <= 0: | 360 if reboots_left <= 0: |
360 raise Exception('Install failure') | 361 raise Exception('Install failure') |
361 | 362 |
362 # Force a hard reboot on last attempt | 363 # Force a hard reboot on last attempt |
363 self.Reboot(full_reboot=(reboots_left == 1)) | 364 self.Reboot(full_reboot=(reboots_left == 1)) |
364 reboots_left -= 1 | 365 reboots_left -= 1 |
365 | 366 |
366 def MakeSystemFolderWritable(self): | 367 def MakeSystemFolderWritable(self): |
367 """Remounts the /system folder rw.""" | 368 """Remounts the /system folder rw.""" |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 if len(process_results) <= 8: | 985 if len(process_results) <= 8: |
985 continue | 986 continue |
986 # Column 0 is the executable name | 987 # Column 0 is the executable name |
987 # Column 1 is the pid | 988 # Column 1 is the pid |
988 # Column 8 is the Inode in use | 989 # Column 8 is the Inode in use |
989 if process_results[8] == socket_name: | 990 if process_results[8] == socket_name: |
990 pids.append((int(process_results[1]), process_results[0])) | 991 pids.append((int(process_results[1]), process_results[0])) |
991 break | 992 break |
992 logging.info('PidsUsingDevicePort: %s', pids) | 993 logging.info('PidsUsingDevicePort: %s', pids) |
993 return pids | 994 return pids |
OLD | NEW |