use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by crdroidandroid.
the class ManageAssist method buildPreferenceControllers.
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, Lifecycle lifecycle) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new DefaultAssistPreferenceController(context, "default_assist", true));
controllers.add(new AssistGestureSettingsPreferenceController(context, lifecycle, KEY_ASSIST, true));
controllers.add(new AssistContextPreferenceController(context, lifecycle));
controllers.add(new AssistScreenshotPreferenceController(context, lifecycle));
controllers.add(new AssistFlashScreenPreferenceController(context, lifecycle));
controllers.add(new DefaultVoiceInputPreferenceController(context, lifecycle));
return controllers;
}
use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by crdroidandroid.
the class SecondaryUserControllerTest method dontAddPrimaryProfileAsASecondaryProfile.
@Test
public void dontAddPrimaryProfileAsASecondaryProfile() throws Exception {
ArrayList<UserInfo> userInfos = new ArrayList<>();
// The primary UserInfo may be a different object with a different name... but represent the
// same user!
UserInfo primaryUserRenamed = new UserInfo();
primaryUserRenamed.name = "Owner";
primaryUserRenamed.flags = UserInfo.FLAG_PRIMARY;
userInfos.add(primaryUserRenamed);
when(mUserManager.getPrimaryUser()).thenReturn(mPrimaryUser);
when(mUserManager.getUsers()).thenReturn(userInfos);
List<AbstractPreferenceController> controllers = SecondaryUserController.getSecondaryUserControllers(mContext, mUserManager);
assertThat(controllers).hasSize(1);
// We should have the NoSecondaryUserController.
assertThat(controllers.get(0) instanceof SecondaryUserController).isFalse();
}
use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by crdroidandroid.
the class DateTimeSettings method getPreferenceControllers.
@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final Activity activity = getActivity();
final Intent intent = activity.getIntent();
final boolean isFromSUW = intent.getBooleanExtra(EXTRA_IS_FROM_SUW, false);
final AutoTimeZonePreferenceController autoTimeZonePreferenceController = new AutoTimeZonePreferenceController(activity, this, /* UpdateTimeAndDateCallback */
isFromSUW);
final AutoTimePreferenceController autoTimePreferenceController = new AutoTimePreferenceController(activity, this);
controllers.add(autoTimeZonePreferenceController);
controllers.add(autoTimePreferenceController);
controllers.add(new TimeFormatPreferenceController(activity, this, /* UpdateTimeAndDateCallback */
isFromSUW));
controllers.add(new TimeZonePreferenceController(activity, autoTimeZonePreferenceController));
controllers.add(new TimePreferenceController(activity, this, /* UpdateTimeAndDateCallback */
autoTimePreferenceController));
controllers.add(new DatePreferenceController(activity, this, /* UpdateTimeAndDateCallback */
autoTimePreferenceController));
return controllers;
}
use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by crdroidandroid.
the class ConfigureNotificationSettings method buildPreferenceControllers.
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, Lifecycle lifecycle) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final BadgingNotificationPreferenceController badgeController = new BadgingNotificationPreferenceController(context);
final PulseNotificationPreferenceController pulseController = new PulseNotificationPreferenceController(context);
final LockScreenNotificationPreferenceController lockScreenNotificationController = new LockScreenNotificationPreferenceController(context, KEY_LOCKSCREEN, KEY_LOCKSCREEN_WORK_PROFILE_HEADER, KEY_LOCKSCREEN_WORK_PROFILE);
if (lifecycle != null) {
lifecycle.addObserver(pulseController);
lifecycle.addObserver(lockScreenNotificationController);
}
controllers.add(new SwipeToNotificationPreferenceController(context, lifecycle, KEY_SWIPE_DOWN));
controllers.add(badgeController);
controllers.add(pulseController);
controllers.add(lockScreenNotificationController);
controllers.add(new NotificationRingtonePreferenceController(context) {
@Override
public String getPreferenceKey() {
return KEY_NOTI_DEFAULT_RINGTONE;
}
});
return controllers;
}
use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by crdroidandroid.
the class NetworkDashboardFragment method buildPreferenceControllers.
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, Lifecycle lifecycle, MetricsFeatureProvider metricsFeatureProvider, Fragment fragment, MobilePlanPreferenceHost mobilePlanHost) {
final AirplaneModePreferenceController airplaneModePreferenceController = new AirplaneModePreferenceController(context, fragment);
final MobilePlanPreferenceController mobilePlanPreferenceController = new MobilePlanPreferenceController(context, mobilePlanHost);
final WifiMasterSwitchPreferenceController wifiPreferenceController = new WifiMasterSwitchPreferenceController(context, metricsFeatureProvider);
final MobileNetworkPreferenceController mobileNetworkPreferenceController = new MobileNetworkPreferenceController(context);
final VpnPreferenceController vpnPreferenceController = new VpnPreferenceController(context);
if (lifecycle != null) {
lifecycle.addObserver(airplaneModePreferenceController);
lifecycle.addObserver(mobilePlanPreferenceController);
lifecycle.addObserver(wifiPreferenceController);
lifecycle.addObserver(mobileNetworkPreferenceController);
lifecycle.addObserver(vpnPreferenceController);
}
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(airplaneModePreferenceController);
controllers.add(mobileNetworkPreferenceController);
controllers.add(new TetherPreferenceController(context, lifecycle));
controllers.add(vpnPreferenceController);
controllers.add(new ProxyPreferenceController(context));
controllers.add(mobilePlanPreferenceController);
controllers.add(wifiPreferenceController);
return controllers;
}
Aggregations