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

Side by Side Diff: tools/telemetry/telemetry/core/platform/power_monitor/android_temperature_monitor.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, 5 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
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 telemetry.core.platform.power_monitor as power_monitor 5 import telemetry.core.platform.power_monitor as power_monitor
6 6
7 7
8 _TEMPERATURE_FILE = '/sys/class/thermal/thermal_zone0/temp' 8 _TEMPERATURE_FILE = '/sys/class/thermal/thermal_zone0/temp'
9 9
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 for path_element in temperature_path[:-1]: 51 for path_element in temperature_path[:-1]:
52 if not path_element in temperature_insertion_point: 52 if not path_element in temperature_insertion_point:
53 temperature_insertion_point[path_element] = {} 53 temperature_insertion_point[path_element] = {}
54 temperature_insertion_point = temperature_insertion_point[path_element] 54 temperature_insertion_point = temperature_insertion_point[path_element]
55 assert temperature_path[-1] not in temperature_insertion_point 55 assert temperature_path[-1] not in temperature_insertion_point
56 temperature_insertion_point[temperature_path[-1]] = average_temperature 56 temperature_insertion_point[temperature_path[-1]] = average_temperature
57 57
58 return power_data 58 return power_data
59 59
60 def _GetBoardTemperatureCelsius(self): 60 def _GetBoardTemperatureCelsius(self):
61 contents = self._device.old_interface.GetFileContents(_TEMPERATURE_FILE) 61 contents = self._device.ReadFile(_TEMPERATURE_FILE)
62 if len(contents) > 0: 62 if len(contents) > 0:
63 return float(contents[0]) 63 return float(contents[0])
64 return None 64 return None
65 65
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698