Remove some unneeded code
Change-Id: I52b34a316950e92a3aa4c1675475fca8dc08d2c8
diff --git a/gui/action.cpp b/gui/action.cpp
index 66ee5d6..344ced3 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -443,49 +443,29 @@
return 0;
}
- if (function == "mount")
- {
- if (arg == "usb")
- {
+ if (function == "mount") {
+ if (arg == "usb") {
DataManager::SetValue(TW_ACTION_BUSY, 1);
if (!simulate)
PartitionManager.usb_storage_enable();
else
gui_print("Simulating actions...\n");
- }
- else if (!simulate)
- {
- string cmd;
- if (arg == "EXTERNAL")
- PartitionManager.Mount_By_Path(DataManager::GetStrValue(TW_EXTERNAL_MOUNT), true);
- else if (arg == "INTERNAL")
- PartitionManager.Mount_By_Path(DataManager::GetStrValue(TW_INTERNAL_MOUNT), true);
- else
- PartitionManager.Mount_By_Path(arg, true);
+ } else if (!simulate) {
+ PartitionManager.Mount_By_Path(arg, true);
} else
gui_print("Simulating actions...\n");
return 0;
}
- if (function == "umount" || function == "unmount")
- {
- if (arg == "usb")
- {
+ if (function == "umount" || function == "unmount") {
+ if (arg == "usb") {
if (!simulate)
PartitionManager.usb_storage_disable();
else
gui_print("Simulating actions...\n");
DataManager::SetValue(TW_ACTION_BUSY, 0);
- }
- else if (!simulate)
- {
- string cmd;
- if (arg == "EXTERNAL")
- PartitionManager.UnMount_By_Path(DataManager::GetStrValue(TW_EXTERNAL_MOUNT), true);
- else if (arg == "INTERNAL")
- PartitionManager.UnMount_By_Path(DataManager::GetStrValue(TW_INTERNAL_MOUNT), true);
- else
- PartitionManager.UnMount_By_Path(arg, true);
+ } else if (!simulate) {
+ PartitionManager.UnMount_By_Path(arg, true);
} else
gui_print("Simulating actions...\n");
return 0;
@@ -605,57 +585,6 @@
if (function == "togglestorage") {
LOGERR("togglestorage action was deprecated from TWRP\n");
- if (arg == "internal") {
- DataManager::SetValue(TW_USE_EXTERNAL_STORAGE, 0);
- } else if (arg == "external") {
- DataManager::SetValue(TW_USE_EXTERNAL_STORAGE, 1);
- }
- if (PartitionManager.Mount_Current_Storage(true)) {
- if (arg == "internal") {
- string zip_path, zip_root;
- DataManager::GetValue(TW_ZIP_INTERNAL_VAR, zip_path);
- zip_root = TWFunc::Get_Root_Path(zip_path);
-#ifdef RECOVERY_SDCARD_ON_DATA
- #ifndef TW_EXTERNAL_STORAGE_PATH
- if (zip_root != "/sdcard")
- DataManager::SetValue(TW_ZIP_INTERNAL_VAR, "/sdcard");
- #else
- if (strcmp(EXPAND(TW_EXTERNAL_STORAGE_PATH), "/sdcard") == 0) {
- if (zip_root != "/emmc")
- DataManager::SetValue(TW_ZIP_INTERNAL_VAR, "/emmc");
- } else {
- if (zip_root != "/sdcard")
- DataManager::SetValue(TW_ZIP_INTERNAL_VAR, "/sdcard");
- }
- #endif
-#else
- if (zip_root != DataManager::GetCurrentStoragePath())
- DataManager::SetValue(TW_ZIP_LOCATION_VAR, DataManager::GetCurrentStoragePath());
-#endif
- // Save the current zip location to the external variable
- DataManager::SetValue(TW_ZIP_EXTERNAL_VAR, DataManager::GetStrValue(TW_ZIP_LOCATION_VAR));
- // Change the current zip location to the internal variable
- DataManager::SetValue(TW_ZIP_LOCATION_VAR, DataManager::GetStrValue(TW_ZIP_INTERNAL_VAR));
- } else if (arg == "external") {
- string zip_path, zip_root;
- DataManager::GetValue(TW_ZIP_EXTERNAL_VAR, zip_path);
- zip_root = TWFunc::Get_Root_Path(zip_path);
- if (zip_root != DataManager::GetCurrentStoragePath()) {
- DataManager::SetValue(TW_ZIP_EXTERNAL_VAR, DataManager::GetCurrentStoragePath());
- }
- // Save the current zip location to the internal variable
- DataManager::SetValue(TW_ZIP_INTERNAL_VAR, DataManager::GetStrValue(TW_ZIP_LOCATION_VAR));
- // Change the current zip location to the external variable
- DataManager::SetValue(TW_ZIP_LOCATION_VAR, DataManager::GetStrValue(TW_ZIP_EXTERNAL_VAR));
- }
- } else {
- // We weren't able to toggle for some reason, restore original setting
- if (arg == "internal") {
- DataManager::SetValue(TW_USE_EXTERNAL_STORAGE, 1);
- } else if (arg == "external") {
- DataManager::SetValue(TW_USE_EXTERNAL_STORAGE, 0);
- }
- }
return 0;
}
diff --git a/gui/object.cpp b/gui/object.cpp
index 41cc822..543452c 100644
--- a/gui/object.cpp
+++ b/gui/object.cpp
@@ -190,10 +190,6 @@
FILE *fp;
char tmpOutput[255];
- if (strcmp(vol.c_str(), "EXTERNAL") == 0)
- DataManager::GetValue(TW_EXTERNAL_MOUNT, vol);
- else if (strcmp(vol.c_str(), "INTERNAL") == 0)
- DataManager::GetValue(TW_INTERNAL_MOUNT, vol);
fp = fopen("/proc/mounts", "rt");
while (fgets(tmpOutput,255,fp) != NULL)
{