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

Unified Diff: build/android/pylib/perf/perf_control.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/perf/cache_control.py ('k') | build/android/pylib/perf/perf_control_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/perf/perf_control.py
diff --git a/build/android/pylib/perf/perf_control.py b/build/android/pylib/perf/perf_control.py
index 0b32dd8089560583df8563e796fa79c31b3430ec..03c20bdc696dc06addaf268f520e20347eafa64d 100644
--- a/build/android/pylib/perf/perf_control.py
+++ b/build/android/pylib/perf/perf_control.py
@@ -25,8 +25,7 @@ class PerfControl(object):
self._num_cpu_cores = len(cpu_files)
assert self._num_cpu_cores > 0, 'Failed to detect CPUs.'
logging.info('Number of CPUs: %d', self._num_cpu_cores)
- self._have_mpdecision = self._device.old_interface.FileExistsOnDevice(
- '/system/bin/mpdecision')
+ self._have_mpdecision = self._device.FileExists('/system/bin/mpdecision')
def SetHighPerfMode(self):
# TODO(epenner): Enable on all devices (http://crbug.com/383566)
@@ -61,16 +60,15 @@ class PerfControl(object):
def _SetScalingGovernorInternal(self, value):
for cpu in range(self._num_cpu_cores):
scaling_governor_file = PerfControl._SCALING_GOVERNOR_FMT % cpu
- if self._device.old_interface.FileExistsOnDevice(scaling_governor_file):
+ if self._device.FileExists(scaling_governor_file):
logging.info('Writing scaling governor mode \'%s\' -> %s',
value, scaling_governor_file)
- self._device.old_interface.SetProtectedFileContents(
- scaling_governor_file, value)
+ self._device.WriteFile(scaling_governor_file, value, as_root=True)
def _AllCpusAreOnline(self):
for cpu in range(self._num_cpu_cores):
online_path = PerfControl._CPU_ONLINE_FMT % cpu
- if self._device.old_interface.GetFileContents(online_path)[0] == '0':
+ if self._device.ReadFile(online_path)[0] == '0':
return False
return True
@@ -100,5 +98,4 @@ class PerfControl(object):
for cpu in range(self._num_cpu_cores):
online_path = PerfControl._CPU_ONLINE_FMT % cpu
- self._device.old_interface.SetProtectedFileContents(
- online_path, '1')
+ self._device.WriteFile(online_path, '1', as_root=True)
« no previous file with comments | « build/android/pylib/perf/cache_control.py ('k') | build/android/pylib/perf/perf_control_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698