Search in sources :

Example 96 with AbstractPreferenceController

use of com.android.settingslib.core.AbstractPreferenceController in project platform_packages_apps_Settings by BlissRoms.

the class AmbientDisplaySettings method buildPreferenceControllers.

private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, Lifecycle lifecycle, AmbientDisplayConfiguration config, MetricsFeatureProvider metricsFeatureProvider, AmbientDisplayAlwaysOnPreferenceController.OnPreferenceChangedCallback aodCallback) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    controllers.add(new AmbientDisplayNotificationsPreferenceController(context, config, metricsFeatureProvider));
    controllers.add(new AmbientDisplayAlwaysOnPreferenceController(context, config, aodCallback));
    controllers.add(new DoubleTapScreenPreferenceController(context, lifecycle, config, MY_USER_ID, KEY_AMBIENT_DISPLAY_DOUBLE_TAP));
    controllers.add(new PickupGesturePreferenceController(context, lifecycle, config, MY_USER_ID, KEY_AMBIENT_DISPLAY_PICK_UP));
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) ArrayList(java.util.ArrayList) DoubleTapScreenPreferenceController(com.android.settings.gestures.DoubleTapScreenPreferenceController) PickupGesturePreferenceController(com.android.settings.gestures.PickupGesturePreferenceController)

Example 97 with AbstractPreferenceController

use of com.android.settingslib.core.AbstractPreferenceController in project platform_packages_apps_Settings by BlissRoms.

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;
}
Also used : WifiMasterSwitchPreferenceController(com.android.settings.wifi.WifiMasterSwitchPreferenceController) AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) ArrayList(java.util.ArrayList)

Example 98 with AbstractPreferenceController

use of com.android.settingslib.core.AbstractPreferenceController in project platform_packages_apps_Settings by BlissRoms.

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));
    controllers.add(new BlissVersionPreferenceController(context));
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) ArrayList(java.util.ArrayList) BlissVersionPreferenceController(com.android.settings.deviceinfo.BlissVersionPreferenceController) ManualPreferenceController(com.android.settings.deviceinfo.ManualPreferenceController) SecurityPatchPreferenceController(com.android.settings.deviceinfo.SecurityPatchPreferenceController) BasebandVersionPreferenceController(com.android.settings.deviceinfo.BasebandVersionPreferenceController) AdditionalSystemUpdatePreferenceController(com.android.settings.deviceinfo.AdditionalSystemUpdatePreferenceController) KernelVersionPreferenceController(com.android.settings.deviceinfo.KernelVersionPreferenceController) FccEquipmentIdPreferenceController(com.android.settings.deviceinfo.FccEquipmentIdPreferenceController) BuildNumberPreferenceController(com.android.settings.deviceinfo.BuildNumberPreferenceController) FeedbackPreferenceController(com.android.settings.deviceinfo.FeedbackPreferenceController) FirmwareVersionPreferenceController(com.android.settings.deviceinfo.FirmwareVersionPreferenceController) SafetyInfoPreferenceController(com.android.settings.deviceinfo.SafetyInfoPreferenceController) SELinuxStatusPreferenceController(com.android.settings.deviceinfo.SELinuxStatusPreferenceController) DeviceModelPreferenceController(com.android.settings.deviceinfo.DeviceModelPreferenceController)

Example 99 with AbstractPreferenceController

use of com.android.settingslib.core.AbstractPreferenceController in project platform_packages_apps_Settings by BlissRoms.

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;
}
Also used : ScreenSaverPreferenceController(com.android.settings.display.ScreenSaverPreferenceController) AutoBrightnessPreferenceController(com.android.settings.display.AutoBrightnessPreferenceController) BrightnessLevelPreferenceController(com.android.settings.display.BrightnessLevelPreferenceController) AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) VrDisplayPreferenceController(com.android.settings.display.VrDisplayPreferenceController) ArrayList(java.util.ArrayList) CameraGesturePreferenceController(com.android.settings.display.CameraGesturePreferenceController) TimeoutPreferenceController(com.android.settings.display.TimeoutPreferenceController) AmbientDisplayConfiguration(com.android.internal.hardware.AmbientDisplayConfiguration) AutoRotatePreferenceController(com.android.settings.display.AutoRotatePreferenceController) ThemePreferenceController(com.android.settings.display.ThemePreferenceController) TapToWakePreferenceController(com.android.settings.display.TapToWakePreferenceController) AmbientDisplayPreferenceController(com.android.settings.display.AmbientDisplayPreferenceController) LiftToWakePreferenceController(com.android.settings.display.LiftToWakePreferenceController) NightModePreferenceController(com.android.settings.display.NightModePreferenceController) ColorModePreferenceController(com.android.settings.display.ColorModePreferenceController) FontSizePreferenceController(com.android.settings.display.FontSizePreferenceController) WallpaperPreferenceController(com.android.settings.display.WallpaperPreferenceController) NightDisplayPreferenceController(com.android.settings.display.NightDisplayPreferenceController)

Example 100 with AbstractPreferenceController

use of com.android.settingslib.core.AbstractPreferenceController in project platform_packages_apps_Settings by BlissRoms.

the class DashboardFragment method displayResourceTiles.

/**
 * Displays resource based tiles.
 */
private void displayResourceTiles() {
    final int resId = getPreferenceScreenResId();
    if (resId <= 0) {
        return;
    }
    addPreferencesFromResource(resId);
    final PreferenceScreen screen = getPreferenceScreen();
    Collection<AbstractPreferenceController> controllers = mPreferenceControllers.values();
    for (AbstractPreferenceController controller : controllers) {
        controller.displayPreference(screen);
    }
}
Also used : PreferenceScreen(android.support.v7.preference.PreferenceScreen) AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController)

Aggregations

AbstractPreferenceController (com.android.settingslib.core.AbstractPreferenceController)298 ArrayList (java.util.ArrayList)211 Test (org.junit.Test)75 Context (android.content.Context)29 Lifecycle (com.android.settingslib.core.lifecycle.Lifecycle)29 UserInfo (android.content.pm.UserInfo)28 SettingsActivity (com.android.settings.SettingsActivity)15 StorageManager (android.os.storage.StorageManager)14 StorageItemPreferenceController (com.android.settings.deviceinfo.storage.StorageItemPreferenceController)14 StorageManagerVolumeProvider (com.android.settingslib.deviceinfo.StorageManagerVolumeProvider)14 PreferenceScreen (android.support.v7.preference.PreferenceScreen)12 AdditionalSystemUpdatePreferenceController (com.android.settings.deviceinfo.AdditionalSystemUpdatePreferenceController)12 TimeoutPreferenceController (com.android.settings.display.TimeoutPreferenceController)10 Activity (android.app.Activity)9 AmbientDisplayConfiguration (com.android.internal.hardware.AmbientDisplayConfiguration)9 AmbientDisplayPreferenceController (com.android.settings.display.AmbientDisplayPreferenceController)9 AutoBrightnessPreferenceController (com.android.settings.display.AutoBrightnessPreferenceController)9 Config (org.robolectric.annotation.Config)7 Bundle (android.os.Bundle)6 SecondaryUserController (com.android.settings.deviceinfo.storage.SecondaryUserController)6