use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by omnirom.
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));
controllers.add(new AmbientDisplayMusicController(context));
return controllers;
}
use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by omnirom.
the class PowerUsageSummary method getPreferenceControllers.
@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
mBatteryHeaderPreferenceController = new BatteryHeaderPreferenceController(context, getActivity(), this, /* host */
getLifecycle());
controllers.add(mBatteryHeaderPreferenceController);
// controllers.add(new AutoBrightnessPreferenceController(context, KEY_AUTO_BRIGHTNESS));
// controllers.add(new TimeoutPreferenceController(context, KEY_SCREEN_TIMEOUT));
controllers.add(new BatterySaverController(context, getLifecycle()));
controllers.add(new BatteryPercentagePreferenceController(context));
controllers.add(new BatteryImagePreferenceController(context));
/*controllers.add(new AmbientDisplayPreferenceController(
context,
new AmbientDisplayConfiguration(context),
KEY_AMBIENT_DISPLAY));*/
return controllers;
}
use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by omnirom.
the class DatabaseIndexingUtils method getPreferenceControllerUriMap.
/**
* @param className which wil provide the map between from {@link Uri}s to
* {@link PreferenceControllerMixin}
* @param context
* @return A map between {@link Uri}s and {@link PreferenceControllerMixin}s to get the payload
* types for Settings.
*/
public static Map<String, PreferenceControllerMixin> getPreferenceControllerUriMap(String className, Context context) {
if (context == null) {
return null;
}
final Class<?> clazz = getIndexableClass(className);
if (clazz == null) {
/*Log.d(TAG, "SearchIndexableResource '" + className +
"' should implement the " + Indexable.class.getName() + " interface!");*/
return null;
}
// Will be non null only for a Local provider implementing a
// SEARCH_INDEX_DATA_PROVIDER field
final Indexable.SearchIndexProvider provider = getSearchIndexProvider(clazz);
List<AbstractPreferenceController> controllers = provider.getPreferenceControllers(context);
if (controllers == null) {
return null;
}
ArrayMap<String, PreferenceControllerMixin> map = new ArrayMap<>();
for (AbstractPreferenceController controller : controllers) {
if (controller instanceof PreferenceControllerMixin) {
map.put(controller.getPreferenceKey(), (PreferenceControllerMixin) controller);
} else {
throw new IllegalStateException(controller.getClass().getName() + " must implement " + PreferenceControllerMixin.class.getName());
}
}
return map;
}
use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by omnirom.
the class SystemDashboardFragment method buildPreferenceControllers.
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new SystemUpdatePreferenceController(context, UserManager.get(context)));
controllers.add(new AdditionalSystemUpdatePreferenceController(context));
controllers.add(new BackupSettingsActivityPreferenceController(context));
controllers.add(new GesturesSettingPreferenceController(context));
return controllers;
}
use of com.android.settingslib.core.AbstractPreferenceController in project android_packages_apps_Settings by omnirom.
the class LockscreenDashboardFragment method getPreferenceControllers.
@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final Lifecycle lifecycle = getLifecycle();
final LockScreenNotificationPreferenceController notificationController = new LockScreenNotificationPreferenceController(context, KEY_LOCK_SCREEN_NOTIFICATON, KEY_LOCK_SCREEN_NOTIFICATON_WORK_PROFILE_HEADER, KEY_LOCK_SCREEN_NOTIFICATON_WORK_PROFILE);
lifecycle.addObserver(notificationController);
controllers.add(notificationController);
/*final AddUserWhenLockedPreferenceController addUserWhenLockedController =
new AddUserWhenLockedPreferenceController(context);
lifecycle.addObserver(addUserWhenLockedController);
controllers.add(addUserWhenLockedController);*/
mOwnerInfoPreferenceController = new OwnerInfoPreferenceController(context, this, lifecycle);
controllers.add(mOwnerInfoPreferenceController);
return controllers;
}
Aggregations