Ensure WAIT packet upon HELO in --suspend mode

Upon suspending the app, we don't set mWaiting like we do in
waitingForDebugger. This is an error because this state is checked
upon handling HELO in DdmHandleHello chunk handler.

Mimicking what is done in waitingForDebugger ensure that WAIT is
sent and DDM client receive the event.

Bug: 266232837
Test: Manual
Change-Id: I3b8bc9af6f017f3a16c33ac38df7a9248c939a1a
This commit is contained in:
Fabien Sanglard
2023-01-20 19:31:00 +00:00
parent ac92461dbe
commit 0801a618a3

View File

@@ -1006,12 +1006,15 @@ public final class Debug
// been replaced with an implementation that will suspendAll and
// send VM_START.
System.out.println("Waiting for debugger first packet");
mWaiting = true;
while (!isDebuggerConnected()) {
try {
Thread.sleep(100);
} catch (InterruptedException ie) {
}
}
mWaiting = false;
System.out.println("Debug.suspendAllAndSentVmStart");
VMDebug.suspendAllAndSendVmStart();