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

Side by Side Diff: build/android/pylib/device/device_utils.py

Issue 926643003: [Android] DeviceUtils: Prefer our unzip implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | build/android/pylib/device/device_utils_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 a variety of device interactions based on adb. 5 """Provides a variety of device interactions based on adb.
6 6
7 Eventually, this will be based on adb_wrapper. 7 Eventually, this will be based on adb_wrapper.
8 """ 8 """
9 # pylint: disable=unused-argument 9 # pylint: disable=unused-argument
10 10
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 args=(zip_file.name, files)) 840 args=(zip_file.name, files))
841 zip_proc.start() 841 zip_proc.start()
842 zip_proc.join() 842 zip_proc.join()
843 843
844 zip_on_device = '%s/tmp.zip' % self.GetExternalStoragePath() 844 zip_on_device = '%s/tmp.zip' % self.GetExternalStoragePath()
845 try: 845 try:
846 self.adb.Push(zip_file.name, zip_on_device) 846 self.adb.Push(zip_file.name, zip_on_device)
847 self.RunShellCommand( 847 self.RunShellCommand(
848 ['unzip', zip_on_device], 848 ['unzip', zip_on_device],
849 as_root=True, 849 as_root=True,
850 env={'PATH': '$PATH:%s' % install_commands.BIN_DIR}, 850 env={'PATH': '%s:$PATH' % install_commands.BIN_DIR},
851 check_return=True) 851 check_return=True)
852 finally: 852 finally:
853 if zip_proc.is_alive(): 853 if zip_proc.is_alive():
854 zip_proc.terminate() 854 zip_proc.terminate()
855 if self.IsOnline(): 855 if self.IsOnline():
856 self.RunShellCommand(['rm', zip_on_device], check_return=True) 856 self.RunShellCommand(['rm', zip_on_device], check_return=True)
857 857
858 @staticmethod 858 @staticmethod
859 def _CreateDeviceZip(zip_path, host_device_tuples): 859 def _CreateDeviceZip(zip_path, host_device_tuples):
860 with zipfile.ZipFile(zip_path, 'w') as zip_file: 860 with zipfile.ZipFile(zip_path, 'w') as zip_file:
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 Returns: 1366 Returns:
1367 A Parallelizer operating over |devices|. 1367 A Parallelizer operating over |devices|.
1368 """ 1368 """
1369 if not devices: 1369 if not devices:
1370 devices = adb_wrapper.AdbWrapper.GetDevices() 1370 devices = adb_wrapper.AdbWrapper.GetDevices()
1371 devices = [d if isinstance(d, cls) else cls(d) for d in devices] 1371 devices = [d if isinstance(d, cls) else cls(d) for d in devices]
1372 if async: 1372 if async:
1373 return parallelizer.Parallelizer(devices) 1373 return parallelizer.Parallelizer(devices)
1374 else: 1374 else:
1375 return parallelizer.SyncParallelizer(devices) 1375 return parallelizer.SyncParallelizer(devices)
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/device/device_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698