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

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

Issue 2419073003: [Telemetry] Kill stray adb processes before gathering device list (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/platform/android_device.py
diff --git a/telemetry/telemetry/internal/platform/android_device.py b/telemetry/telemetry/internal/platform/android_device.py
index d99caedf82c151f9e930a325da9a1daa4a977939..f0eb82d361d1bd80fe319473e43811e1772da58e 100644
--- a/telemetry/telemetry/internal/platform/android_device.py
+++ b/telemetry/telemetry/internal/platform/android_device.py
@@ -4,6 +4,7 @@
import logging
import os
+import subprocess
from telemetry.core import util
from telemetry.internal.platform import cros_device
@@ -16,6 +17,11 @@ from devil.android import device_utils
from devil.android.sdk import adb_wrapper
+def _KillStrayADBProcesses():
+ p = subprocess.Popen(['killall', 'adb'])
+ p.communicate()
+
+
class AndroidDevice(device.Device):
""" Class represents information for connecting to an android device.
@@ -34,6 +40,7 @@ class AndroidDevice(device.Device):
@classmethod
def GetAllConnectedDevices(cls, blacklist):
+ _KillStrayADBProcesses()
device_serials = GetDeviceSerials(blacklist)
return [cls(s) for s in device_serials]
« 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