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

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py

Issue 725553002: Revert of Migrate device utils WriteFile to AdbWrapper (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/device/device_utils_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py b/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
index 130362b29347a61a8e54f3d7af1a83890cfce1e8..3e416736f2a52abb4d358ad960f4ece0af43a0a2 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
@@ -216,6 +216,7 @@
content = ' '.join(QuoteIfNeeded(arg) for arg in args)
cmdline_file = self._backend_settings.GetCommandLineFile(
self._adb.IsUserBuild())
+ as_root = self._adb.device().old_interface.CanAccessProtectedFileContents()
try:
# Save the current command line to restore later, except if it appears to
@@ -225,7 +226,7 @@
self._saved_cmdline = ''.join(self._adb.device().ReadFile(cmdline_file))
if '--host-resolver-rules' in self._saved_cmdline:
self._saved_cmdline = ''
- self._adb.device().WriteFile(cmdline_file, content, as_root=True)
+ self._adb.device().WriteTextFile(cmdline_file, content, as_root=as_root)
except device_errors.CommandFailedError:
logging.critical('Cannot set Chrome command line. '
'Fix this by flashing to a userdebug build.')
@@ -234,8 +235,9 @@
def _RestoreCommandLine(self):
cmdline_file = self._backend_settings.GetCommandLineFile(
self._adb.IsUserBuild())
- self._adb.device().WriteFile(cmdline_file, self._saved_cmdline,
- as_root=True)
+ as_root = self._adb.device().old_interface.CanAccessProtectedFileContents()
+ self._adb.device().WriteTextFile(cmdline_file, self._saved_cmdline,
+ as_root=as_root)
def Start(self):
self._SetUpCommandLine()
« no previous file with comments | « build/android/pylib/device/device_utils_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698