[Android] Remove android_commands uses from build/android/. (reland)
original CL: https://codereview.chromium.org/1088793002/
BUG=267773
Review URL: https://codereview.chromium.org/1083403002
Cr-Commit-Position: refs/heads/master@{#325439}
diff --git a/build/android/host_heartbeat.py b/build/android/host_heartbeat.py
index 429fca9a..11421ce7 100755
--- a/build/android/host_heartbeat.py
+++ b/build/android/host_heartbeat.py
@@ -12,7 +12,8 @@
import sys
import time
-from pylib import android_commands
+from pylib.device import adb_wrapper
+from pylib.device import device_filter
from pylib.device import device_utils
PULSE_PERIOD = 20
@@ -20,10 +21,11 @@
def main():
while True:
try:
- devices = android_commands.GetAttachedDevices()
- for device_serial in devices:
- device_utils.DeviceUtils(device_serial).RunShellCommand(
- 'touch /sdcard/host_heartbeat')
+ devices = adb_wrapper.AdbWrapper.Devices(
+ filters=device_filter.DefaultFilters())
+ for d in devices:
+ device_utils.DeviceUtils(d).RunShellCommand(
+ ['touch', '/sdcard/host_heartbeat'], check_return=True)
except:
# Keep the heatbeat running bypassing all errors.
pass