use of com.android.settings.applications.UserAppInfo in project android_packages_apps_Settings by crdroidandroid.
the class ApplicationListPreferenceController method onListOfAppsResult.
@Override
public void onListOfAppsResult(List<UserAppInfo> result) {
final PreferenceScreen screen = mParent.getPreferenceScreen();
if (screen == null) {
return;
}
final Context prefContext = mParent.getPreferenceManager().getContext();
for (int position = 0; position < result.size(); position++) {
final UserAppInfo item = result.get(position);
final Preference preference = new Preference(prefContext);
preference.setLayoutResource(R.layout.preference_app);
preference.setTitle(item.appInfo.loadLabel(mPm));
preference.setIcon(item.appInfo.loadIcon(mPm));
preference.setOrder(position);
preference.setSelectable(false);
screen.addPreference(preference);
}
}
use of com.android.settings.applications.UserAppInfo in project android_packages_apps_Settings by crdroidandroid.
the class EnterpriseSetDefaultAppsPreferenceControllerTest method setEnterpriseSetDefaultApps.
private void setEnterpriseSetDefaultApps(Intent[] intents, int number) {
final ApplicationInfo appInfo = new ApplicationInfo();
appInfo.packageName = "app";
for (int i = 0; i < number; i++) {
final List<UserAppInfo> apps = new ArrayList<>(number);
apps.add(new UserAppInfo(new UserInfo(i, "user." + i, UserInfo.FLAG_ADMIN), appInfo));
when(mFeatureFactory.applicationFeatureProvider.findPersistentPreferredActivities(eq(i), argThat(matchesIntents(intents)))).thenReturn(apps);
}
}
use of com.android.settings.applications.UserAppInfo in project platform_packages_apps_Settings by BlissRoms.
the class ApplicationListPreferenceController method onListOfAppsResult.
@Override
public void onListOfAppsResult(List<UserAppInfo> result) {
final PreferenceScreen screen = mParent.getPreferenceScreen();
if (screen == null) {
return;
}
final Context prefContext = mParent.getPreferenceManager().getContext();
for (int position = 0; position < result.size(); position++) {
final UserAppInfo item = result.get(position);
final Preference preference = new Preference(prefContext);
preference.setLayoutResource(R.layout.preference_app);
preference.setTitle(item.appInfo.loadLabel(mPm));
preference.setIcon(item.appInfo.loadIcon(mPm));
preference.setOrder(position);
preference.setSelectable(false);
screen.addPreference(preference);
}
}
use of com.android.settings.applications.UserAppInfo in project platform_packages_apps_Settings by BlissRoms.
the class EnterpriseSetDefaultAppsPreferenceControllerTest method setEnterpriseSetDefaultApps.
private void setEnterpriseSetDefaultApps(Intent[] intents, int number) {
final ApplicationInfo appInfo = new ApplicationInfo();
appInfo.packageName = "app";
for (int i = 0; i < number; i++) {
final List<UserAppInfo> apps = new ArrayList<>(number);
apps.add(new UserAppInfo(new UserInfo(i, "user." + i, UserInfo.FLAG_ADMIN), appInfo));
when(mFeatureFactory.applicationFeatureProvider.findPersistentPreferredActivities(eq(i), argThat(matchesIntents(intents)))).thenReturn(apps);
}
}
use of com.android.settings.applications.UserAppInfo in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class EnterpriseSetDefaultAppsPreferenceControllerTest method setEnterpriseSetDefaultApps.
private void setEnterpriseSetDefaultApps(Intent[] intents, int number) {
final ApplicationInfo appInfo = new ApplicationInfo();
appInfo.packageName = "app";
for (int i = 0; i < number; i++) {
final List<UserAppInfo> apps = new ArrayList<>(number);
apps.add(new UserAppInfo(new UserInfo(i, "user." + i, UserInfo.FLAG_ADMIN), appInfo));
when(mFeatureFactory.applicationFeatureProvider.findPersistentPreferredActivities(eq(i), argThat(matchesIntents(intents)))).thenReturn(apps);
}
}
Aggregations