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

Unified Diff: telemetry/telemetry/internal/platform/android_platform_backend.py

Issue 1997633003: [BattOr] Add ability to platform object to detect BattOrs. (Closed) Base URL: git@github.com:catapult-project/catapult@master
Patch Set: Created 4 years, 7 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 | « telemetry/telemetry/core/platform.py ('k') | telemetry/telemetry/internal/platform/platform_backend.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/platform/android_platform_backend.py
diff --git a/telemetry/telemetry/internal/platform/android_platform_backend.py b/telemetry/telemetry/internal/platform/android_platform_backend.py
index 2d3b993466fc287a667758958b66a7b3c6c51f0d..2f037b8ee02b588c972d8dda3a03d94c1b641676 100644
--- a/telemetry/telemetry/internal/platform/android_platform_backend.py
+++ b/telemetry/telemetry/internal/platform/android_platform_backend.py
@@ -8,6 +8,7 @@ import re
import subprocess
import tempfile
+from battor import battor_wrapper
from telemetry.core import android_platform
from telemetry.core import exceptions
from telemetry.core import util
@@ -733,6 +734,12 @@ class AndroidPlatformBackend(
check_return=True)
return self._IsScreenLocked(input_methods)
+ def HasBattOrConnected(self):
+ # str(self.device) is the device id as a string.
+ return battor_wrapper.IsBattOrConnected(self.GetOSName(),
+ android_device=str(self.device))
+
+
def _FixPossibleAdbInstability():
"""Host side workaround for crbug.com/268450 (adb instability).
« no previous file with comments | « telemetry/telemetry/core/platform.py ('k') | telemetry/telemetry/internal/platform/platform_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698