summaryrefslogtreecommitdiffstats
path: root/partition.cpp
diff options
context:
space:
mode:
authorKjell Braden <k.twrp@brdn.eu>2016-06-19 18:58:15 +0200
committerDees Troy <dees_troy@teamw.in>2016-08-22 16:51:30 +0200
commit3126a113e7f45f54bb2475b1145a0467ae508308 (patch)
tree74fec3c471875c0d45397f77a65d4b12b30ef277 /partition.cpp
parentAdd git revision to startup message in recovery.log (diff)
downloadandroid_bootable_recovery-3126a113e7f45f54bb2475b1145a0467ae508308.tar
android_bootable_recovery-3126a113e7f45f54bb2475b1145a0467ae508308.tar.gz
android_bootable_recovery-3126a113e7f45f54bb2475b1145a0467ae508308.tar.bz2
android_bootable_recovery-3126a113e7f45f54bb2475b1145a0467ae508308.tar.lz
android_bootable_recovery-3126a113e7f45f54bb2475b1145a0467ae508308.tar.xz
android_bootable_recovery-3126a113e7f45f54bb2475b1145a0467ae508308.tar.zst
android_bootable_recovery-3126a113e7f45f54bb2475b1145a0467ae508308.zip
Diffstat (limited to 'partition.cpp')
-rw-r--r--partition.cpp11
1 files changed, 6 insertions, 5 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;