Add extra pings to reduce problems with unreasonably slow adb commands

This commit is contained in:
baldurk
2023-07-31 17:08:57 +01:00
parent 3d8ad35e9f
commit 26c673675e
+7
View File
@@ -669,8 +669,15 @@ struct AndroidRemoteServer : public RemoteServer
}
}
// Android is a completely garbage platform, and the command below can take several orders of
// magnitude more time than is reasonable and hit the remote server timeout. To give the best
// chance of that not happening, we ping before and after running it.
RemoteServer::Ping();
adbStdout = Android::adbExecCommand(m_deviceID, "shell dumpsys package").strStdout;
RemoteServer::Ping();
split(adbStdout, lines, '\n');
for(rdcstr &line : lines)
while(!line.empty() && isspace(line.back()))