summaryrefslogtreecommitdiffstats
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
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 '')
-rw-r--r--data.cpp4
-rw-r--r--gui/devices/landscape/res/landscape.xml2
-rw-r--r--gui/devices/portrait/res/portrait.xml2
-rw-r--r--gui/devices/watch/res/watch.xml2
-rw-r--r--twrp.cpp17
5 files changed, 13 insertions, 14 deletions
diff --git a/data.cpp b/data.cpp
index 6e39bc3f9..d7b02f1d6 100644
--- a/data.cpp
+++ b/data.cpp
@@ -65,7 +65,7 @@ extern "C"
void gui_notifyVarChange(const char *name, const char* value);
}
-#define FILE_VERSION 0x00010001
+#define FILE_VERSION 0x00010010
using namespace std;
@@ -881,7 +881,7 @@ void DataManager::SetDefaultValues()
mConstValues.insert(make_pair("tw_has_mtp", "0"));
mConstValues.insert(make_pair("tw_mtp_enabled", "0"));
#endif
- mValues.insert(make_pair("tw_mount_system_ro", make_pair("1", 1)));
+ mValues.insert(make_pair("tw_mount_system_ro", make_pair("2", 1)));
mValues.insert(make_pair("tw_never_show_system_ro_page", make_pair("0", 1)));
pthread_mutex_unlock(&m_valuesLock);
diff --git a/gui/devices/landscape/res/landscape.xml b/gui/devices/landscape/res/landscape.xml
index b41669113..c75be3c6f 100644
--- a/gui/devices/landscape/res/landscape.xml
+++ b/gui/devices/landscape/res/landscape.xml
@@ -3664,7 +3664,7 @@
<object type="text">
<placement x="%center_x%" y="%row1_text_y%" placement="5" />
- <text>TWRP has detected an unmodified system partition.</text>
+ <text>Keep System Read Only?</text>
</object>
<object type="text">
diff --git a/gui/devices/portrait/res/portrait.xml b/gui/devices/portrait/res/portrait.xml
index cf113efd7..969044c19 100644
--- a/gui/devices/portrait/res/portrait.xml
+++ b/gui/devices/portrait/res/portrait.xml
@@ -3675,7 +3675,7 @@
<object type="text">
<placement x="%center_x%" y="%row1_header_y%" placement="5" />
- <text>TWRP has detected an unmodified system partition.</text>
+ <text>Keep System Read Only?</text>
</object>
<object type="text">
diff --git a/gui/devices/watch/res/watch.xml b/gui/devices/watch/res/watch.xml
index 7fae5f3d7..28198fb2d 100644
--- a/gui/devices/watch/res/watch.xml
+++ b/gui/devices/watch/res/watch.xml
@@ -3664,7 +3664,7 @@
<object type="text">
<placement x="%center_x%" y="%row1_header_y%" placement="5" />
- <text>TWRP has detected an unmodified system partition.</text>
+ <text>Keep System Read Only?</text>
</object>
<object type="text">
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);
}