Prevent stalled adb connections to Micrdroid
Issue an adb disconnect request to a potentially stalled adb connection
with the guest. We noticed that after the host sets up forwarding the
adb connection we may end up in a stalled state if we reboot the device.
Bug: 236621823
Test: atest AVFHostTestCase
Change-Id: I9047af9dc3f57e277c469ecb40ba195fb7157546
diff --git a/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java b/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java
index 0b67719..2df829c 100644
--- a/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java
+++ b/tests/hostside/helper/java/com/android/microdroid/test/host/MicrodroidHostTestCaseBase.java
@@ -387,6 +387,9 @@
long timeoutMillis = MICRODROID_ADB_CONNECT_TIMEOUT_MINUTES * 60 * 1000;
long elapsed = 0;
+ // In case there is a stale connection...
+ tryRunOnHost("adb", "disconnect", MICRODROID_SERIAL);
+
final String serial = androidDevice.getSerialNumber();
final String from = "tcp:" + TEST_VM_ADB_PORT;
final String to = "vsock:" + cid + ":5555";