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
On Pixel 8 phones we were seeing 'INSTALL_FAILED_NO_MATCHING_ABIS' on stdout but it was being checked on stderr only.
The lack of 32bit support is detected again from CheckAndroidServerVersion(..) but it only prints to the log, no logic changes occur. This then caused the 'force queryable' checking to be performed on a not-installed APK which returned ResultCode::AndroidAPKVerifyFailed back to the runner.
The change is to check for INSTALL_FAILED_NO_MATCHING_ABIS on stdout too, and if that check still fails then the later check will bypass verfiication keeping the existing Succeeded result.
* Installing the Android server on certain devices will not grant
'force-queryable' permissions, necessary for capture layer
discovery for API>=30. Reinstalling a second time fixes this
issue. With this change, the 'force-queryable' attribute is
checked post-install. If the check fails, it prompts a second
installtion attempt.
* Solution tested on:
- OPPO find X6, Android 13 (affected device)
- Google Pixel 6 and 7, Android 13
- SM-G930F, Android 8
* When we detect a new version of Android and a 64-bit device where the 32-bit
version of RenderDoc fails to install completely, ignore this and don't warn
the user about it.
* Synchronous commands are on the stack, so incrementing the done flag should be
the last thing we do to interact with them. That includes checking for self-
deletion afterwards
* Most of the main entry points that can fail with relevant reasons now has a
way of specifying a message to return with it. This message can be displayed
to the user to give more information or context about an error.
We need to check the android version running on the device to know
whether or not we need to make the adb install command use the
--force-queryable flag
Devices running Android R/11/SDK 30 are ones which support this flag
Added the --force-queryable flag to the adb install command for
renderdoc Android on devices running Android R/11/SDK 30
A feature being introduced in Android R requires all explicit
interactions between
apps to be declared ahead of time (either via manifest or during adb
install)
The --force-queryable flag during adb install does this, and is what
allows for the
shared objects from renderdoc (in this case the layers) to be
discoverable by
other apps targeting SDK 30+
* This prevents unnecessary conversions back and forth between rdcstr and const
char * when going through interfaces. In the OS specific layer this is rarely
an issue because most of the implementations don't convert to rdcstr, but it
is convenient to be able to pass in an rdcstr directly. The few cases where
there's an unecessary construction of an rdcstr is acceptable.
* A couple of places in the public API need to return a string from a global
function, so can't return an rdcstr due to C ABI, so they still return a const
char *.
* Similarly const char * is kept for logging, to avoid a dependency on rdcstr
and because that's one place where unnecessary conversions/constructions may
be impactful.
Updated permissions for the renderdoccmd app based on which version of
android the app is running on
**WRITE_EXTERNAL_STORAGE for <R
**MANAGE_EXTERNAL_STORAGE for >=R
Updated the Java portion of renderdoccmd to check/request the correct
permission based on android version
Changed the file path for renderdoc files on Android based on the
version of Android the connected device is running
**/sdcard/Android/data/$PACKAGE_NAME for <R
**/sdcard/Android/media/$PACKAGE_NAME for >=R