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

Unified Diff: telemetry/third_party/webpagereplay/adb_install_cert.py

Issue 1790563002: [Telemetry] Roll web-page-replay to the lastest commit (Closed) Base URL: https://github.com/catapult-project/catapult@master
Patch Set: Created 4 years, 9 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: telemetry/third_party/webpagereplay/adb_install_cert.py
diff --git a/telemetry/third_party/webpagereplay/adb_install_cert.py b/telemetry/third_party/webpagereplay/adb_install_cert.py
index 4f311b043b7f0088650ec1bc79a5dbaf63c07b24..0c41452d4a030229f2d40303e1488f9e249654b8 100644
--- a/telemetry/third_party/webpagereplay/adb_install_cert.py
+++ b/telemetry/third_party/webpagereplay/adb_install_cert.py
@@ -23,13 +23,19 @@ import sys
KEYCODE_ENTER = '66'
KEYCODE_TAB = '61'
+
class CertInstallError(Exception):
pass
+
class CertRemovalError(Exception):
pass
+
+_ANDROID_M_BUILD_VERSION = 23
+
+
class AndroidCertInstaller(object):
"""Certificate installer for phones with KitKat."""
@@ -58,7 +64,11 @@ class AndroidCertInstaller(object):
def _adb_su_shell(self, *args):
"""Runs command as root."""
- cmd = ['shell', 'su', '-c']
+ build_version_sdk = int(self._get_property('ro.build.version.sdk'))
+ if build_version_sdk >= _ANDROID_M_BUILD_VERSION:
+ cmd = ['shell', 'su', '0']
+ else:
+ cmd = ['shell', 'su', '-c']
cmd.extend(args)
return self._adb(*cmd)
« no previous file with comments | « telemetry/third_party/webpagereplay/README.md ('k') | telemetry/third_party/webpagereplay/third_party/ipfw_win32/README.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698