From 209c96357521c9e1ef44f2264e1cd3ff537f4915 Mon Sep 17 00:00:00 2001 From: Matt Mower Date: Wed, 20 Jan 2016 12:08:35 -0600 Subject: 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 --- partition.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'partition.cpp') diff --git a/partition.cpp b/partition.cpp index c511298ec..df03336c4 100644 --- a/partition.cpp +++ b/partition.cpp @@ -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; } -- cgit v1.2.3