Don\'t fail if a key we want to delete is already deleted
am: ab0b56aef3
Change-Id: I08920a3e330443e7466f0acc924cd21dbebba4c4
diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp
index 09c33a0..7d65364 100644
--- a/Ext4Crypt.cpp
+++ b/Ext4Crypt.cpp
@@ -534,7 +534,12 @@
for (auto const path: get_ce_key_paths(get_ce_key_directory_path(user_id))) {
success &= android::vold::destroyKey(path);
}
- success &= android::vold::destroyKey(get_de_key_path(user_id));
+ auto de_key_path = get_de_key_path(user_id);
+ if (path_exists(de_key_path)) {
+ success &= android::vold::destroyKey(de_key_path);
+ } else {
+ LOG(INFO) << "Not present so not erasing: " << de_key_path;
+ }
}
return success;
}