From fcf3f24856c599c922880c64b01b7610603f958c Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Tue, 16 Feb 2016 12:30:26 -0600 Subject: Fix adopted storage when andsec flag is present Change-Id: If903d838abc920f952f243482338188c15bb1dbf --- partitionmanager.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'partitionmanager.cpp') diff --git a/partitionmanager.cpp b/partitionmanager.cpp index 1c59de7f0..cc090cf4b 100644 --- a/partitionmanager.cpp +++ b/partitionmanager.cpp @@ -2413,3 +2413,16 @@ void TWPartitionManager::Decrypt_Adopted() { return; #endif } + +void TWPartitionManager::Remove_Partition_By_Path(string Path) { + std::vector::iterator iter; + string Local_Path = TWFunc::Get_Root_Path(Path); + + for (iter = Partitions.begin(); iter != Partitions.end(); iter++) { + if ((*iter)->Mount_Point == Local_Path || (!(*iter)->Symlink_Mount_Point.empty() && (*iter)->Symlink_Mount_Point == Local_Path)) { + LOGINFO("Found and erasing '%s' from partition list\n", Local_Path.c_str()); + Partitions.erase(iter); + return; + } + } +} -- cgit v1.2.3