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
diff --git a/partition.cpp b/partition.cpp
index c511298..df03336 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -1224,10 +1224,10 @@
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;
}