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

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

Issue 796663002: Update from https://crrev.com/307758 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Updates for SkCanvas::NewRaster deprecation Created 6 years 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 | « base/tuple.h ('k') | build/android/pylib/device/device_utils_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 553e9602ffc0a9ebfba319bea746fc460e86b605..1624cccb7596f03d990373e894c233b8576674c6 100644
--- a/build/android/pylib/device/device_utils.py
+++ b/build/android/pylib/device/device_utils.py
@@ -918,7 +918,7 @@ class DeviceUtils(object):
host_temp.write(contents)
host_temp.flush()
if as_root and self.NeedsSU():
- with device_temp_file.DeviceTempFile(self) as device_temp:
+ with device_temp_file.DeviceTempFile(self.adb) as device_temp:
self.adb.Push(host_temp.name, device_temp.name)
# Here we need 'cp' rather than 'mv' because the temp and
# destination files might be on different file systems (e.g.
@@ -1173,8 +1173,8 @@ class DeviceUtils(object):
"""Returns the device serial."""
return self.adb.GetDeviceSerial()
- @staticmethod
- def parallel(devices=None, async=False):
+ @classmethod
+ def parallel(cls, devices=None, async=False):
"""Creates a Parallelizer to operate over the provided list of devices.
If |devices| is either |None| or an empty list, the Parallelizer will
@@ -1190,10 +1190,10 @@ class DeviceUtils(object):
Returns:
A Parallelizer operating over |devices|.
"""
- if not devices or len(devices) == 0:
- devices = pylib.android_commands.GetAttachedDevices()
- parallelizer_type = (parallelizer.Parallelizer if async
- else parallelizer.SyncParallelizer)
- return parallelizer_type([
- d if isinstance(d, DeviceUtils) else DeviceUtils(d)
- for d in devices])
+ if not devices:
+ devices = adb_wrapper.AdbWrapper.GetDevices()
+ devices = [d if isinstance(d, cls) else cls(d) for d in devices]
+ if async:
+ return parallelizer.Parallelizer(devices)
+ else:
+ return parallelizer.SyncParallelizer(devices)
« no previous file with comments | « base/tuple.h ('k') | build/android/pylib/device/device_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698