use of com.android.settingslib.applications.DefaultAppInfo in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class NotificationAssistantPicker method onServicesReloaded.
@Override
public void onServicesReloaded(List<ServiceInfo> services) {
List<CandidateInfo> list = new ArrayList<>();
services.sort(new PackageItemInfo.DisplayNameComparator(mPm));
for (ServiceInfo service : services) {
if (mContext.getPackageManager().checkPermission(android.Manifest.permission.REQUEST_NOTIFICATION_ASSISTANT_SERVICE, service.packageName) == PackageManager.PERMISSION_GRANTED) {
final ComponentName cn = new ComponentName(service.packageName, service.name);
list.add(new DefaultAppInfo(mContext, mPm, mUserId, cn));
}
}
list.add(new CandidateNone(mContext));
mCandidateInfos = list;
}
use of com.android.settingslib.applications.DefaultAppInfo in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WebViewAppPicker method getCandidates.
@Override
protected List<DefaultAppInfo> getCandidates() {
final List<DefaultAppInfo> packageInfoList = new ArrayList<DefaultAppInfo>();
final Context context = getContext();
final WebViewUpdateServiceWrapper webViewUpdateService = getWebViewUpdateServiceWrapper();
final List<ApplicationInfo> pkgs = webViewUpdateService.getValidWebViewApplicationInfos(context);
for (ApplicationInfo ai : pkgs) {
packageInfoList.add(createDefaultAppInfo(context, mPm, ai, getDisabledReason(webViewUpdateService, context, ai.packageName)));
}
return packageInfoList;
}
use of com.android.settingslib.applications.DefaultAppInfo in project android_packages_apps_Settings by omnirom.
the class BugReportHandlerPicker method getCandidates.
@Override
protected List<DefaultAppInfo> getCandidates() {
final Context context = getContext();
final List<Pair<ApplicationInfo, Integer>> validBugReportHandlerInfos = getBugReportHandlerUtil().getValidBugReportHandlerInfos(context);
final List<DefaultAppInfo> candidates = new ArrayList<>();
for (Pair<ApplicationInfo, Integer> info : validBugReportHandlerInfos) {
candidates.add(createDefaultAppInfo(context, mPm, info.second, info.first));
}
return candidates;
}
use of com.android.settingslib.applications.DefaultAppInfo in project android_packages_apps_Settings by omnirom.
the class WebViewAppPicker method getCandidates.
@Override
protected List<DefaultAppInfo> getCandidates() {
final List<DefaultAppInfo> packageInfoList = new ArrayList<DefaultAppInfo>();
final Context context = getContext();
final WebViewUpdateServiceWrapper webViewUpdateService = getWebViewUpdateServiceWrapper();
final List<ApplicationInfo> pkgs = webViewUpdateService.getValidWebViewApplicationInfos(context);
for (ApplicationInfo ai : pkgs) {
packageInfoList.add(createDefaultAppInfo(context, mPm, ai, getDisabledReason(webViewUpdateService, context, ai.packageName)));
}
return packageInfoList;
}
use of com.android.settingslib.applications.DefaultAppInfo in project android_packages_apps_Settings by omnirom.
the class WebViewAppPickerTest method testWebViewVersionAddedAfterLabel.
/**
* Ensure that the version name of a WebView package is displayed after its name in the
* preference title.
*/
@Test
public void testWebViewVersionAddedAfterLabel() {
final DefaultAppInfo webviewAppInfo = mPicker.createDefaultAppInfo(mContext, mContext.getPackageManager(), createApplicationInfo(PACKAGE_NAME), "");
final RadioButtonPreference mockPreference = mock(RadioButtonPreference.class);
mPicker.bindPreference(mockPreference, PACKAGE_NAME, webviewAppInfo, null);
mPicker.bindPreferenceExtra(mockPreference, PACKAGE_NAME, webviewAppInfo, null, null);
verify(mockPreference).setTitle(eq(PACKAGE_NAME + " " + PACKAGE_VERSION));
verify(mockPreference).setTitle(any());
}
Aggregations