use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by LineageOS.
the class DashboardFragment method onPreferenceTreeClick.
@Override
public boolean onPreferenceTreeClick(Preference preference) {
Collection<AbstractPreferenceController> controllers = mPreferenceControllers.values();
// If preference contains intent, log it before handling.
mMetricsFeatureProvider.logDashboardStartIntent(getContext(), preference.getIntent(), getMetricsCategory());
// Give all controllers a chance to handle click.
for (AbstractPreferenceController controller : controllers) {
if (controller.handlePreferenceTreeClick(preference)) {
return true;
}
}
return super.onPreferenceTreeClick(preference);
}
use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by LineageOS.
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);
}
}
use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by LineageOS.
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 LineageOS.
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;
}
use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by LineageOS.
the class ConfigureWifiSettings method getPreferenceControllers.
@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
final NetworkScoreManagerWrapper networkScoreManagerWrapper = new NetworkScoreManagerWrapper(context.getSystemService(NetworkScoreManager.class));
mWifiWakeupPreferenceController = new WifiWakeupPreferenceController(context, getLifecycle());
mUseOpenWifiPreferenceController = new UseOpenWifiPreferenceController(context, this, networkScoreManagerWrapper, getLifecycle());
final WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(mWifiWakeupPreferenceController);
controllers.add(new NetworkScorerPickerPreferenceController(context, networkScoreManagerWrapper));
controllers.add(new NotifyOpenNetworksPreferenceController(context, getLifecycle()));
controllers.add(mUseOpenWifiPreferenceController);
controllers.add(new WifiInfoPreferenceController(context, getLifecycle(), wifiManager));
controllers.add(new CellularFallbackPreferenceController(context));
controllers.add(new WifiP2pPreferenceController(context, getLifecycle(), wifiManager));
controllers.add(new WifiCallingPreferenceController(context));
controllers.add(new WpsPreferenceController(context, getLifecycle(), wifiManager, getFragmentManager()));
return controllers;
}
Aggregations