Skip to content
Commit 33f942c2 authored by Aseem Kumar's avatar Aseem Kumar
Browse files

Use `android` as packageName instead of `null` for methods

used by system to fetch accounts.

When `null` is used with getAccountsFromCache method, there is
conversion from calling UID to packageName (call getPackageNameForUid in
filterAccounts), and then another conversion using packageName to UID in
resolveAccountVisbility). Sometimes (as determined by PackageManager), a package which is installed in primary profile but is not installed in work profile is used to fetch accounts for work profile. This causes fetching accounts in work profile to fail.

The fix uses "android" as packageName for all methods used by system
process. This ensures that this conversion always works.

Test: atest AccountManagerServiceTest

Bug: 246257147
Change-Id: Id2e4b860f49366db5a85a3fd83b3fedeeabc9cbb
parent 6420c141
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