summaryrefslogtreecommitdiffstats
path: root/gui/action.cpp
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2012-09-26 19:07:22 +0200
committerDees_Troy <dees_troy@teamw.in>2012-09-26 19:12:09 +0200
commita2ac96a2f21d533af51cff30693df4936cae417e (patch)
tree87b02493cf7345b74b1b0573506eaad917ee7ca1 /gui/action.cpp
parentBackup size for special partitions that are images (diff)
downloadandroid_bootable_recovery-a2ac96a2f21d533af51cff30693df4936cae417e.tar
android_bootable_recovery-a2ac96a2f21d533af51cff30693df4936cae417e.tar.gz
android_bootable_recovery-a2ac96a2f21d533af51cff30693df4936cae417e.tar.bz2
android_bootable_recovery-a2ac96a2f21d533af51cff30693df4936cae417e.tar.lz
android_bootable_recovery-a2ac96a2f21d533af51cff30693df4936cae417e.tar.xz
android_bootable_recovery-a2ac96a2f21d533af51cff30693df4936cae417e.tar.zst
android_bootable_recovery-a2ac96a2f21d533af51cff30693df4936cae417e.zip
Diffstat (limited to 'gui/action.cpp')
-rw-r--r--gui/action.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/gui/action.cpp b/gui/action.cpp
index 80a582c6c..75d6c4764 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -27,7 +27,6 @@
extern "C" {
#include "../common.h"
-#include "../roots.h"
#include "../tw_reboot.h"
#include "../minuitwrp/minui.h"
#include "../recovery_ui.h"
@@ -827,8 +826,17 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
// Below seen in Koush's recovery
char sddevice[256];
char mkdir_path[255];
- Volume *vol = volume_for_path("/sdcard");
- strcpy(sddevice, vol->device);
+#ifdef TW_EXTERNAL_STORAGE_PATH
+ TWPartition* SDCard = PartitionManager.Find_Partition_By_Path(EXPAND(TW_EXTERNAL_STORAGE_PATH));
+#else
+ TWPartition* SDCard = PartitionManager.Find_Partition_By_Path("/sdcard");
+#endif
+ if (SDCard == NULL) {
+ LOGE("Unable to locate device to partition.\n");
+ operation_end(1, simulate);
+ return 0;
+ }
+ strcpy(sddevice, SDCard->Actual_Block_Device.c_str());
// Just need block not whole partition
sddevice[strlen("/dev/block/mmcblkX")] = '\0';