diff options
author | Dees_Troy <dees_troy@teamw.in> | 2012-11-14 23:27:31 +0100 |
---|---|---|
committer | Dees_Troy <dees_troy@teamw.in> | 2012-11-15 20:27:08 +0100 |
commit | 16b74353d99615b4acbb60f3fbe49f4443e0365f (patch) | |
tree | f4e4f76c1522d809646d213b6f54ab948b3a9a1e /data.cpp | |
parent | add exfat to partitions.cpp (diff) | |
download | android_bootable_recovery-16b74353d99615b4acbb60f3fbe49f4443e0365f.tar android_bootable_recovery-16b74353d99615b4acbb60f3fbe49f4443e0365f.tar.gz android_bootable_recovery-16b74353d99615b4acbb60f3fbe49f4443e0365f.tar.bz2 android_bootable_recovery-16b74353d99615b4acbb60f3fbe49f4443e0365f.tar.lz android_bootable_recovery-16b74353d99615b4acbb60f3fbe49f4443e0365f.tar.xz android_bootable_recovery-16b74353d99615b4acbb60f3fbe49f4443e0365f.tar.zst android_bootable_recovery-16b74353d99615b4acbb60f3fbe49f4443e0365f.zip |
Diffstat (limited to '')
-rw-r--r-- | data.cpp | 43 |
1 files changed, 19 insertions, 24 deletions
@@ -446,6 +446,18 @@ void DataManager::update_tz_environment_variables(void) { tzset(); } +void DataManager::SetBackupFolder() +{ + string str = GetCurrentStoragePath(); + str += "/TWRP/BACKUPS/"; + + string dev_id; + GetValue("device_id", dev_id); + + str += dev_id; + SetValue(TW_BACKUPS_FOLDER_VAR, str, 0); +} + void DataManager::SetDefaultValues() { string str, path; @@ -475,7 +487,7 @@ void DataManager::SetDefaultValues() LOGI("Internal path defined: '%s'\n", EXPAND(TW_INTERNAL_STORAGE_PATH)); mValues.insert(make_pair(TW_USE_EXTERNAL_STORAGE, make_pair("0", 1))); mConstValues.insert(make_pair(TW_HAS_INTERNAL, "1")); - mConstValues.insert(make_pair(TW_INTERNAL_PATH, EXPAND(TW_INTERNAL_STORAGE_PATH))); + mValues.insert(make_pair(TW_INTERNAL_PATH, make_pair(EXPAND(TW_INTERNAL_STORAGE_PATH), 0))); mConstValues.insert(make_pair(TW_INTERNAL_LABEL, EXPAND(TW_INTERNAL_STORAGE_MOUNT_POINT))); path.clear(); path = "/"; @@ -530,7 +542,7 @@ void DataManager::SetDefaultValues() // Device has /data/media mConstValues.insert(make_pair(TW_USE_EXTERNAL_STORAGE, "0")); mConstValues.insert(make_pair(TW_HAS_INTERNAL, "1")); - mConstValues.insert(make_pair(TW_INTERNAL_PATH, "/data/media")); + mValues.insert(make_pair(TW_INTERNAL_PATH, make_pair("/data/media", 0))); mConstValues.insert(make_pair(TW_INTERNAL_MOUNT, "/data")); mConstValues.insert(make_pair(TW_INTERNAL_LABEL, "data")); #ifdef TW_EXTERNAL_STORAGE_PATH @@ -547,7 +559,7 @@ void DataManager::SetDefaultValues() // Device has no internal storage mConstValues.insert(make_pair(TW_USE_EXTERNAL_STORAGE, "1")); mConstValues.insert(make_pair(TW_HAS_INTERNAL, "0")); - mConstValues.insert(make_pair(TW_INTERNAL_PATH, "0")); + mValues.insert(make_pair(TW_INTERNAL_PATH, make_pair("0", 0))); mConstValues.insert(make_pair(TW_INTERNAL_MOUNT, "0")); mConstValues.insert(make_pair(TW_INTERNAL_LABEL, "0")); #endif @@ -580,6 +592,10 @@ void DataManager::SetDefaultValues() LOGI("Defaulting to external storage.\n"); #endif +#ifdef RECOVERY_SDCARD_ON_DATA + if (PartitionManager.Mount_By_Path("/data", false) && TWFunc::Path_Exists("/data/media/0")) + SetValue(TW_INTERNAL_PATH, "/data/media/0"); +#endif str = GetCurrentStoragePath(); #ifdef RECOVERY_SDCARD_ON_DATA #ifndef TW_EXTERNAL_STORAGE_PATH @@ -889,27 +905,6 @@ void DataManager::ReadSettingsFile(void) } else { PartitionManager.Mount_Current_Storage(true); } - if (has_data_media == 1) { - if (has_dual == 0) { - LOGI("Mounting /data/media to /sdcard\n"); - system("umount /sdcard"); - system("mount /data/media /sdcard"); - } else { - string ext_path; - - GetValue(TW_EXTERNAL_PATH, ext_path); - if (ext_path == "/sdcard") { - LOGI("Mounting /data/media to /emmc\n"); - system("cd / && mkdir emmc"); - system("umount /emmc"); - system("mount /data/media /emmc"); - } else { - LOGI("Mounting /data/media to /sdcard\n"); - system("umount /sdcard"); - system("mount /data/media /sdcard"); - } - } - } if (has_ext) { string ext_path; |