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

Unified Diff: build/android/pylib/flag_changer.py

Issue 358993003: [Android] Switch to DeviceUtils versions of file functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « build/android/pylib/device/device_utils_test.py ('k') | build/android/pylib/forwarder.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/flag_changer.py
diff --git a/build/android/pylib/flag_changer.py b/build/android/pylib/flag_changer.py
index c1ce16a5e1e53120f926716ea7e72e478c656292..c0bcadbe3bd4a9a47d2146b8a428d8dc9188d92a 100644
--- a/build/android/pylib/flag_changer.py
+++ b/build/android/pylib/flag_changer.py
@@ -32,8 +32,7 @@ class FlagChanger(object):
self._cmdline_file = cmdline_file
# Save the original flags.
- self._orig_line = self._device.old_interface.GetFileContents(
- self._cmdline_file)
+ self._orig_line = self._device.ReadFile(self._cmdline_file)
if self._orig_line:
self._orig_line = self._orig_line[0].strip()
@@ -102,23 +101,16 @@ class FlagChanger(object):
# The first command line argument doesn't matter as we are not actually
# launching the chrome executable using this command line.
cmd_line = ' '.join(['_'] + self._current_flags)
- if use_root:
- self._device.old_interface.SetProtectedFileContents(
- self._cmdline_file, cmd_line)
- file_contents = self._device.old_interface.GetProtectedFileContents(
- self._cmdline_file)
- else:
- self._device.old_interface.SetFileContents(self._cmdline_file, cmd_line)
- file_contents = self._device.old_interface.GetFileContents(
- self._cmdline_file)
+ self._device.WriteFile(
+ self._cmdline_file, cmd_line, as_root=use_root)
+ file_contents = self._device.ReadFile(
+ self._cmdline_file, as_root=use_root)
assert len(file_contents) == 1 and file_contents[0] == cmd_line, (
'Failed to set the command line file at %s' % self._cmdline_file)
else:
self._device.RunShellCommand('rm ' + self._cmdline_file,
as_root=use_root)
- assert (
- not self._device.old_interface.FileExistsOnDevice(
- self._cmdline_file)), (
+ assert not self._device.FileExists(self._cmdline_file), (
'Failed to remove the command line file at %s' % self._cmdline_file)
@staticmethod
« no previous file with comments | « build/android/pylib/device/device_utils_test.py ('k') | build/android/pylib/forwarder.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698