Chromium Code Reviews| Index: build/android/pylib/android_commands.py |
| diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py |
| index 76c7076bcca05fb7e1201ba9fd39e5a8eb0cdf14..5048049a0d80d3d343c5a610e9283145eaa0a585 100644 |
| --- a/build/android/pylib/android_commands.py |
| +++ b/build/android/pylib/android_commands.py |
| @@ -408,7 +408,7 @@ class AndroidCommands(object): |
| retry_count=0) |
| def ManagedInstall(self, apk_path, keep_data=False, package_name=None, |
| - reboots_on_failure=2): |
| + reboots_on_timeout=2): |
| """Installs specified package and reboots device on timeouts. |
| If package_name is supplied, checks if the package is already installed and |
| @@ -419,7 +419,7 @@ class AndroidCommands(object): |
| keep_data: Reinstalls instead of uninstalling first, preserving the |
| application data. |
| package_name: Package name (only needed if keep_data=False). |
| - reboots_on_failure: number of time to reboot if package manager is frozen. |
| + reboots_on_timeout: number of time to reboot if package manager is frozen. |
| """ |
| # Check if package is already installed and up to date. |
| if package_name: |
| @@ -430,7 +430,7 @@ class AndroidCommands(object): |
| package_name) |
| return |
| # Install. |
| - reboots_left = reboots_on_failure |
| + reboots_left = reboots_on_timeout |
| while True: |
| try: |
| if not keep_data: |
| @@ -439,17 +439,19 @@ class AndroidCommands(object): |
| install_status = self.Install(apk_path, reinstall=keep_data) |
| if 'Success' in install_status: |
| return |
| + else: |
| + raise Exception('Install failure: ' + install_status) |
|
frankf
2013/09/10 22:29:11
nit: use string formatting
'Install failure: %s'
no sievers
2013/09/11 00:21:58
Done.
|
| except errors.WaitForResponseTimedOutError: |
| print '@@@STEP_WARNINGS@@@' |
| logging.info('Timeout on installing %s on device %s', apk_path, |
| self._device) |
| - if reboots_left <= 0: |
| - raise Exception('Install failure') |
| + if reboots_left <= 0: |
| + raise Exception('Install failure') |
|
frankf
2013/09/10 22:29:11
Let's make this more specific: 'Install timed out'
no sievers
2013/09/11 00:21:58
Done.
|
| - # Force a hard reboot on last attempt |
| - self.Reboot(full_reboot=(reboots_left == 1)) |
| - reboots_left -= 1 |
| + # Force a hard reboot on last attempt |
| + self.Reboot(full_reboot=(reboots_left == 1)) |
| + reboots_left -= 1 |
| def MakeSystemFolderWritable(self): |
| """Remounts the /system folder rw.""" |