use of com.android.settings.applications.defaultapps.DefaultAppInfo in project platform_packages_apps_Settings by BlissRoms.
the class ShortcutServicePickerFragment method getCandidates.
@Override
protected List<? extends DefaultAppInfo> getCandidates() {
final AccessibilityManager accessibilityManager = getContext().getSystemService(AccessibilityManager.class);
final List<AccessibilityServiceInfo> installedServices = accessibilityManager.getInstalledAccessibilityServiceList();
final int numInstalledServices = installedServices.size();
List<DefaultAppInfo> candidates = new ArrayList<>(numInstalledServices);
for (int i = 0; i < numInstalledServices; i++) {
AccessibilityServiceInfo installedServiceInfo = installedServices.get(i);
candidates.add(new DefaultAppInfo(mPm, UserHandle.myUserId(), installedServiceInfo.getComponentName(), (String) installedServiceInfo.loadSummary(mPm.getPackageManager()), true));
}
return candidates;
}
use of com.android.settings.applications.defaultapps.DefaultAppInfo in project platform_packages_apps_Settings by BlissRoms.
the class WebViewAppPicker method getCandidates.
@Override
protected List<DefaultAppInfo> getCandidates() {
final List<DefaultAppInfo> packageInfoList = new ArrayList<DefaultAppInfo>();
List<ApplicationInfo> pkgs = getWebViewUpdateServiceWrapper().getValidWebViewApplicationInfos(getContext());
for (ApplicationInfo ai : pkgs) {
packageInfoList.add(createDefaultAppInfo(mPm, ai, getDisabledReason(getWebViewUpdateServiceWrapper(), getContext(), ai.packageName)));
}
return packageInfoList;
}
use of com.android.settings.applications.defaultapps.DefaultAppInfo in project platform_packages_apps_Settings by BlissRoms.
the class WebViewAppPickerTest method testEnabledPackageShowsEmptySummary.
@Test
public void testEnabledPackageShowsEmptySummary() {
String disabledReason = null;
DefaultAppInfo webviewAppInfo = mPicker.createDefaultAppInfo(mPackageManager, createApplicationInfo(DEFAULT_PACKAGE_NAME), disabledReason);
RadioButtonPreference mockPreference = mock(RadioButtonPreference.class);
mPicker.bindPreference(mockPreference, DEFAULT_PACKAGE_NAME, webviewAppInfo, null);
mPicker.bindPreferenceExtra(mockPreference, DEFAULT_PACKAGE_NAME, webviewAppInfo, null, null);
verify(mockPreference, never()).setSummary(any());
}
use of com.android.settings.applications.defaultapps.DefaultAppInfo in project platform_packages_apps_Settings by BlissRoms.
the class WebViewAppPickerTest method testEnabledPackageShownAsEnabled.
@Test
public void testEnabledPackageShownAsEnabled() {
String disabledReason = "";
DefaultAppInfo webviewAppInfo = mPicker.createDefaultAppInfo(mPackageManager, createApplicationInfo(DEFAULT_PACKAGE_NAME), disabledReason);
RadioButtonPreference mockPreference = mock(RadioButtonPreference.class);
mPicker.bindPreference(mockPreference, DEFAULT_PACKAGE_NAME, webviewAppInfo, null);
mPicker.bindPreferenceExtra(mockPreference, DEFAULT_PACKAGE_NAME, webviewAppInfo, null, null);
verify(mockPreference, times(1)).setEnabled(eq(true));
verify(mockPreference, never()).setEnabled(eq(false));
}
Aggregations