diff options
Diffstat (limited to '')
-rw-r--r-- | partition.cpp | 11 | ||||
-rw-r--r-- | partitions.hpp | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/partition.cpp b/partition.cpp index bf87de38a..89650db6c 100644 --- a/partition.cpp +++ b/partition.cpp @@ -836,7 +836,7 @@ void TWPartition::Setup_AndSec(void) { Backup_Path = Symlink_Mount_Point; Make_Dir("/and-sec", true); Recreate_AndSec_Folder(); - Mount_Storage_Retry(); + Mount_Storage_Retry(true); } void TWPartition::Setup_Data_Media() { @@ -900,16 +900,17 @@ void TWPartition::Find_Real_Block_Device(string& Block, bool Display_Error) { } } -void TWPartition::Mount_Storage_Retry(void) { +bool TWPartition::Mount_Storage_Retry(bool Display_Error) { // On some devices, storage doesn't want to mount right away, retry and sleep - if (!Mount(true)) { + if (!Mount(Display_Error)) { int retry_count = 5; while (retry_count > 0 && !Mount(false)) { usleep(500000); retry_count--; } - Mount(true); + return Mount(Display_Error); } + return true; } bool TWPartition::Find_MTD_Block_Device(string MTD_Name) { @@ -2806,7 +2807,7 @@ int TWPartition::Decrypt_Adopted() { Is_Decrypted = true; Is_Encrypted = true; Find_Actual_Block_Device(); - if (!Mount(false)) { + if (!Mount_Storage_Retry(false)) { LOGERR("Failed to mount decrypted adopted storage device\n"); Is_Decrypted = false; Is_Encrypted = false; diff --git a/partitions.hpp b/partitions.hpp index fc600213c..7416fbe4c 100644 --- a/partitions.hpp +++ b/partitions.hpp @@ -165,7 +165,7 @@ private: bool Make_Dir(string Path, bool Display_Error); // Creates a directory if it doesn't already exist bool Find_MTD_Block_Device(string MTD_Name); // Finds the mtd block device based on the name from the fstab void Recreate_AndSec_Folder(void); // Recreates the .android_secure folder - void Mount_Storage_Retry(void); // Tries multiple times with a half second delay to mount a device in case storage is slow to mount + bool Mount_Storage_Retry(bool Display_Error); // Tries multiple times with a half second delay to mount a device in case storage is slow to mount bool Is_Sparse_Image(const string& Filename); // Determines if a file is in sparse image format bool Flash_Sparse_Image(const string& Filename); // Flashes a sparse image using simg2img bool Flash_Image_FI(const string& Filename, ProgressTracking *progress); // Flashes an image to the partition using flash_image for mtd nand |