Search in sources :

Example 1 with OwnerInfoPreferenceController

use of com.android.settings.security.OwnerInfoPreferenceController in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ScreenLockSettingsTest method onOwnerInfoUpdated_shouldUpdateOwnerInfoController.

@Test
public void onOwnerInfoUpdated_shouldUpdateOwnerInfoController() {
    final Map<Class, List<AbstractPreferenceController>> preferenceControllers = ReflectionHelpers.getField(mSettings, "mPreferenceControllers");
    final OwnerInfoPreferenceController controller = mock(OwnerInfoPreferenceController.class);
    List<AbstractPreferenceController> controllerList = new ArrayList<>();
    controllerList.add(controller);
    preferenceControllers.put(OwnerInfoPreferenceController.class, controllerList);
    mSettings.onOwnerInfoUpdated();
    verify(controller).updateSummary();
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) OwnerInfoPreferenceController(com.android.settings.security.OwnerInfoPreferenceController) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) Test(org.junit.Test)

Example 2 with OwnerInfoPreferenceController

use of com.android.settings.security.OwnerInfoPreferenceController in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class LockStyleSettings method createPreferenceControllers.

@Override
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    final Lifecycle lifecycle = getSettingsLifecycle();
    mOwnerInfoPreferenceController = new OwnerInfoPreferenceController(context, this, lifecycle);
    controllers.add(mOwnerInfoPreferenceController);
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) OwnerInfoPreferenceController(com.android.settings.security.OwnerInfoPreferenceController) ArrayList(java.util.ArrayList)

Example 3 with OwnerInfoPreferenceController

use of com.android.settings.security.OwnerInfoPreferenceController in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ScreenLockSettings method buildPreferenceControllers.

private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, Fragment parent, Lifecycle lifecycle, LockPatternUtils lockPatternUtils) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    controllers.add(new PatternVisiblePreferenceController(context, MY_USER_ID, lockPatternUtils));
    controllers.add(new PatternErrorVisiblePreferenceController(context, MY_USER_ID, lockPatternUtils));
    controllers.add(new PatternDotsVisiblePreferenceController(context, MY_USER_ID, lockPatternUtils));
    controllers.add(new PowerButtonInstantLockPreferenceController(context, MY_USER_ID, lockPatternUtils));
    controllers.add(new DirectlyShowLockPreferenceController(context, MY_USER_ID, lockPatternUtils));
    controllers.add(new LockAfterTimeoutPreferenceController(context, MY_USER_ID, lockPatternUtils));
    controllers.add(new PinScramblePreferenceController(context, MY_USER_ID, lockPatternUtils));
    controllers.add(new QuickUnlockPreferenceController(context, MY_USER_ID, lockPatternUtils));
    controllers.add(new OwnerInfoPreferenceController(context, parent, lifecycle));
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) OwnerInfoPreferenceController(com.android.settings.security.OwnerInfoPreferenceController) ArrayList(java.util.ArrayList)

Example 4 with OwnerInfoPreferenceController

use of com.android.settings.security.OwnerInfoPreferenceController in project android_packages_apps_Settings by omnirom.

the class ScreenLockSettings method buildPreferenceControllers.

private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, DashboardFragment parent, LockPatternUtils lockPatternUtils) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    controllers.add(new PatternVisiblePreferenceController(context, MY_USER_ID, lockPatternUtils));
    controllers.add(new PowerButtonInstantLockPreferenceController(context, MY_USER_ID, lockPatternUtils));
    controllers.add(new LockAfterTimeoutPreferenceController(context, MY_USER_ID, lockPatternUtils));
    controllers.add(new OwnerInfoPreferenceController(context, parent));
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) OwnerInfoPreferenceController(com.android.settings.security.OwnerInfoPreferenceController) ArrayList(java.util.ArrayList)

Example 5 with OwnerInfoPreferenceController

use of com.android.settings.security.OwnerInfoPreferenceController in project android_packages_apps_Settings by omnirom.

the class ScreenLockSettingsTest method onOwnerInfoUpdated_shouldUpdateOwnerInfoController.

@Test
public void onOwnerInfoUpdated_shouldUpdateOwnerInfoController() {
    final Map<Class, List<AbstractPreferenceController>> preferenceControllers = ReflectionHelpers.getField(mSettings, "mPreferenceControllers");
    final OwnerInfoPreferenceController controller = mock(OwnerInfoPreferenceController.class);
    List<AbstractPreferenceController> controllerList = new ArrayList<>();
    controllerList.add(controller);
    preferenceControllers.put(OwnerInfoPreferenceController.class, controllerList);
    mSettings.onOwnerInfoUpdated();
    verify(controller).updateSummary();
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) OwnerInfoPreferenceController(com.android.settings.security.OwnerInfoPreferenceController) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) Test(org.junit.Test)

Aggregations

OwnerInfoPreferenceController (com.android.settings.security.OwnerInfoPreferenceController)5 AbstractPreferenceController (com.android.settingslib.core.AbstractPreferenceController)5 ArrayList (java.util.ArrayList)5 List (java.util.List)2 Test (org.junit.Test)2 Lifecycle (com.android.settingslib.core.lifecycle.Lifecycle)1