Remove dead code: TW_HAS_DUAL_STORAGE
Nothing sets TW_HAS_DUAL_STORAGE. Remove this dead code. Change-Id: Id5d10c9ee3883dad6beef69e09d16b0f1350c91d
This commit is contained in:
@@ -523,13 +523,7 @@ int DataManager::SetValue(const string varName, int value, int persist /* = 0 */
|
||||
if (varName == "tw_use_external_storage") {
|
||||
string str;
|
||||
|
||||
if (GetIntValue(TW_HAS_DUAL_STORAGE) == 1) {
|
||||
if (value == 0) {
|
||||
str = GetStrValue(TW_INTERNAL_PATH);
|
||||
} else {
|
||||
str = GetStrValue(TW_EXTERNAL_PATH);
|
||||
}
|
||||
} else if (GetIntValue(TW_HAS_INTERNAL) == 1)
|
||||
if (GetIntValue(TW_HAS_INTERNAL) == 1)
|
||||
str = GetStrValue(TW_INTERNAL_PATH);
|
||||
else
|
||||
str = GetStrValue(TW_EXTERNAL_PATH);
|
||||
|
||||
+2
-28
@@ -1395,34 +1395,8 @@ void TWPartitionManager::Update_System_Details(void) {
|
||||
if (FreeStorage != NULL) {
|
||||
// Attempt to mount storage
|
||||
if (!FreeStorage->Mount(false)) {
|
||||
// We couldn't mount storage... check to see if we have dual storage
|
||||
int has_dual_storage;
|
||||
DataManager::GetValue(TW_HAS_DUAL_STORAGE, has_dual_storage);
|
||||
if (has_dual_storage == 1) {
|
||||
// We have dual storage, see if we're using the internal storage that should always be present
|
||||
if (current_storage_path == DataManager::GetSettingsStoragePath()) {
|
||||
if (!FreeStorage->Is_Encrypted) {
|
||||
// Not able to use internal, so error!
|
||||
gui_msg(Msg(msg::kError, "unable_to_mount_internal=Unable to mount internal_storage"));
|
||||
}
|
||||
DataManager::SetValue(TW_STORAGE_FREE_SIZE, 0);
|
||||
} else {
|
||||
// We were using external, flip to internal
|
||||
DataManager::SetValue(TW_USE_EXTERNAL_STORAGE, 0);
|
||||
current_storage_path = DataManager::GetCurrentStoragePath();
|
||||
FreeStorage = Find_Partition_By_Path(current_storage_path);
|
||||
if (FreeStorage != NULL) {
|
||||
DataManager::SetValue(TW_STORAGE_FREE_SIZE, (int)(FreeStorage->Free / 1048576LLU));
|
||||
} else {
|
||||
gui_msg(Msg(msg::kError, "unable_to_locate=Unable to locate {1}")("internal storage partition"));
|
||||
DataManager::SetValue(TW_STORAGE_FREE_SIZE, 0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// No dual storage and unable to mount storage, error!
|
||||
gui_msg(Msg(msg::kError, "unable_to_mount_storage=Unable to mount storage"));
|
||||
DataManager::SetValue(TW_STORAGE_FREE_SIZE, 0);
|
||||
}
|
||||
gui_msg(Msg(msg::kError, "unable_to_mount_storage=Unable to mount storage"));
|
||||
DataManager::SetValue(TW_STORAGE_FREE_SIZE, 0);
|
||||
} else {
|
||||
DataManager::SetValue(TW_STORAGE_FREE_SIZE, (int)(FreeStorage->Free / 1048576LLU));
|
||||
}
|
||||
|
||||
@@ -111,7 +111,6 @@
|
||||
#define TW_REBOOT_POWEROFF "tw_reboot_poweroff"
|
||||
#define TW_REBOOT_BOOTLOADER "tw_reboot_bootloader"
|
||||
|
||||
#define TW_HAS_DUAL_STORAGE "tw_has_dual_storage"
|
||||
#define TW_USE_EXTERNAL_STORAGE "tw_use_external_storage"
|
||||
#define TW_HAS_INTERNAL "tw_has_internal"
|
||||
#define TW_INTERNAL_PATH "tw_internal_path" // /data/media or /internal
|
||||
|
||||
Reference in New Issue
Block a user