Skip to content
Commit 7b977f31 authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Taking userId into account for fixupAppDir().

We previously used the getPackage(packageName) API, which doesn't take
the userId into account; this could result in passing in the wrong uid
into fixupAppDir(), because fixupAppDir() validates the passed in uid
matches with the path.

Instead, use PackageManager.getPackageUidAsUser() to match the userId
that was passed in through the path.

Note that we don't care about paths which don't have a userId embedded,
since those are public volumes, for which we don't need this API anyway
(since public volumes don't have UID/GID etc.)

Bug: 157271022
Test: pm create-user aap ; log in to user, try selecting ringtones
Change-Id: Id8731cb18c16c4742d232048f9093fbd57323159
parent 38e3d616
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment