From 26c673675eb2df74c9d25beb28cbd9bf3137998b Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 31 Jul 2023 17:08:57 +0100 Subject: [PATCH] Add extra pings to reduce problems with unreasonably slow adb commands --- renderdoc/android/android.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/renderdoc/android/android.cpp b/renderdoc/android/android.cpp index ff295fdae..1776d8220 100644 --- a/renderdoc/android/android.cpp +++ b/renderdoc/android/android.cpp @@ -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()))