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

Side by Side Diff: telemetry/telemetry/internal/platform/android_platform_backend.py

Issue 2980863004: [Telemetry] Assert that android devices are rooted when running telemetry. (Closed)
Patch Set: Rebase Created 3 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging 5 import logging
6 import os 6 import os
7 import posixpath 7 import posixpath
8 import re 8 import re
9 import subprocess 9 import subprocess
10 import tempfile 10 import tempfile
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 assert device, ( 71 assert device, (
72 'AndroidPlatformBackend can only be initialized from remote device') 72 'AndroidPlatformBackend can only be initialized from remote device')
73 super(AndroidPlatformBackend, self).__init__(device) 73 super(AndroidPlatformBackend, self).__init__(device)
74 self._device = device_utils.DeviceUtils(device.device_id) 74 self._device = device_utils.DeviceUtils(device.device_id)
75 # Trying to root the device, if possible. 75 # Trying to root the device, if possible.
76 if not self._device.HasRoot(): 76 if not self._device.HasRoot():
77 try: 77 try:
78 self._device.EnableRoot() 78 self._device.EnableRoot()
79 except device_errors.CommandFailedError: 79 except device_errors.CommandFailedError:
80 logging.warning('Unable to root %s', str(self._device)) 80 logging.warning('Unable to root %s', str(self._device))
81 assert self._device.HasRoot(), (
82 'Android device must be rooted to run Telemetry')
81 self._battery = battery_utils.BatteryUtils(self._device) 83 self._battery = battery_utils.BatteryUtils(self._device)
82 self._enable_performance_mode = device.enable_performance_mode 84 self._enable_performance_mode = device.enable_performance_mode
83 self._surface_stats_collector = None 85 self._surface_stats_collector = None
84 self._perf_tests_setup = perf_control.PerfControl(self._device) 86 self._perf_tests_setup = perf_control.PerfControl(self._device)
85 self._thermal_throttle = thermal_throttle.ThermalThrottle(self._device) 87 self._thermal_throttle = thermal_throttle.ThermalThrottle(self._device)
86 self._raw_display_frame_rate_measurements = [] 88 self._raw_display_frame_rate_measurements = []
87 self._can_elevate_privilege = ( 89 self._can_elevate_privilege = (
88 self._device.HasRoot() or self._device.NeedsSU()) 90 self._device.HasRoot() or self._device.NeedsSU())
89 self._device_copy_script = None 91 self._device_copy_script = None
90 self._power_monitor = ( 92 self._power_monitor = (
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 for process in psutil.process_iter(): 843 for process in psutil.process_iter():
842 try: 844 try:
843 if psutil.version_info >= (2, 0): 845 if psutil.version_info >= (2, 0):
844 if 'adb' in process.name(): 846 if 'adb' in process.name():
845 process.cpu_affinity([0]) 847 process.cpu_affinity([0])
846 else: 848 else:
847 if 'adb' in process.name: 849 if 'adb' in process.name:
848 process.set_cpu_affinity([0]) 850 process.set_cpu_affinity([0])
849 except (psutil.NoSuchProcess, psutil.AccessDenied): 851 except (psutil.NoSuchProcess, psutil.AccessDenied):
850 logging.warn('Failed to set adb process CPU affinity') 852 logging.warn('Failed to set adb process CPU affinity')
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698