Index: tools/telemetry/telemetry/core/platform/power_monitor/android_temperature_monitor.py |
diff --git a/tools/telemetry/telemetry/core/platform/power_monitor/android_temperature_monitor.py b/tools/telemetry/telemetry/core/platform/power_monitor/android_temperature_monitor.py |
index 2b61e6287781a0245ea10eb285ffe3e3a43d05e3..fa56bab3c33b7a7c6dc900b50d8a91f8795fe426 100644 |
--- a/tools/telemetry/telemetry/core/platform/power_monitor/android_temperature_monitor.py |
+++ b/tools/telemetry/telemetry/core/platform/power_monitor/android_temperature_monitor.py |
@@ -2,15 +2,7 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
-from telemetry.core import util |
-from telemetry.core.platform import power_monitor |
- |
-util.AddDirToPythonPath(util.GetChromiumSrcDir(), 'build', 'android') |
-try: |
- from pylib.device import device_errors # pylint: disable=F0401 |
-except ImportError: |
- device_errors = None |
- |
+import telemetry.core.platform.power_monitor as power_monitor |
_TEMPERATURE_FILE = '/sys/class/thermal/thermal_zone0/temp' |
@@ -65,8 +57,7 @@ |
return power_data |
def _GetBoardTemperatureCelsius(self): |
- try: |
- contents = self._device.ReadFile(_TEMPERATURE_FILE) |
- return float(contents) if contents else None |
- except device_errors.CommandFailedError: |
- return None |
+ contents = self._device.ReadFile(_TEMPERATURE_FILE) |
+ if len(contents) > 0: |
+ return float(contents[0]) |
+ return None |