mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Android: Automaticaly add MANAGE_EXTERNAL_STORAGE permission to apps
This prevents the user from needing to click through a permission granting screen on their device before the agent is able to run on the device, but only does so if the API level is >= 30 (where this permission has effect at all [0]) and if a particular property is set on the device (`debug.renderdoc.autograntpermissions`) so as to avoid potential pitfalls on unusual Android devices. [0] https://developer.android.com/reference/android/Manifest.permission#MANAGE_EXTERNAL_STORAGE
This commit is contained in:
committed by
Baldur Karlsson
parent
64c77e917e
commit
e6b4de8138
@@ -1220,6 +1220,17 @@ struct AndroidController : public IDeviceProtocolHandler
|
||||
for(Android::ABI abi : abis)
|
||||
Android::adbExecCommand(deviceID, "shell am force-stop " + GetRenderDocPackageForABI(abi));
|
||||
|
||||
// Attempt to prevent the user needing to click through on permissions
|
||||
rdcstr auto_grant_permissions =
|
||||
Android::adbExecCommand(deviceID, "shell getprop debug.renderdoc.autograntpermissions")
|
||||
.strStdout.trimmed();
|
||||
if(apiVersion >= 30 && atoi(auto_grant_permissions.c_str()) == 1)
|
||||
{
|
||||
for(Android::ABI abi : abis)
|
||||
Android::adbExecCommand(deviceID, "shell pm grant " + GetRenderDocPackageForABI(abi) +
|
||||
" android.permission.MANAGE_EXTERNAL_STORAGE");
|
||||
}
|
||||
|
||||
Android::adbForwardPorts(dev.portbase, deviceID, 0, 0, false);
|
||||
Android::ResetCaptureSettings(deviceID);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user