Don't spam the log when there's no mapped device.
This avoids writing "Destroying [] from device mapper" to log.
Test: TreeHugger
Change-Id: I5f8a0a62823a682d5a4511162c3731cc7d87fb9d
diff --git a/dynamic_partition_control_android.cc b/dynamic_partition_control_android.cc
index d9d3be5..7f9c793 100644
--- a/dynamic_partition_control_android.cc
+++ b/dynamic_partition_control_android.cc
@@ -165,6 +165,9 @@
}
void DynamicPartitionControlAndroid::CleanupInternal(bool wait) {
+ if (mapped_devices_.empty()) {
+ return;
+ }
// UnmapPartitionOnDeviceMapper removes objects from mapped_devices_, hence
// a copy is needed for the loop.
std::set<std::string> mapped = mapped_devices_;