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

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

Issue 738413002: [Android] Extract MD5sum logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 | « build/android/pylib/constants.py ('k') | build/android/pylib/instrumentation/test_jar.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 bb09cfadecfec635cbdbb5581f43522060ecbf38..845d5801bf7db51cd7bef8a5919842c8a70d5767 100644
--- a/build/android/pylib/device/device_utils.py
+++ b/build/android/pylib/device/device_utils.py
@@ -26,6 +26,7 @@ from pylib.device.commands import install_commands
from pylib.utils import apk_helper
from pylib.utils import device_temp_file
from pylib.utils import host_utils
+from pylib.utils import md5sum
from pylib.utils import parallelizer
from pylib.utils import timeout_retry
@@ -701,12 +702,13 @@ class DeviceUtils(object):
if not real_device_path:
return [(host_path, device_path)]
- # TODO(jbudorick): Move the md5 logic up into DeviceUtils or base
- # this function on mtime.
- # pylint: disable=protected-access
- host_hash_tuples, device_hash_tuples = self.old_interface._RunMd5Sum(
- real_host_path, real_device_path)
- # pylint: enable=protected-access
+ host_hash_tuples = md5sum.CalculateHostMd5Sums([real_host_path])
+ device_paths_to_md5 = (
+ real_device_path if os.path.isfile(real_host_path)
+ else ('%s/%s' % (real_device_path, os.path.relpath(p, real_host_path))
+ for _, p in host_hash_tuples))
+ device_hash_tuples = md5sum.CalculateDeviceMd5Sums(
+ device_paths_to_md5, self)
if os.path.isfile(host_path):
if (not device_hash_tuples
« no previous file with comments | « build/android/pylib/constants.py ('k') | build/android/pylib/instrumentation/test_jar.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698