From 3b38337be16d3d55fad547636257cf3074eda8b9 Mon Sep 17 00:00:00 2001 From: John Wu Date: Wed, 9 Feb 2022 02:21:39 -0800 Subject: Fix data migration after appId change App profile directories are stored in DE storage, not CE. Run the profile dir chown migration at the correct timing. Test: manual Bug: 217762162 Change-Id: If725e70f8ff12d9f374ca38fac1ef870a98708a9 --- cmds/installd/InstalldNativeService.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp index c3256fcfff..544c69c2a7 100644 --- a/cmds/installd/InstalldNativeService.cpp +++ b/cmds/installd/InstalldNativeService.cpp @@ -698,9 +698,6 @@ binder::Status InstalldNativeService::createAppDataLocked( if (!status.isOk()) { return status; } - if (previousUid != uid) { - chown_app_profile_dir(packageName, appId, userId); - } // Remember inode numbers of cache directories so that we can clear // contents while CE storage is locked @@ -726,6 +723,9 @@ binder::Status InstalldNativeService::createAppDataLocked( if (!status.isOk()) { return status; } + if (previousUid != uid) { + chown_app_profile_dir(packageName, appId, userId); + } if (!prepare_app_profile_dir(packageName, appId, userId)) { return error("Failed to prepare profiles for " + packageName); -- cgit v1.2.3