Support alternative .android_secure location

Some devices (jewel, m8) have .android_secure at a non-standard
location. Allow a different partition to be specified as the home of
.android_secure using the fstab flag 'andsec'.

Using the /data/media variant of jewel as an example, recovery.fstab or
twrp.fstab could be edited like follows:

/external_sd  vfat  /dev/block/mmcblk1p1  flags=display="MicroSD";andsec

Note, this is NOT a method to move .android_secure in your ROM. Your ROM
must already write to this alternative location.

Change-Id: I3a6e4e63aaddb35870b79e80938b0f9c2c902443
diff --git a/gui/devices/1024x600/res/ui.xml b/gui/devices/1024x600/res/ui.xml
index e168cb2..f201c67 100755
--- a/gui/devices/1024x600/res/ui.xml
+++ b/gui/devices/1024x600/res/ui.xml
@@ -1394,7 +1394,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row2_text_y%" placement="5" />
 				<text>.android_secure</text>
diff --git a/gui/devices/1024x768/res/ui.xml b/gui/devices/1024x768/res/ui.xml
index 980d031..8d7ded8 100644
--- a/gui/devices/1024x768/res/ui.xml
+++ b/gui/devices/1024x768/res/ui.xml
@@ -1394,7 +1394,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row2_text_y%" placement="5" />
 				<text>.android_secure</text>
diff --git a/gui/devices/1080x1920/res/ui.xml b/gui/devices/1080x1920/res/ui.xml
index 2f4f71f..96ff623 100644
--- a/gui/devices/1080x1920/res/ui.xml
+++ b/gui/devices/1080x1920/res/ui.xml
@@ -1116,7 +1116,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row3_text_y%" placement="5" />
 				<text>.android_secure</text>
diff --git a/gui/devices/1200x1920/res/ui.xml b/gui/devices/1200x1920/res/ui.xml
index aec4be0..f727e67 100644
--- a/gui/devices/1200x1920/res/ui.xml
+++ b/gui/devices/1200x1920/res/ui.xml
@@ -1119,7 +1119,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row3_text_y%" placement="5" />
 				<text>.android_secure</text>
diff --git a/gui/devices/1280x800/res/ui.xml b/gui/devices/1280x800/res/ui.xml
index a54e169..2c61b77 100644
--- a/gui/devices/1280x800/res/ui.xml
+++ b/gui/devices/1280x800/res/ui.xml
@@ -1394,7 +1394,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row2_text_y%" placement="5" />
 				<text>.android_secure</text>
diff --git a/gui/devices/1600x2560/res/ui.xml b/gui/devices/1600x2560/res/ui.xml
index dcfd956..1873d0b 100644
--- a/gui/devices/1600x2560/res/ui.xml
+++ b/gui/devices/1600x2560/res/ui.xml
@@ -1121,7 +1121,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row3_text_y%" placement="5" />
 				<text>.android_secure</text>
diff --git a/gui/devices/1920x1200/res/ui.xml b/gui/devices/1920x1200/res/ui.xml
index f126572..1a8daf9 100644
--- a/gui/devices/1920x1200/res/ui.xml
+++ b/gui/devices/1920x1200/res/ui.xml
@@ -1394,7 +1394,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row2_text_y%" placement="5" />
 				<text>.android_secure</text>
diff --git a/gui/devices/240x240/res/ui.xml b/gui/devices/240x240/res/ui.xml
index d2808c6..3246a40 100644
--- a/gui/devices/240x240/res/ui.xml
+++ b/gui/devices/240x240/res/ui.xml
@@ -1086,7 +1086,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row3_text_y%" placement="5" />
 				<text>.android_secure</text>
diff --git a/gui/devices/2560x1600/res/ui.xml b/gui/devices/2560x1600/res/ui.xml
index e3cdb8a..d042889 100644
--- a/gui/devices/2560x1600/res/ui.xml
+++ b/gui/devices/2560x1600/res/ui.xml
@@ -1394,7 +1394,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row2_text_y%" placement="5" />
 				<text>.android_secure</text>
diff --git a/gui/devices/320x480/res/ui.xml b/gui/devices/320x480/res/ui.xml
index 4117f16..cf17d1a 100644
--- a/gui/devices/320x480/res/ui.xml
+++ b/gui/devices/320x480/res/ui.xml
@@ -1103,7 +1103,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row3_text_y%" placement="5" />
 				<text>.android_secure</text>
diff --git a/gui/devices/480x800/res/ui.xml b/gui/devices/480x800/res/ui.xml
index 389006e..96fc5c4 100644
--- a/gui/devices/480x800/res/ui.xml
+++ b/gui/devices/480x800/res/ui.xml
@@ -1103,7 +1103,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row3_text_y%" placement="5" />
 				<text>.android_secure</text>
diff --git a/gui/devices/480x854/res/ui.xml b/gui/devices/480x854/res/ui.xml
index 32b8ab9..330f939 100644
--- a/gui/devices/480x854/res/ui.xml
+++ b/gui/devices/480x854/res/ui.xml
@@ -1102,7 +1102,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row3_text_y%" placement="5" />
 				<text>.android_secure</text>
diff --git a/gui/devices/540x960/res/ui.xml b/gui/devices/540x960/res/ui.xml
index ecc6f62..75262bb 100644
--- a/gui/devices/540x960/res/ui.xml
+++ b/gui/devices/540x960/res/ui.xml
@@ -1103,7 +1103,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row3_text_y%" placement="5" />
 				<text>.android_secure</text>
diff --git a/gui/devices/720x1280/res/ui.xml b/gui/devices/720x1280/res/ui.xml
index f613b6a..83f7c40 100644
--- a/gui/devices/720x1280/res/ui.xml
+++ b/gui/devices/720x1280/res/ui.xml
@@ -1116,7 +1116,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row3_text_y%" placement="5" />
 				<text>.android_secure</text>
diff --git a/gui/devices/800x1280/res/ui.xml b/gui/devices/800x1280/res/ui.xml
index c08b742..b70837b 100755
--- a/gui/devices/800x1280/res/ui.xml
+++ b/gui/devices/800x1280/res/ui.xml
@@ -1104,7 +1104,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row3_text_y%" placement="5" />
 				<text>.android_secure</text>
diff --git a/gui/devices/800x480/res/ui.xml b/gui/devices/800x480/res/ui.xml
index 2958ba0..de693f1 100755
--- a/gui/devices/800x480/res/ui.xml
+++ b/gui/devices/800x480/res/ui.xml
@@ -1402,7 +1402,10 @@
 			</object>
 
 			<object type="text" color="%text_color%">
-				<condition var1="tw_has_data_media" var2="0" />
+				<conditions>
+					<condition var1="tw_has_android_secure" var2="1" />
+					<condition var1="fileexists" var2="/and-sec" />
+				</conditions>
 				<font resource="font" />
 				<placement x="%center_x%" y="%row2_text_y%" placement="5" />
 				<text>.android_secure</text>