Adapt to behavior change in MATCH_UNINSTALLED_PACKAGES

Don't use the PM flag to reach across users.
If retrieving labels, etc., use MATCH_ANY_USER, since
several Settings screens show work profile apps as well.

Bug: 31000380
Test: Manual test of affected screens
Change-Id: Ib6f981ae8443f640276d395c37247c8c0b610894
This commit is contained in:
Amith Yamasani
2016-11-01 15:49:21 -07:00
parent 7aad8a97a4
commit 21556cdba1
10 changed files with 23 additions and 22 deletions

View File

@@ -41,7 +41,7 @@ public abstract class AppCounter extends AsyncTask<Void, Void, Integer> {
final List<ApplicationInfo> list =
mPm.getInstalledApplicationsAsUser(PackageManager.GET_DISABLED_COMPONENTS
| PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS
| (user.isAdmin() ? PackageManager.GET_UNINSTALLED_PACKAGES : 0),
| (user.isAdmin() ? PackageManager.MATCH_ANY_USER : 0),
user.id);
for (ApplicationInfo info : list) {
if (includeInCount(info)) {