replace readmedia perms with one file perm

This commit is contained in:
qimiko 2024-02-04 12:47:50 -07:00
parent 2e20cccf22
commit 5f7af1a434
No known key found for this signature in database
GPG key ID: D2D404DD810FE0E3
2 changed files with 7 additions and 3 deletions

View file

@ -6,9 +6,10 @@
namespace geode::utils::permission {
enum class Permission {
ReadAudio,
ReadImages,
ReadVideo,
ReadAudio [[deprecated("This permission is Android 13+ specific! Use ReadFiles instead.")]],
ReadImages [[deprecated("This permission is Android 13+ specific! Use ReadFiles instead.")]],
ReadVideo [[deprecated("This permission is Android 13+ specific! Use ReadFiles instead.")]],
ReadAllFiles,
RecordAudio,
};

View file

@ -311,13 +311,16 @@ void geode::utils::game::restart() {
static const char* permissionToName(Permission permission) {
#define PERM(x) "android.permission." x
#define INTERNAL_PERM(x) "geode.permission_internal." x
switch (permission) {
case Permission::ReadAudio: return PERM("READ_MEDIA_AUDIO");
case Permission::ReadImages: return PERM("READ_MEDIA_IMAGES");
case Permission::ReadVideo: return PERM("READ_MEDIA_VIDEO");
case Permission::RecordAudio: return PERM("RECORD_AUDIO");
case Permission::ReadAllFiles: return INTERNAL_PERM("MANAGE_ALL_FILES");
}
#undef PERM
#undef INTERNAL_PERM
}
bool geode::utils::permission::getPermissionStatus(Permission permission) {