use of com.android.settings.notification.LockScreenNotificationPreferenceController in project android_packages_apps_Settings by LineageOS.
the class SecuritySettingsTest method testSetLockscreenPreferencesSummary_shouldSetSummaryFromLockScreenNotification.
@Test
public void testSetLockscreenPreferencesSummary_shouldSetSummaryFromLockScreenNotification() {
final Preference preference = mock(Preference.class);
final PreferenceGroup group = mock(PreferenceGroup.class);
when(group.findPreference(SecuritySettings.KEY_LOCKSCREEN_PREFERENCES)).thenReturn(preference);
final LockScreenNotificationPreferenceController controller = mock(LockScreenNotificationPreferenceController.class);
final SecuritySettings securitySettings = new SecuritySettings();
ReflectionHelpers.setField(securitySettings, "mLockScreenNotificationPreferenceController", controller);
when(controller.getSummaryResource()).thenReturn(1234);
securitySettings.setLockscreenPreferencesSummary(group);
verify(preference).setSummary(1234);
}
use of com.android.settings.notification.LockScreenNotificationPreferenceController in project android_packages_apps_Settings by LineageOS.
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;
}
use of com.android.settings.notification.LockScreenNotificationPreferenceController 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;
}
use of com.android.settings.notification.LockScreenNotificationPreferenceController in project android_packages_apps_Settings by omnirom.
the class SecuritySettingsTest method testSetLockscreenPreferencesSummary_shouldSetSummaryFromLockScreenNotification.
@Test
public void testSetLockscreenPreferencesSummary_shouldSetSummaryFromLockScreenNotification() {
final Preference preference = mock(Preference.class);
final PreferenceGroup group = mock(PreferenceGroup.class);
when(group.findPreference(SecuritySettings.KEY_LOCKSCREEN_PREFERENCES)).thenReturn(preference);
final LockScreenNotificationPreferenceController controller = mock(LockScreenNotificationPreferenceController.class);
final SecuritySettings securitySettings = new SecuritySettings();
ReflectionHelpers.setField(securitySettings, "mLockScreenNotificationPreferenceController", controller);
when(controller.getSummaryResource()).thenReturn(1234);
securitySettings.setLockscreenPreferencesSummary(group);
verify(preference).setSummary(1234);
}
use of com.android.settings.notification.LockScreenNotificationPreferenceController in project android_packages_apps_Settings by SudaMod.
the class SecuritySettingsTest method testSetLockscreenPreferencesSummary_shouldSetSummaryFromLockScreenNotification.
@Test
public void testSetLockscreenPreferencesSummary_shouldSetSummaryFromLockScreenNotification() {
final Preference preference = mock(Preference.class);
final PreferenceGroup group = mock(PreferenceGroup.class);
when(group.findPreference(SecuritySettings.KEY_LOCKSCREEN_PREFERENCES)).thenReturn(preference);
final LockScreenNotificationPreferenceController controller = mock(LockScreenNotificationPreferenceController.class);
final SecuritySettings securitySettings = new SecuritySettings();
ReflectionHelpers.setField(securitySettings, "mLockScreenNotificationPreferenceController", controller);
when(controller.getSummaryResource()).thenReturn(1234);
securitySettings.setLockscreenPreferencesSummary(group);
verify(preference).setSummary(1234);
}
Aggregations