summaryrefslogtreecommitdiff
path: root/platform/android/export/export.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-05-25 18:06:46 +0200
committerGitHub <noreply@github.com>2021-05-25 18:06:46 +0200
commitae5735af601ead4bec848538a032139e04d3a59a (patch)
tree19fe51c20e122143b1cd858fc33098cf7547c174 /platform/android/export/export.cpp
parent72a7ddaddc0c12792ba3aa1550452c21a09e6ed7 (diff)
parent1179421068a8d6f1afa94c953e27e7dd9784847a (diff)
Merge pull request #49069 from RandomShaper/android_data_backup
Allow basic user data backup on Android
Diffstat (limited to 'platform/android/export/export.cpp')
-rw-r--r--platform/android/export/export.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index ec2618a3d5..073c9dc6ef 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -857,6 +857,8 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
int xr_mode_index = p_preset->get("xr_features/xr_mode");
+ bool backup_allowed = p_preset->get("user_data_backup/allow");
+
Vector<String> perms;
// Write permissions into the perms variable.
_get_permissions(p_preset, p_give_internet, perms);
@@ -949,6 +951,10 @@ class EditorExportPlatformAndroid : public EditorExportPlatform {
}
}
+ if (tname == "application" && attrname == "allowBackup") {
+ encode_uint32(backup_allowed, &p_manifest.write[iofs + 16]);
+ }
+
if (tname == "instrumentation" && attrname == "targetPackage") {
string_table.write[attr_value] = get_package_name(package_name);
}
@@ -1684,6 +1690,8 @@ public:
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_large"), true));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_xlarge"), true));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "user_data_backup/allow"), false));
+
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "command_line/extra_args"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "apk_expansion/enable"), false));