diff options
author | Alan Stokes <alanstokes@google.com> | 2020-02-14 14:36:58 +0000 |
---|---|---|
committer | Luca Stefani <luca.stefani.ge1@gmail.com> | 2020-04-27 12:08:53 +0200 |
commit | eca1b5e0e8b974c0ce15bfef5b86c68982b82e8c (patch) | |
tree | f130e69bcf3662618c5a1e02453d4ddb7d611e6a | |
parent | 4fa74a4f1c9333df08a0add8ba2f0bdbc6407b18 (diff) | |
download | android_frameworks_native-eca1b5e0e8b974c0ce15bfef5b86c68982b82e8c.tar.gz android_frameworks_native-eca1b5e0e8b974c0ce15bfef5b86c68982b82e8c.tar.bz2 android_frameworks_native-eca1b5e0e8b974c0ce15bfef5b86c68982b82e8c.zip |
Don't destroy ART profiles after package move.
They don't get moved, so instead of deleting a redundant copy we are
deleting the only copy.
Bug: 149200535
Test: Manual. After repro steps in bug app is moved, profiles are not
deleted.
Change-Id: I3589588cafde77828113547953d5916ba3beb557
Merged-In: I3589588cafde77828113547953d5916ba3beb557
-rw-r--r-- | cmds/installd/InstalldNativeService.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp index 695426a0a..e6de4f02f 100644 --- a/cmds/installd/InstalldNativeService.cpp +++ b/cmds/installd/InstalldNativeService.cpp @@ -678,11 +678,13 @@ binder::Status InstalldNativeService::destroyAppData(const std::unique_ptr<std:: if (delete_dir_contents_and_dir(path) != 0) { res = error("Failed to delete " + path); } - destroy_app_current_profiles(packageName, userId); - // TODO(calin): If the package is still installed by other users it's probably - // beneficial to keep the reference profile around. - // Verify if it's ok to do that. - destroy_app_reference_profile(packageName); + if ((flags & FLAG_CLEAR_APP_DATA_KEEP_ART_PROFILES) == 0) { + destroy_app_current_profiles(packageName, userId); + // TODO(calin): If the package is still installed by other users it's probably + // beneficial to keep the reference profile around. + // Verify if it's ok to do that. + destroy_app_reference_profile(packageName); + } } if (flags & FLAG_STORAGE_EXTERNAL) { std::lock_guard<std::recursive_mutex> lock(mMountsLock); |