Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2133)

Unified Diff: build/android/pylib/android_commands.py

Issue 23432010: Android: Don't restart/reboot on package install failure (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b92f09ac63b80a80dede7594caea744866869631 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: %s' % install_status)
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 timed out')
- # 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."""
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698