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

Unified Diff: build/android/pylib/device/device_utils.py

Issue 1325893002: Defer running of install_commands.Installed() until necessary (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@device2
Patch Set: single check Created 5 years, 4 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
Index: build/android/pylib/device/device_utils.py
diff --git a/build/android/pylib/device/device_utils.py b/build/android/pylib/device/device_utils.py
index 3ee69401378df6f66cb541e0e6b752dca424671a..1faa98e81b4e527659744834c235af704e7a8523 100644
--- a/build/android/pylib/device/device_utils.py
+++ b/build/android/pylib/device/device_utils.py
@@ -1145,12 +1145,10 @@ class DeviceUtils(object):
len(host_device_tuples), dir_file_count, dir_size, False)
zip_duration = self._ApproximateDuration(1, 1, size, True)
- self._InstallCommands()
-
if dir_push_duration < push_duration and (
- dir_push_duration < zip_duration or not self._commands_installed):
+ dir_push_duration < zip_duration or not self._MaybeInstallCommands()):
self._PushChangedFilesIndividually(host_device_tuples)
- elif push_duration < zip_duration or not self._commands_installed:
+ elif push_duration < zip_duration or not self._MaybeInstallCommands():
self._PushChangedFilesIndividually(files)
else:
self._PushChangedFilesZipped(files)
@@ -1158,7 +1156,7 @@ class DeviceUtils(object):
['chmod', '-R', '777'] + [d for _, d in host_device_tuples],
as_root=True, check_return=True)
- def _InstallCommands(self):
+ def _MaybeInstallCommands(self):
if self._commands_installed is None:
try:
if not install_commands.Installed(self):
@@ -1167,6 +1165,7 @@ class DeviceUtils(object):
except Exception as e:
logging.warning('unzip not available: %s' % str(e))
self._commands_installed = False
+ return self._commands_installed
@staticmethod
def _ApproximateDuration(adb_calls, file_count, byte_count, is_zipping):

Powered by Google App Engine
This is Rietveld 408576698