Replace fix permissions with fix contexts for emulated storage
Fix permissions rarely fixed anything on more recent versions of
Android and usually made things worse. Instead we will replace it
with a more dumbed down option that should fix contexts on
/data/media with a few improvements to ensure that contexts get
fixed for multiple users and on adopted storage.
Change-Id: If5523781936a0b04196e2ad871cae767ebae2583
diff --git a/gui/theme/common/landscape.xml b/gui/theme/common/landscape.xml
index 3bbb8be..7ce8d65 100755
--- a/gui/theme/common/landscape.xml
+++ b/gui/theme/common/landscape.xml
@@ -3094,9 +3094,10 @@
</button>
<button style="main_button">
+ <condition var1="tw_has_data_media" var2="1"/>
<placement x="%center_x%" y="%row2_y%"/>
- <text>{@fix_perm_btn=Fix Permissions}</text>
- <action function="page">fixperms</action>
+ <text>{@fix_context_btn=Fix Contexts}</text>
+ <action function="page">fixcontexts</action>
</button>
<button style="main_button">
@@ -4467,7 +4468,7 @@
</action>
</page>
- <page name="fixperms">
+ <page name="fixcontexts">
<template name="page"/>
<text style="text_l">
@@ -4477,37 +4478,31 @@
<text style="text_m">
<placement x="%col1_x_header%" y="%row4_header_y%"/>
- <text>{@fix_perms_hdr=Fix Permissions}</text>
+ <text>{@fix_contexts_hdr=Fix Contexts}</text>
</text>
<text style="text_m_accent">
<placement x="%center_x%" y="%row2_y%" placement="5"/>
- <text>{@fix_perms_note=Note: Fixing permissions is rarely needed.}</text>
+ <text>{@fix_contexts_note1=Note: Fixing contexts is rarely needed.}</text>
</text>
- <checkbox>
- <placement x="%col2_x_left%" y="%row4_y%"/>
- <text>{@fix_perms_selinux_chk=Also fix SELinux Contexts}</text>
- <data variable="tw_fixperms_restorecon"/>
- </checkbox>
-
<text style="text_m_fail">
<placement x="%center_x%" y="%row6_y%" placement="5"/>
- <text>{@fix_perms_sel_note1=Fixing SELinux Contexts may cause}</text>
+ <text>{@fix_contexts_note2=Fixing SELinux Contexts may cause}</text>
</text>
<text style="text_m_fail">
<placement x="%center_x%" y="%row7_y%" placement="5"/>
- <text>{@fix_perms_sel_note2=your device to not boot properly.}</text>
+ <text>{@fix_contexts_note3=your device to not boot properly.}</text>
</text>
<slider style="slider_centered">
- <text>{@swipe_to_fix_perms=Swipe to Fix Permissions}</text>
+ <text>{@swipe_to_fix_contexts=Swipe to Fix Contexts}</text>
<actions>
<action function="set">tw_back=advanced</action>
- <action function="set">tw_action=fixpermissions</action>
- <action function="set">tw_action_text1={@fixing_perms=Fixing Permissions...}</action>
- <action function="set">tw_complete_text1={@fix_perms_complete=Fix Permissions Complete}</action>
+ <action function="set">tw_action=fixcontexts</action>
+ <action function="set">tw_action_text1={@fixing_contexts=Fixing Contexts...}</action>
+ <action function="set">tw_complete_text1={@fix_contexts_complete=Fix Contexts Complete}</action>
<action function="set">tw_slider_text={@swipe_to_confirm=Swipe to Confirm}</action>
<action function="set">tw_show_reboot=1</action>
<action function="page">action_page</action>