Get app info with correct user id.

- when querying app info from package manager, we should use the methods
that takes the user id so that it will work properly with managed
profile.

Change-Id: Ifc84d3a29aaf7b2c1acfa096596a53f1715cc908
Fixes: 117222623
Test: make RunSettingsRoboTests
This commit is contained in:
Doris Ling
2018-10-11 16:37:32 -07:00
parent b3eaf62562
commit b9ff5892ca
12 changed files with 65 additions and 23 deletions

View File

@@ -58,7 +58,7 @@ public class DefaultEmergencyPicker extends DefaultAppPickerFragment {
final PackageInfo packageInfo =
mPm.getPackageInfo(info.activityInfo.packageName, 0);
final ApplicationInfo appInfo = packageInfo.applicationInfo;
candidates.add(new DefaultAppInfo(context, mPm, appInfo));
candidates.add(new DefaultAppInfo(context, mPm, mUserId, appInfo));
// Get earliest installed system app.
if (isSystemApp(appInfo) && (bestMatch == null ||
bestMatch.firstInstallTime > packageInfo.firstInstallTime)) {