mirror of
https://github.com/geode-sdk/geode.git
synced 2025-02-18 09:10:17 -05:00
replace readmedia perms with one file perm
This commit is contained in:
parent
2e20cccf22
commit
5f7af1a434
2 changed files with 7 additions and 3 deletions
|
@ -6,9 +6,10 @@
|
||||||
|
|
||||||
namespace geode::utils::permission {
|
namespace geode::utils::permission {
|
||||||
enum class Permission {
|
enum class Permission {
|
||||||
ReadAudio,
|
ReadAudio [[deprecated("This permission is Android 13+ specific! Use ReadFiles instead.")]],
|
||||||
ReadImages,
|
ReadImages [[deprecated("This permission is Android 13+ specific! Use ReadFiles instead.")]],
|
||||||
ReadVideo,
|
ReadVideo [[deprecated("This permission is Android 13+ specific! Use ReadFiles instead.")]],
|
||||||
|
ReadAllFiles,
|
||||||
RecordAudio,
|
RecordAudio,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -311,13 +311,16 @@ void geode::utils::game::restart() {
|
||||||
|
|
||||||
static const char* permissionToName(Permission permission) {
|
static const char* permissionToName(Permission permission) {
|
||||||
#define PERM(x) "android.permission." x
|
#define PERM(x) "android.permission." x
|
||||||
|
#define INTERNAL_PERM(x) "geode.permission_internal." x
|
||||||
switch (permission) {
|
switch (permission) {
|
||||||
case Permission::ReadAudio: return PERM("READ_MEDIA_AUDIO");
|
case Permission::ReadAudio: return PERM("READ_MEDIA_AUDIO");
|
||||||
case Permission::ReadImages: return PERM("READ_MEDIA_IMAGES");
|
case Permission::ReadImages: return PERM("READ_MEDIA_IMAGES");
|
||||||
case Permission::ReadVideo: return PERM("READ_MEDIA_VIDEO");
|
case Permission::ReadVideo: return PERM("READ_MEDIA_VIDEO");
|
||||||
case Permission::RecordAudio: return PERM("RECORD_AUDIO");
|
case Permission::RecordAudio: return PERM("RECORD_AUDIO");
|
||||||
|
case Permission::ReadAllFiles: return INTERNAL_PERM("MANAGE_ALL_FILES");
|
||||||
}
|
}
|
||||||
#undef PERM
|
#undef PERM
|
||||||
|
#undef INTERNAL_PERM
|
||||||
}
|
}
|
||||||
|
|
||||||
bool geode::utils::permission::getPermissionStatus(Permission permission) {
|
bool geode::utils::permission::getPermissionStatus(Permission permission) {
|
||||||
|
|
Loading…
Reference in a new issue