diff options
author | Calin Juravle | 2016-03-23 08:49:06 -0500 |
---|---|---|
committer | Android (Google) Code Review | 2016-03-23 08:49:06 -0500 |
commit | 5b817549fcea6f58bbeaaffbf654ddd8751ebbdc (patch) | |
tree | 904204047cd9fd441e1a043b4aa9922a44ac5fbe /cmds | |
parent | 2376b4e1cb9a24d0d7dcd1d57458261610818ef5 (diff) | |
parent | caa6b809a5ed024a8f3f551c5c109a5ad50ab772 (diff) | |
download | frameworks-native-5b817549fcea6f58bbeaaffbf654ddd8751ebbdc.tar.gz frameworks-native-5b817549fcea6f58bbeaaffbf654ddd8751ebbdc.tar.xz frameworks-native-5b817549fcea6f58bbeaaffbf654ddd8751ebbdc.zip |
Merge "Delete the entire profile directory when the app is uninstalled" into nyc-dev
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/installd/commands.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/cmds/installd/commands.cpp b/cmds/installd/commands.cpp index 77bcfc241..47c78c3c1 100644 --- a/cmds/installd/commands.cpp +++ b/cmds/installd/commands.cpp | |||
@@ -222,6 +222,14 @@ int clear_app_data(const char *uuid, const char *pkgname, userid_t userid, int f | |||
222 | return res; | 222 | return res; |
223 | } | 223 | } |
224 | 224 | ||
225 | static int destroy_app_profiles(const char *pkgname, userid_t userid) { | ||
226 | // TODO: this doesn't destroy the marks for foreign dex use yet. | ||
227 | int res = 0; | ||
228 | res |= delete_dir_contents_and_dir(create_data_user_profile_package_path( userid, pkgname)); | ||
229 | res |= delete_dir_contents_and_dir(create_data_ref_profile_package_path(pkgname)); | ||
230 | return res; | ||
231 | } | ||
232 | |||
225 | int destroy_app_data(const char *uuid, const char *pkgname, userid_t userid, int flags) { | 233 | int destroy_app_data(const char *uuid, const char *pkgname, userid_t userid, int flags) { |
226 | int res = 0; | 234 | int res = 0; |
227 | if (flags & FLAG_STORAGE_CE) { | 235 | if (flags & FLAG_STORAGE_CE) { |
@@ -229,10 +237,9 @@ int destroy_app_data(const char *uuid, const char *pkgname, userid_t userid, int | |||
229 | create_data_user_package_path(uuid, userid, pkgname)); | 237 | create_data_user_package_path(uuid, userid, pkgname)); |
230 | } | 238 | } |
231 | if (flags & FLAG_STORAGE_DE) { | 239 | if (flags & FLAG_STORAGE_DE) { |
232 | // TODO: include result once 25796509 is fixed | 240 | res |= delete_dir_contents_and_dir( |
233 | delete_dir_contents_and_dir( | ||
234 | create_data_user_de_package_path(uuid, userid, pkgname)); | 241 | create_data_user_de_package_path(uuid, userid, pkgname)); |
235 | unlink_all_profiles(pkgname); | 242 | res |= destroy_app_profiles(pkgname, userid); |
236 | } | 243 | } |
237 | return res; | 244 | return res; |
238 | } | 245 | } |