use of com.android.internal.accessibility.AccessibilityShortcutController.ToggleableFrameworkFeatureInfo in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ShortcutServicePickerFragment method getCandidates.
@Override
protected List<? extends CandidateInfo> getCandidates() {
final Context context = getContext();
final AccessibilityManager accessibilityManager = context.getSystemService(AccessibilityManager.class);
final List<AccessibilityServiceInfo> installedServices = accessibilityManager.getInstalledAccessibilityServiceList();
final int numInstalledServices = installedServices.size();
final List<CandidateInfo> candidates = new ArrayList<>(numInstalledServices);
Map<ComponentName, ToggleableFrameworkFeatureInfo> frameworkFeatureInfoMap = AccessibilityShortcutController.getFrameworkShortcutFeaturesMap();
for (ComponentName componentName : frameworkFeatureInfoMap.keySet()) {
final int iconId;
if (componentName.equals(COLOR_INVERSION_COMPONENT_NAME)) {
iconId = R.drawable.ic_color_inversion;
} else if (componentName.equals(DALTONIZER_COMPONENT_NAME)) {
iconId = R.drawable.ic_daltonizer;
} else {
iconId = R.drawable.empty_icon;
}
candidates.add(new FrameworkCandidateInfo(frameworkFeatureInfoMap.get(componentName), iconId, componentName.flattenToString()));
}
for (int i = 0; i < numInstalledServices; i++) {
candidates.add(new ServiceCandidateInfo(installedServices.get(i)));
}
return candidates;
}
Aggregations