summaryrefslogtreecommitdiff
path: root/platform/android/export
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2018-11-30 11:13:50 -0200
committerGeorge Marques <george@gmarqu.es>2018-11-30 11:13:50 -0200
commit22233ded4a9934c6eaddd8f8fc04afdb20d4876e (patch)
tree65dcb5b0c17d7254605f606d5679277381c4499b /platform/android/export
parent5b8dde4b4a5a930e08da51e07ec87f43e5bd7b36 (diff)
Change custom permissions in Android export to an array
Don't limit the amount of permissions and makes it simpler to understand.
Diffstat (limited to 'platform/android/export')
-rw-r--r--platform/android/export/export.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 3766f732e4..a3b5b6dd58 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -672,10 +672,13 @@ class EditorExportAndroid : public EditorExportPlatform {
aperms++;
}
- for (int i = 0; i < MAX_USER_PERMISSIONS; i++) {
- String user_perm = p_preset->get("user_permissions/" + itos(i));
- if (user_perm.strip_edges() != "" && user_perm.strip_edges() != "False")
- perms.push_back(user_perm.strip_edges());
+ PoolStringArray user_perms = p_preset->get("permissions/custom_permissions");
+
+ for (int i = 0; i < user_perms.size(); i++) {
+ String user_perm = user_perms[i].strip_edges();
+ if (!user_perm.empty()) {
+ perms.push_back(user_perm);
+ }
}
if (p_give_internet) {
@@ -1104,10 +1107,6 @@ class EditorExportAndroid : public EditorExportPlatform {
}
public:
- enum {
- MAX_USER_PERMISSIONS = 20
- };
-
typedef Error (*EditorExportSaveFunction)(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total);
public:
@@ -1169,17 +1168,14 @@ public:
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "architectures/" + abi), is_default));
}
+ r_options->push_back(ExportOption(PropertyInfo(Variant::POOL_STRING_ARRAY, "permissions/custom_permissions"), PoolStringArray()));
+
const char **perms = android_perms;
while (*perms) {
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "permissions/" + String(*perms).to_lower()), false));
perms++;
}
-
- for (int i = 0; i < MAX_USER_PERMISSIONS; i++) {
-
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "user_permissions/" + itos(i)), false));
- }
}
virtual String get_name() const {