mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Only run 'adb root' when getting friendly name
* This avoid spamming adb root into the log often when we only need to run it once when a device is first seen.
This commit is contained in:
@@ -584,12 +584,6 @@ extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_EnumerateAndroidDevices(rdc
|
||||
// Forward the ports so we can see if a remoteserver/captured app is already running.
|
||||
Android::adbForwardPorts(idx, tokens[0], 0, 0, true);
|
||||
|
||||
// run adb root now, so we hit any disconnection that we're going to before trying to connect.
|
||||
// If we can't be root, this is cheap, if we're already root, this is cheap, if we can be root
|
||||
// and this changes us it will block only the first time - and we expect this function to be
|
||||
// slow-ish.
|
||||
Android::adbExecCommand(tokens[0], "root");
|
||||
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,6 +157,15 @@ std::string GetFriendlyName(std::string deviceID)
|
||||
if(it != friendlyNameCache.end())
|
||||
return it->second;
|
||||
|
||||
// run adb root now, so we hit any disconnection that we're going to before trying to connect.
|
||||
// If we can't be root, this is cheap, if we're already root, this is cheap, if we can be root
|
||||
// and this changes us it will block only the first time - and we expect this function to be
|
||||
// slow-ish.
|
||||
//
|
||||
// We do this here so that we sneakily take advantage of the above caching - otherwise we spam adb
|
||||
// root commands into the log
|
||||
Android::adbExecCommand(deviceID, "root");
|
||||
|
||||
std::string manuf =
|
||||
trim(Android::adbExecCommand(deviceID, "shell getprop ro.product.manufacturer").strStdout);
|
||||
std::string model =
|
||||
|
||||
Reference in New Issue
Block a user