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);
}
use of com.android.settings.notification.LockScreenNotificationPreferenceController in project android_packages_apps_Settings by SudaMod.
the class SecuritySettings method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Activity activity = getActivity();
mSubscriptionManager = SubscriptionManager.from(activity);
mLockPatternUtils = new LockPatternUtils(activity);
mManagedPasswordProvider = ManagedLockPasswordProvider.get(activity, MY_USER_ID);
mDPM = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE);
mUm = UserManager.get(activity);
mChooseLockSettingsHelper = new ChooseLockSettingsHelper(activity);
mDashboardFeatureProvider = FeatureFactory.getFactory(activity).getDashboardFeatureProvider(activity);
mSecurityFeatureProvider = FeatureFactory.getFactory(activity).getSecurityFeatureProvider();
mTrustAgentManager = mSecurityFeatureProvider.getTrustAgentManager();
if (savedInstanceState != null && savedInstanceState.containsKey(TRUST_AGENT_CLICK_INTENT)) {
mTrustAgentClickIntent = savedInstanceState.getParcelable(TRUST_AGENT_CLICK_INTENT);
}
mManageDeviceAdminPreferenceController = new ManageDeviceAdminPreferenceController(activity);
mEnterprisePrivacyPreferenceController = new EnterprisePrivacyPreferenceController(activity, null);
mLockScreenNotificationPreferenceController = new LockScreenNotificationPreferenceController(activity);
}
use of com.android.settings.notification.LockScreenNotificationPreferenceController in project android_packages_apps_Settings by SudaMod.
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 DirtyUnicorns.
the class SecuritySettings method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Activity activity = getActivity();
mSubscriptionManager = SubscriptionManager.from(activity);
mLockPatternUtils = new LockPatternUtils(activity);
mManagedPasswordProvider = ManagedLockPasswordProvider.get(activity, MY_USER_ID);
mDPM = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE);
mUm = UserManager.get(activity);
mChooseLockSettingsHelper = new ChooseLockSettingsHelper(activity);
mDashboardFeatureProvider = FeatureFactory.getFactory(activity).getDashboardFeatureProvider(activity);
mSecurityFeatureProvider = FeatureFactory.getFactory(activity).getSecurityFeatureProvider();
mTrustAgentManager = mSecurityFeatureProvider.getTrustAgentManager();
if (savedInstanceState != null && savedInstanceState.containsKey(TRUST_AGENT_CLICK_INTENT)) {
mTrustAgentClickIntent = savedInstanceState.getParcelable(TRUST_AGENT_CLICK_INTENT);
}
mManageDeviceAdminPreferenceController = new ManageDeviceAdminPreferenceController(activity);
mEnterprisePrivacyPreferenceController = new EnterprisePrivacyPreferenceController(activity, null);
mLockScreenNotificationPreferenceController = new LockScreenNotificationPreferenceController(activity);
}
use of com.android.settings.notification.LockScreenNotificationPreferenceController in project android_packages_apps_Settings by DirtyUnicorns.
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