Add exclusion criteria for "Fix Recovery Bootloop"
Should only be included on devices that use initramfs,
i.e. legacy SAR, recovery-in-boot
Change-Id: I2408fcd993e1e381f49b3d5ae860694b2fade4d2
diff --git a/Android.mk b/Android.mk
index e8426fb..bc6341e 100755
--- a/Android.mk
+++ b/Android.mk
@@ -193,6 +193,12 @@
ifeq ($(TW_EXCLUDE_MTP),)
LOCAL_SHARED_LIBRARIES += libtwrpmtp-ffs
endif
+ifeq ($(BOARD_USES_RECOVERY_AS_BOOT), true)
+ LOCAL_CFLAGS += -DBOARD_USES_RECOVERY_AS_BOOT
+endif
+ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE), true)
+ LOCAL_CFLAGS += -DBOARD_BUILD_SYSTEM_ROOT_IMAGE
+endif
#TWRP Build Flags
ifeq ($(TW_EXCLUDE_MTP),)
diff --git a/data.cpp b/data.cpp
index 1fc7f35..cdade08 100755
--- a/data.cpp
+++ b/data.cpp
@@ -793,7 +793,11 @@
#else
mPersist.SetValue(TW_UNMOUNT_SYSTEM, "1");
#endif
-
+#if defined BOARD_USES_RECOVERY_AS_BOOT && defined BOARD_BUILD_SYSTEM_ROOT_IMAGE
+ mConst.SetValue("tw_uses_initramfs", "1");
+#else
+ mConst.SetValue("tw_uses_initramfs", "0");
+#endif
#ifdef TW_NO_SCREEN_TIMEOUT
mConst.SetValue("tw_screen_timeout_secs", "0");
mConst.SetValue("tw_no_screen_timeout", "1");
diff --git a/gui/theme/common/landscape.xml b/gui/theme/common/landscape.xml
index 0367e55..8132811 100755
--- a/gui/theme/common/landscape.xml
+++ b/gui/theme/common/landscape.xml
@@ -3770,6 +3770,7 @@
<conditions>
<condition var1="tw_has_boot_slots" var2="1"/>
<condition var1="tw_has_repack_tools" var2="1"/>
+ <condition var1="tw_uses_initramfs" var2="1"/>
</conditions>
<actions>
<action function="set">tw_back=advanced</action>
diff --git a/gui/theme/common/portrait.xml b/gui/theme/common/portrait.xml
index 607e211..9d7e72c 100755
--- a/gui/theme/common/portrait.xml
+++ b/gui/theme/common/portrait.xml
@@ -3892,6 +3892,7 @@
<conditions>
<condition var1="tw_has_boot_slots" var2="1"/>
<condition var1="tw_has_repack_tools" var2="1"/>
+ <condition var1="tw_uses_initramfs" var2="1"/>
</conditions>
<actions>
<action function="set">tw_back=advanced</action>
diff --git a/gui/theme/common/watch.xml b/gui/theme/common/watch.xml
index 2cea636..84dd4f6 100755
--- a/gui/theme/common/watch.xml
+++ b/gui/theme/common/watch.xml
@@ -4371,6 +4371,7 @@
<conditions>
<condition var1="tw_has_boot_slots" var2="1"/>
<condition var1="tw_has_repack_tools" var2="1"/>
+ <condition var1="tw_uses_initramfs" var2="1"/>
</conditions>
<actions>
<action function="set">tw_back=advanced</action>