summaryrefslogtreecommitdiff
path: root/platform/android/export
diff options
context:
space:
mode:
authorFredia Huya-Kouadio <fhuyakou@gmail.com>2021-12-09 08:49:32 -0800
committerne0fhyk <fhuyakou@gmail.com>2021-12-09 08:50:47 -0800
commitcfa81ff32a3b074bc284cda3790166385fa15918 (patch)
tree8bc77caa419f75b718fe32b5c360c7faebd1f09a /platform/android/export
parent012b2b53854f49b5bd4f60a2a056f71a3ccb2e1c (diff)
Enable configuration of the `android:excludeFromRecents` activity attribute.
Diffstat (limited to 'platform/android/export')
-rw-r--r--platform/android/export/export_plugin.cpp6
-rw-r--r--platform/android/export/gradle_export_util.cpp4
2 files changed, 9 insertions, 1 deletions
diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp
index c5d3cbd966..d5410a9a51 100644
--- a/platform/android/export/export_plugin.cpp
+++ b/platform/android/export/export_plugin.cpp
@@ -836,6 +836,7 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref<EditorExportPreset> &p
bool backup_allowed = p_preset->get("user_data_backup/allow");
bool classify_as_game = p_preset->get("package/classify_as_game");
bool retain_data_on_uninstall = p_preset->get("package/retain_data_on_uninstall");
+ bool exclude_from_recents = p_preset->get("package/exclude_from_recents");
Vector<String> perms;
// Write permissions into the perms variable.
@@ -949,6 +950,10 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref<EditorExportPreset> &p
encode_uint32(screen_orientation, &p_manifest.write[iofs + 16]);
}
+ if (tname == "activity" && attrname == "excludeFromRecents") {
+ encode_uint32(exclude_from_recents, &p_manifest.write[iofs + 16]);
+ }
+
if (tname == "supports-screens") {
if (attrname == "smallScreens") {
encode_uint32(screen_support_small ? 0xFFFFFFFF : 0, &p_manifest.write[iofs + 16]);
@@ -1684,6 +1689,7 @@ void EditorExportPlatformAndroid::get_export_options(List<ExportOption> *r_optio
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "package/signed"), true));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "package/classify_as_game"), true));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "package/retain_data_on_uninstall"), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "package/exclude_from_recents"), false));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, launcher_icon_option, PROPERTY_HINT_FILE, "*.png"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, launcher_adaptive_icon_foreground_option, PROPERTY_HINT_FILE, "*.png"), ""));
diff --git a/platform/android/export/gradle_export_util.cpp b/platform/android/export/gradle_export_util.cpp
index 658c0ecd0a..f43b070b41 100644
--- a/platform/android/export/gradle_export_util.cpp
+++ b/platform/android/export/gradle_export_util.cpp
@@ -252,8 +252,10 @@ String _get_activity_tag(const Ref<EditorExportPreset> &p_preset) {
String orientation = _get_android_orientation_label(DisplayServer::ScreenOrientation(int(GLOBAL_GET("display/window/handheld/orientation"))));
String manifest_activity_text = vformat(
" <activity android:name=\"com.godot.game.GodotApp\" "
- "tools:replace=\"android:screenOrientation\" "
+ "tools:replace=\"android:screenOrientation,android:excludeFromRecents\" "
+ "android:excludeFromRecents=\"%s\" "
"android:screenOrientation=\"%s\">\n",
+ bool_to_string(p_preset->get("package/exclude_from_recents")),
orientation);
if (uses_xr) {
manifest_activity_text += " <meta-data tools:node=\"replace\" android:name=\"com.oculus.vr.focusaware\" android:value=\"true\" />\n";