use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by SudaMod.
the class PowerUsageSummary method getPreferenceControllers.
@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
mBatteryHeaderPreferenceController = new BatteryHeaderPreferenceController(context, getActivity(), this, /* host */
getLifecycle());
controllers.add(mBatteryHeaderPreferenceController);
controllers.add(new AutoBrightnessPreferenceController(context, KEY_AUTO_BRIGHTNESS));
controllers.add(new TimeoutPreferenceController(context, KEY_SCREEN_TIMEOUT));
controllers.add(new BatterySaverController(context, getLifecycle()));
controllers.add(new BatteryPercentagePreferenceController(context));
controllers.add(new AmbientDisplayPreferenceController(context, new AmbientDisplayConfiguration(context), KEY_AMBIENT_DISPLAY));
return controllers;
}
use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by SudaMod.
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 SudaMod.
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 SudaMod.
the class DeviceInfoSettings method buildPreferenceControllers.
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, Activity activity, Fragment fragment, Lifecycle lifecycle) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new BuildNumberPreferenceController(context, activity, fragment, lifecycle));
controllers.add(new AdditionalSystemUpdatePreferenceController(context));
controllers.add(new ManualPreferenceController(context));
controllers.add(new FeedbackPreferenceController(fragment, context));
controllers.add(new KernelVersionPreferenceController(context));
controllers.add(new BasebandVersionPreferenceController(context));
controllers.add(new FirmwareVersionPreferenceController(context, lifecycle));
controllers.add(new RegulatoryInfoPreferenceController(context));
controllers.add(new DeviceModelPreferenceController(context, fragment));
controllers.add(new SecurityPatchPreferenceController(context));
controllers.add(new FccEquipmentIdPreferenceController(context));
controllers.add(new SELinuxStatusPreferenceController(context));
controllers.add(new SafetyInfoPreferenceController(context));
return controllers;
}
use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by SudaMod.
the class DisplaySettings method buildPreferenceControllers.
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, Lifecycle lifecycle) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new AutoBrightnessPreferenceController(context, KEY_AUTO_BRIGHTNESS));
// controllers.add(new AutoRotatePreferenceController(context, lifecycle));
controllers.add(new CameraGesturePreferenceController(context));
controllers.add(new FontSizePreferenceController(context));
controllers.add(new LiftToWakePreferenceController(context));
controllers.add(new NightDisplayPreferenceController(context));
controllers.add(new NightModePreferenceController(context));
controllers.add(new ScreenSaverPreferenceController(context));
controllers.add(new AmbientDisplayPreferenceController(context, new AmbientDisplayConfiguration(context), KEY_AMBIENT_DISPLAY));
controllers.add(new TapToWakePreferenceController(context));
controllers.add(new TimeoutPreferenceController(context, KEY_SCREEN_TIMEOUT));
controllers.add(new VrDisplayPreferenceController(context));
controllers.add(new WallpaperPreferenceController(context));
// controllers.add(new ThemePreferenceController(context));
controllers.add(new BrightnessLevelPreferenceController(context, lifecycle));
controllers.add(new ColorModePreferenceController(context));
return controllers;
}
Aggregations