Allow users to pick a notification assistant.
Test: manual. select and deselect an assistant, and verify that the assistant can and then cannot get notification events. Change-Id: If89c77f37170a44c827f997631aa7413da5a83e2
This commit is contained in:
@@ -201,14 +201,21 @@ public class AppListPreference extends CustomListPreference {
|
||||
try {
|
||||
ActivityInfo activityInfo = AppGlobals.getPackageManager().getActivityInfo(
|
||||
componentNames[i], 0, mUserId);
|
||||
if (activityInfo == null) continue;
|
||||
applicationNames.add(activityInfo.loadLabel(pm));
|
||||
validatedComponentNames.add(componentNames[i].flattenToString());
|
||||
entryDrawables.add(activityInfo.loadIcon(pm));
|
||||
if (activityInfo != null) {
|
||||
applicationNames.add(activityInfo.loadLabel(pm));
|
||||
validatedComponentNames.add(componentNames[i].flattenToString());
|
||||
entryDrawables.add(activityInfo.loadIcon(pm));
|
||||
} else {
|
||||
ApplicationInfo appInfo = pm.getApplicationInfoAsUser(
|
||||
componentNames[i].getPackageName().toString(), 0, mUserId);
|
||||
applicationNames.add(appInfo.loadLabel(pm));
|
||||
validatedComponentNames.add(componentNames[i].flattenToString());
|
||||
entryDrawables.add(appInfo.loadIcon(pm));
|
||||
}
|
||||
if (defaultCN != null && componentNames[i].equals(defaultCN)) {
|
||||
selectedIndex = i;
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
} catch (RemoteException|NameNotFoundException e) {
|
||||
// Skip unknown packages.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user