summaryrefslogtreecommitdiffstats
path: root/twrp.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-12-29 17:48:17 +0100
committerEthan Yonker <dees_troy@teamw.in>2015-01-02 17:22:58 +0100
commitdf7abac1a645949ded76418759236bc3b14f107e (patch)
treebad4df0115162eb099a9d4c8bcbe282023c018bd /twrp.cpp
parentgui: remove dead build flag TWRP_SIMULATE_ACTIONS (diff)
downloadandroid_bootable_recovery-df7abac1a645949ded76418759236bc3b14f107e.tar
android_bootable_recovery-df7abac1a645949ded76418759236bc3b14f107e.tar.gz
android_bootable_recovery-df7abac1a645949ded76418759236bc3b14f107e.tar.bz2
android_bootable_recovery-df7abac1a645949ded76418759236bc3b14f107e.tar.lz
android_bootable_recovery-df7abac1a645949ded76418759236bc3b14f107e.tar.xz
android_bootable_recovery-df7abac1a645949ded76418759236bc3b14f107e.tar.zst
android_bootable_recovery-df7abac1a645949ded76418759236bc3b14f107e.zip
Diffstat (limited to '')
-rw-r--r--twrp.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/twrp.cpp b/twrp.cpp
index 53aab7f66..e0b335975 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -311,26 +311,23 @@ int main(int argc, char **argv) {
property_get("mtp.crash_check", mtp_crash_check, "0");
if (strcmp(mtp_crash_check, "0") == 0) {
property_set("mtp.crash_check", "1");
- if (DataManager::GetIntValue(TW_IS_ENCRYPTED) != 0) {
- if (DataManager::GetIntValue(TW_IS_DECRYPTED) != 0 && DataManager::GetIntValue("tw_mtp_enabled") == 1) {
- LOGINFO("Enabling MTP during startup\n");
- if (!PartitionManager.Enable_MTP())
- PartitionManager.Disable_MTP();
- else
- gui_print("MTP Enabled\n");
- }
- } else if (DataManager::GetIntValue("tw_mtp_enabled") == 1) {
+ if (DataManager::GetIntValue("tw_mtp_enabled") == 1 && ((DataManager::GetIntValue(TW_IS_ENCRYPTED) != 0 && DataManager::GetIntValue(TW_IS_DECRYPTED) != 0) || DataManager::GetIntValue(TW_IS_ENCRYPTED) == 0)) {
LOGINFO("Enabling MTP during startup\n");
if (!PartitionManager.Enable_MTP())
PartitionManager.Disable_MTP();
else
gui_print("MTP Enabled\n");
+ } else {
+ PartitionManager.Disable_MTP();
}
property_set("mtp.crash_check", "0");
} else {
gui_print_color("warning", "MTP Crashed, not starting MTP on boot.\n");
DataManager::SetValue("tw_mtp_enabled", 0);
+ PartitionManager.Disable_MTP();
}
+#else
+ PartitionManager.Disable_MTP();
#endif
// Launch the main GUI