From e6b2d9fa71c965ae922b6894a290d1952bc2e8f3 Mon Sep 17 00:00:00 2001 From: nailyk-fr Date: Tue, 8 Aug 2017 21:23:35 +0200 Subject: [PATCH] add an option to exclude the TWRP app * Allow device maintainer to exclude the twrp app and disable the installation prompt. Mostly the app is useless for every unofficially supported devices. * BoardConfig flag: 'TW_EXCLUDE_TWRPAPP := true' Original commit: https://gerrit.omnirom.org/#/c/android_bootable_recovery/+/27694/ Change-Id: I0aa1fb2ebe03ceb19c766178544039a82497cdd4 --- Android.mk | 3 +++ data.cpp | 4 ++++ gui/theme/common/landscape.xml | 2 ++ gui/theme/common/portrait.xml | 2 ++ gui/theme/common/watch.xml | 1 + prebuilt/Android.mk | 34 ++++++++++++++++++---------------- 6 files changed, 30 insertions(+), 16 deletions(-) diff --git a/Android.mk b/Android.mk index 302b143f..2ef6561c 100755 --- a/Android.mk +++ b/Android.mk @@ -391,6 +391,9 @@ endif ifeq ($(TW_EXCLUDE_NANO), true) LOCAL_CFLAGS += -DTW_EXCLUDE_NANO endif +ifeq ($(TW_EXCLUDE_TWRPAPP), true) + LOCAL_CFLAGS += -DTW_EXCLUDE_TWRPAPP +endif LOCAL_C_INCLUDES += system/vold \ diff --git a/data.cpp b/data.cpp index f19a2ed4..482e47d9 100755 --- a/data.cpp +++ b/data.cpp @@ -934,11 +934,15 @@ void DataManager::SetDefaultValues() mConst.SetValue("tw_app_installed_in_system", "0"); #else mConst.SetValue("tw_oem_build", "0"); +#ifdef TW_EXCLUDE_TWRPAPP + mConst.SetValue("tw_app_prompt", "-1"); +#else mPersist.SetValue("tw_app_prompt", "1"); mPersist.SetValue("tw_app_install_system", "1"); mData.SetValue("tw_app_install_status", "0"); // 0 = no status, 1 = not installed, 2 = already installed mData.SetValue("tw_app_installed_in_system", "0"); #endif +#endif #ifndef TW_EXCLUDE_NANO mConst.SetValue("tw_include_nano", "1"); #else diff --git a/gui/theme/common/landscape.xml b/gui/theme/common/landscape.xml index da3e3217..01881ea6 100755 --- a/gui/theme/common/landscape.xml +++ b/gui/theme/common/landscape.xml @@ -2997,6 +2997,7 @@