partitionmanager: don't treat non-existing logical partitions
* As per google no. logical partitions can be increased or decreased.
* eg. some devices updated to vendor_dlkm or odm_dlkm but their stock doesn't.
* Fixes:
No more error on device with vendor_dlkm in recovery fstab
Mounting in custom OS.
Change-Id: Ibb5019808ef4f69ff421b57aaeb24d91b8d34cef
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
(cherry picked from commit 787cc61439dd5bb77dfadd22462f27cc72d2f9db)
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index a848300..f44544d 100755
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -301,8 +301,8 @@
else
(*iter)->Has_Android_Secure = false;
- if ((*iter)->Is_Super)
- Prepare_Super_Volume((*iter));
+ if ((*iter)->Is_Super && !Prepare_Super_Volume(*iter))
+ Partitions.erase(iter--);
}
Unlock_Block_Partitions();
@@ -3426,6 +3426,7 @@
if ((*iter)->Is_Super) {
if (!Prepare_Super_Volume(*iter)) {
status = false;
+ Partitions.erase(iter--);
}
PartitionManager.Output_Partition(*iter);
}