diff options
| author | 2022-02-16 18:19:09 +0000 | |
|---|---|---|
| committer | 2022-02-16 18:19:09 +0000 | |
| commit | 013d28fcb24121c143cb1a8bf6edc12b37dc5b88 (patch) | |
| tree | a502492043c51e8101ace1deefd34914a72f5409 | |
| parent | 27d4680ba2e0f580a4be58f4efd922ed9b11cdee (diff) | |
| parent | 89c9e9524e2b3a19a6e2fb5937f00fc36cf9e451 (diff) | |
Merge "Remove rename/delete for external storage." am: a4419eb57a am: d8eb94c8df am: 89c9e9524e
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1984351
Change-Id: I19444593cd316dcfb611c38b2ba6f510ba9ccfb9
| -rw-r--r-- | cmds/installd/InstalldNativeService.cpp | 16 | ||||
| -rw-r--r-- | cmds/installd/utils.h | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp index f0dcd02920..afe46f503a 100644 --- a/cmds/installd/InstalldNativeService.cpp +++ b/cmds/installd/InstalldNativeService.cpp @@ -994,15 +994,15 @@ binder::Status InstalldNativeService::destroyAppData(const std::optional<std::st } auto path = StringPrintf("%s/Android/data/%s", extPath.c_str(), pkgname); - if (rename_delete_dir_contents_and_dir(path, true) != 0) { + if (delete_dir_contents_and_dir(path, true) != 0) { res = error("Failed to delete contents of " + path); } path = StringPrintf("%s/Android/media/%s", extPath.c_str(), pkgname); - if (rename_delete_dir_contents_and_dir(path, true) != 0) { + if (delete_dir_contents_and_dir(path, true) != 0) { res = error("Failed to delete contents of " + path); } path = StringPrintf("%s/Android/obb/%s", extPath.c_str(), pkgname); - if (rename_delete_dir_contents_and_dir(path, true) != 0) { + if (delete_dir_contents_and_dir(path, true) != 0) { res = error("Failed to delete contents of " + path); } } @@ -1550,27 +1550,27 @@ binder::Status InstalldNativeService::destroyUserData(const std::optional<std::s binder::Status res = ok(); if (flags & FLAG_STORAGE_DE) { auto path = create_data_user_de_path(uuid_, userId); - if (rename_delete_dir_contents_and_dir(path, true) != 0) { + if (delete_dir_contents_and_dir(path, true) != 0) { res = error("Failed to delete " + path); } if (uuid_ == nullptr) { path = create_data_misc_legacy_path(userId); - if (rename_delete_dir_contents_and_dir(path, true) != 0) { + if (delete_dir_contents_and_dir(path, true) != 0) { res = error("Failed to delete " + path); } path = create_primary_cur_profile_dir_path(userId); - if (rename_delete_dir_contents_and_dir(path, true) != 0) { + if (delete_dir_contents_and_dir(path, true) != 0) { res = error("Failed to delete " + path); } } } if (flags & FLAG_STORAGE_CE) { auto path = create_data_user_ce_path(uuid_, userId); - if (rename_delete_dir_contents_and_dir(path, true) != 0) { + if (delete_dir_contents_and_dir(path, true) != 0) { res = error("Failed to delete " + path); } path = findDataMediaPath(uuid, userId); - if (rename_delete_dir_contents_and_dir(path, true) != 0) { + if (delete_dir_contents_and_dir(path, true) != 0) { res = error("Failed to delete " + path); } } diff --git a/cmds/installd/utils.h b/cmds/installd/utils.h index ffde56233e..04f3bc93a6 100644 --- a/cmds/installd/utils.h +++ b/cmds/installd/utils.h @@ -121,7 +121,7 @@ int delete_dir_contents(const std::string& pathname, bool ignore_if_missing = fa int delete_dir_contents_and_dir(const std::string& pathname, bool ignore_if_missing = false); bool is_renamed_deleted_dir(std::string_view path); -int rename_delete_dir_contents_and_dir(const std::string& pathname, bool ignore_if_missing = false); +int rename_delete_dir_contents_and_dir(const std::string& pathname, bool ignore_if_missing = true); void cleanup_invalid_package_dirs_under_path(const std::string& pathname); |