Commit 83c5ba86 authored by jbudorick's avatar jbudorick Committed by Commit bot

[Android] Enable root in perf_control.SetHighPerfMode.

SetHighPerfMode needs root, but it currently only checks to see if
we already have root rather than trying to enable it.

BUG=478104

Review URL: https://codereview.chromium.org/1135393005

Cr-Commit-Position: refs/heads/master@{#329980}
parent 5ad9f1fd
......@@ -6,8 +6,10 @@ import atexit
import logging
from pylib import android_commands
from pylib.device import device_errors
from pylib.device import device_utils
class PerfControl(object):
"""Provides methods for setting the performance mode of a device."""
_CPU_PATH = '/sys/devices/system/cpu'
......@@ -28,7 +30,9 @@ class PerfControl(object):
def SetHighPerfMode(self):
"""Sets the highest stable performance mode for the device."""
if not self._device.HasRoot():
try:
self._device.EnableRoot()
except device_errors.CommandFailedError:
message = 'Need root for performance mode. Results may be NOISY!!'
logging.warning(message)
# Add an additional warning at exit, such that it's clear that any results
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment