summaryrefslogtreecommitdiff
path: root/api/api.go
diff options
context:
space:
mode:
author Arnab Sen <arnabse@amazon.com> 2023-09-25 10:40:35 +0530
committer Arnab Sen <arnabse@amazon.com> 2023-10-13 10:34:36 +0530
commitc28359e99033bf70ff5be5adad211a2415359190 (patch)
treeb560d47973b4e735b02823027282f52df1b075bf /api/api.go
parentdf5f4b52189e7d8833c7ceb6a9c52ec9c929aabb (diff)
PM: Use installed userId while moving apps
Currently, MovePackageHelper#movePackageInternal has an parameter for UserHandle which is derived from the process calling PackageManager#movePackage. This causes an issue where the package to be moved was not installed on the calling user, but will be installed for that user after the move. This can also happen if the package is moved via shell command: pm move-package as given in the test section. This CL fixes the issue by using the one of user ids for whom the package has been installed and removes the requirement of deriving the UserHandle. This ensures that the package is installed for the previously installed users only. Also, instead of filtering the app for one user, this CL checks for all installed users. Test: manual 1. Create multiple users apart from system user 2. Make ExternalLocTestApp and install for the non-system user. 3. Mount a sdcard and format as internal. 4. Execute adb shell pm move-package com.android.framework.externalloctestapp <UUID> 5. Check that app is not installed only for the previously installed user Change-Id: I1919b9e15a99a36b1bff3b870dc2a74d4d4621ac
Diffstat (limited to 'api/api.go')
0 files changed, 0 insertions, 0 deletions