Search in sources :

Example 6 with WifiMasterSwitchPreferenceController

use of com.android.settings.wifi.WifiMasterSwitchPreferenceController in project android_packages_apps_Settings by DirtyUnicorns.

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)

Aggregations

WifiMasterSwitchPreferenceController (com.android.settings.wifi.WifiMasterSwitchPreferenceController)6 AbstractPreferenceController (com.android.settingslib.core.AbstractPreferenceController)6 ArrayList (java.util.ArrayList)6