diff options
author | Dees_Troy <dees_troy@teamw.in> | 2013-01-23 19:50:52 +0100 |
---|---|---|
committer | Dees_Troy <dees_troy@teamw.in> | 2013-01-24 20:45:54 +0100 |
commit | 6a042c84430ce5df773d50770b480a46a920f7a3 (patch) | |
tree | dc1b71734f696f293d0750f6729b00698b85aee9 /data.cpp | |
parent | change tar create to pthread (diff) | |
download | android_bootable_recovery-6a042c84430ce5df773d50770b480a46a920f7a3.tar android_bootable_recovery-6a042c84430ce5df773d50770b480a46a920f7a3.tar.gz android_bootable_recovery-6a042c84430ce5df773d50770b480a46a920f7a3.tar.bz2 android_bootable_recovery-6a042c84430ce5df773d50770b480a46a920f7a3.tar.lz android_bootable_recovery-6a042c84430ce5df773d50770b480a46a920f7a3.tar.xz android_bootable_recovery-6a042c84430ce5df773d50770b480a46a920f7a3.tar.zst android_bootable_recovery-6a042c84430ce5df773d50770b480a46a920f7a3.zip |
Diffstat (limited to '')
-rw-r--r-- | data.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -675,9 +675,23 @@ void DataManager::SetDefaultValues() mConstValues.insert(make_pair(TW_DONT_UNMOUNT_SYSTEM, "0")); #endif #ifdef TW_NO_USB_STORAGE + printf("TW_NO_USB_STORAGE := true\n"); mConstValues.insert(make_pair(TW_HAS_USB_STORAGE, "0")); #else - mConstValues.insert(make_pair(TW_HAS_USB_STORAGE, "1")); + char lun_file[255]; + string Lun_File_str = CUSTOM_LUN_FILE; + size_t found = Lun_File_str.find("%"); + if (found != string::npos) { + sprintf(lun_file, CUSTOM_LUN_FILE, 0); + Lun_File_str = lun_file; + } + if (!TWFunc::Path_Exists(Lun_File_str)) { + LOGI("Lun file '%s' does not exist, USB storage mode disabled\n", Lun_File_str.c_str()); + mConstValues.insert(make_pair(TW_HAS_USB_STORAGE, "0")); + } else { + LOGI("Lun file '%s'\n", Lun_File_str.c_str()); + mConstValues.insert(make_pair(TW_HAS_USB_STORAGE, "1")); + } #endif #ifdef TW_INCLUDE_INJECTTWRP mConstValues.insert(make_pair(TW_HAS_INJECTTWRP, "1")); |