summaryrefslogtreecommitdiffstats
path: root/data.cpp
diff options
context:
space:
mode:
authorVojtech Bocek <vbocek@gmail.com>2014-05-12 15:41:52 +0200
committerGerrit Code Review <gerrit2@gerrit>2014-05-31 14:26:12 +0200
commit93cb1ef2ebd480acf9f49af9da0990aed71f49a5 (patch)
tree27cf02d99c7010418b807d795ee3a9e98ef1b3de /data.cpp
parentFix multiple lun file USB mounting (diff)
downloadandroid_bootable_recovery-93cb1ef2ebd480acf9f49af9da0990aed71f49a5.tar
android_bootable_recovery-93cb1ef2ebd480acf9f49af9da0990aed71f49a5.tar.gz
android_bootable_recovery-93cb1ef2ebd480acf9f49af9da0990aed71f49a5.tar.bz2
android_bootable_recovery-93cb1ef2ebd480acf9f49af9da0990aed71f49a5.tar.lz
android_bootable_recovery-93cb1ef2ebd480acf9f49af9da0990aed71f49a5.tar.xz
android_bootable_recovery-93cb1ef2ebd480acf9f49af9da0990aed71f49a5.tar.zst
android_bootable_recovery-93cb1ef2ebd480acf9f49af9da0990aed71f49a5.zip
Diffstat (limited to 'data.cpp')
-rw-r--r--data.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/data.cpp b/data.cpp
index 7be0b03e8..72018f9aa 100644
--- a/data.cpp
+++ b/data.cpp
@@ -280,7 +280,9 @@ error:
fclose(in);
string current = GetCurrentStoragePath();
TWPartition* Part = PartitionManager.Find_Partition_By_Path(current);
- if (current != Part->Storage_Path && Part->Mount(false)) {
+ if(!Part)
+ Part = PartitionManager.Get_Default_Storage_Partition();
+ if (Part && current != Part->Storage_Path && Part->Mount(false)) {
LOGINFO("LoadValues setting storage path to '%s'\n", Part->Storage_Path.c_str());
SetValue("tw_storage_path", Part->Storage_Path);
} else {
@@ -586,11 +588,16 @@ void DataManager::SetDefaultValues()
mConstValues.insert(make_pair("false", "0"));
mConstValues.insert(make_pair(TW_VERSION_VAR, TW_VERSION_STR));
- mValues.insert(make_pair("tw_storage_path", make_pair("/", 1)));
mValues.insert(make_pair("tw_button_vibrate", make_pair("80", 1)));
mValues.insert(make_pair("tw_keyboard_vibrate", make_pair("40", 1)));
mValues.insert(make_pair("tw_action_vibrate", make_pair("160", 1)));
+ TWPartition *store = PartitionManager.Get_Default_Storage_Partition();
+ if(store)
+ mValues.insert(make_pair("tw_storage_path", make_pair(store->Storage_Path.c_str(), 1)));
+ else
+ mValues.insert(make_pair("tw_storage_path", make_pair("/", 1)));
+
#ifdef TW_FORCE_CPUINFO_FOR_DEVICE_ID
printf("TW_FORCE_CPUINFO_FOR_DEVICE_ID := true\n");
#endif