summaryrefslogtreecommitdiffstats
path: root/twrp.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2015-06-29 21:00:03 +0200
committerDees Troy <dees_troy@teamw.in>2015-07-14 16:53:43 +0200
commit961d20e09c6cf067043c1d7a85f277e4fd4663fd (patch)
tree900e3234cf66f665c8b8f03d713b6a42f7750f54 /twrp.cpp
parentAllow devices to override USB init (diff)
downloadandroid_bootable_recovery-961d20e09c6cf067043c1d7a85f277e4fd4663fd.tar
android_bootable_recovery-961d20e09c6cf067043c1d7a85f277e4fd4663fd.tar.gz
android_bootable_recovery-961d20e09c6cf067043c1d7a85f277e4fd4663fd.tar.bz2
android_bootable_recovery-961d20e09c6cf067043c1d7a85f277e4fd4663fd.tar.lz
android_bootable_recovery-961d20e09c6cf067043c1d7a85f277e4fd4663fd.tar.xz
android_bootable_recovery-961d20e09c6cf067043c1d7a85f277e4fd4663fd.tar.zst
android_bootable_recovery-961d20e09c6cf067043c1d7a85f277e4fd4663fd.zip
Diffstat (limited to 'twrp.cpp')
-rw-r--r--twrp.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/twrp.cpp b/twrp.cpp
index e34c9b381..091de19fd 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -335,18 +335,17 @@ int main(int argc, char **argv) {
// Check if system has never been changed
TWPartition* sys = PartitionManager.Find_Partition_By_Path("/system");
if (sys) {
- if (DataManager::GetIntValue("tw_mount_system_ro") != 0) {
- if (sys->Check_Lifetime_Writes() == 0) {
- if (DataManager::GetIntValue("tw_never_show_system_ro_page") == 0) {
- DataManager::SetValue("tw_back", "main");
- if (gui_startPage("system_readonly", 1, 1) != 0) {
- LOGERR("Failed to start system_readonly GUI page.\n");
- }
+ if ((DataManager::GetIntValue("tw_mount_system_ro") == 0 && sys->Check_Lifetime_Writes() == 0) || DataManager::GetIntValue("tw_mount_system_ro") == 2) {
+ if (DataManager::GetIntValue("tw_never_show_system_ro_page") == 0) {
+ DataManager::SetValue("tw_back", "main");
+ if (gui_startPage("system_readonly", 1, 1) != 0) {
+ LOGERR("Failed to start system_readonly GUI page.\n");
}
- } else {
- DataManager::SetValue("tw_mount_system_ro", 0);
+ } else if (DataManager::GetIntValue("tw_mount_system_ro") == 0) {
sys->Change_Mount_Read_Only(false);
}
+ } else if (DataManager::GetIntValue("tw_mount_system_ro") == 1) {
+ // Do nothing, user selected to leave system read only
} else {
sys->Change_Mount_Read_Only(false);
}