partitions: Mount storage for MTP after wipe

Conditionally run Add_MTP_Storage() after wipe if:
1) is wiped successfully
2) is storage (already implemented)
3) mount succeeds

Previous to this commit, Add_MTP_Storage() was called before mounting
storage, which fails. Mounting storage right after wipe should not be
a problem since Update_System_Details() does it anyways (and doesn't
complain if already mounted).

Change-Id: I8a5a78d5ac9181f3a9464dfe6b77284458f9868b
This commit is contained in:
Matt Mower
2016-01-20 12:08:35 -06:00
committed by Ethan Yonker
parent 6168f0c9c3
commit 209c963575
+3 -3
View File
@@ -1224,10 +1224,10 @@ bool TWPartition::Wipe(string New_File_System) {
if (Has_Data_Media && recreate_media) {
Recreate_Media_Folder();
}
if (Is_Storage && Mount(false))
PartitionManager.Add_MTP_Storage(MTP_Storage_ID);
}
if (Is_Storage) {
PartitionManager.Add_MTP_Storage(MTP_Storage_ID);
}
return wiped;
}