Disabled apps should also be shown in restricted profiles app list

If we don't show disabled system apps for toggling, they'll end up
being automatically included in the restricted profile.

Make sure that we also list disabled apps.

Bug: 8713202
Change-Id: I8f2facf496f669dfe963cdabf3d29d393097a80b
This commit is contained in:
Amith Yamasani
2013-04-25 11:03:33 -07:00
parent d346a1ca2d
commit 90dcd7469b

View File

@@ -350,7 +350,8 @@ public class AppRestrictionsFragment extends SettingsPreferenceFragment implemen
private void addSystemApps(List<SelectableAppInfo> visibleApps, Intent intent) { private void addSystemApps(List<SelectableAppInfo> visibleApps, Intent intent) {
if (getActivity() == null) return; if (getActivity() == null) return;
final PackageManager pm = getActivity().getPackageManager(); final PackageManager pm = getActivity().getPackageManager();
List<ResolveInfo> launchableApps = pm.queryIntentActivities(intent, 0); List<ResolveInfo> launchableApps = pm.queryIntentActivities(intent,
PackageManager.GET_DISABLED_COMPONENTS);
for (ResolveInfo app : launchableApps) { for (ResolveInfo app : launchableApps) {
if (app.activityInfo != null && app.activityInfo.applicationInfo != null) { if (app.activityInfo != null && app.activityInfo.applicationInfo != null) {
int flags = app.activityInfo.applicationInfo.flags; int flags = app.activityInfo.applicationInfo.flags;