Revert Android.bp changes.
Aparently they are causing device reboots.
Bug: 219588776
Bug: 219650739
Test: android.host.multiuser.EphemeralTest#testRemoveUserWhenPossible_currentUserSetEphemeral_removeAfterSwitch
Change-Id: I030b9529c16945b5ef87c9087fe4d0fd90fc1865
diff --git a/cmds/installd/utils.cpp b/cmds/installd/utils.cpp
index 8a00be9..faccded 100644
--- a/cmds/installd/utils.cpp
+++ b/cmds/installd/utils.cpp
@@ -637,8 +637,12 @@
return delete_dir_contents(temp_dir_path.c_str(), 1, exclusion_predicate, ignore_if_missing);
}
-bool is_renamed_deleted_dir(std::string_view path) {
- return path.ends_with(deletedSuffix);
+bool is_renamed_deleted_dir(const std::string& path) {
+ if (path.size() < deletedSuffix.size()) {
+ return false;
+ }
+ std::string_view pathSuffix{path.c_str() + path.size() - deletedSuffix.size()};
+ return pathSuffix == deletedSuffix;
}
int rename_delete_dir_contents_and_dir(const std::string& pathname, bool ignore_if_missing) {