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): |