use of com.android.settings.wifi.details2.WifiMeteredPreferenceController2 in project android_packages_apps_Settings by omnirom.
the class WifiNetworkDetailsFragment method createPreferenceControllers.
@Override
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
mControllers = new ArrayList<>();
final ConnectivityManager cm = context.getSystemService(ConnectivityManager.class);
setupNetworksDetailTracker();
final WifiEntry wifiEntry = mNetworkDetailsTracker.getWifiEntry();
final WifiSecondSummaryController2 wifiSecondSummaryController2 = new WifiSecondSummaryController2(context);
wifiSecondSummaryController2.setWifiEntry(wifiEntry);
mControllers.add(wifiSecondSummaryController2);
mWifiDetailPreferenceController2 = WifiDetailPreferenceController2.newInstance(wifiEntry, cm, context, this, // UI thread.
new Handler(Looper.getMainLooper()), getSettingsLifecycle(), context.getSystemService(WifiManager.class), mMetricsFeatureProvider);
mControllers.add(mWifiDetailPreferenceController2);
final WifiAutoConnectPreferenceController2 wifiAutoConnectPreferenceController2 = new WifiAutoConnectPreferenceController2(context);
wifiAutoConnectPreferenceController2.setWifiEntry(wifiEntry);
mControllers.add(wifiAutoConnectPreferenceController2);
final AddDevicePreferenceController2 addDevicePreferenceController2 = new AddDevicePreferenceController2(context);
addDevicePreferenceController2.setWifiEntry(wifiEntry);
mControllers.add(addDevicePreferenceController2);
final WifiMeteredPreferenceController2 meteredPreferenceController2 = new WifiMeteredPreferenceController2(context, wifiEntry);
mControllers.add(meteredPreferenceController2);
final WifiPrivacyPreferenceController2 privacyController2 = new WifiPrivacyPreferenceController2(context);
privacyController2.setWifiEntry(wifiEntry);
mControllers.add(privacyController2);
final WifiSubscriptionDetailPreferenceController2 wifiSubscriptionDetailPreferenceController2 = new WifiSubscriptionDetailPreferenceController2(context);
wifiSubscriptionDetailPreferenceController2.setWifiEntry(wifiEntry);
mControllers.add(wifiSubscriptionDetailPreferenceController2);
// Sets callback listener for wifi dialog.
mWifiDialogListeners.add(mWifiDetailPreferenceController2);
mWifiDialogListeners.add(privacyController2);
mWifiDialogListeners.add(meteredPreferenceController2);
return mControllers;
}
Aggregations