Search in sources :

Example 56 with AbstractPreferenceController

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

Example 57 with AbstractPreferenceController

use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by SudaMod.

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 58 with AbstractPreferenceController

use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by SudaMod.

the class AppAndNotificationDashboardFragment method buildPreferenceControllers.

private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, Application app, Fragment host) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    controllers.add(new EmergencyBroadcastPreferenceController(context, "app_and_notif_cell_broadcast_settings"));
    controllers.add(new SpecialAppAccessPreferenceController(context));
    controllers.add(new AppPermissionsPreferenceController(context));
    controllers.add(new RecentAppsPreferenceController(context, app, host));
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) EmergencyBroadcastPreferenceController(com.android.settings.notification.EmergencyBroadcastPreferenceController) ArrayList(java.util.ArrayList)

Example 59 with AbstractPreferenceController

use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by SudaMod.

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 60 with AbstractPreferenceController

use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by SudaMod.

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

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