use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by DirtyUnicorns.
the class AssistContextPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
when(mScreen.findPreference(anyString())).thenReturn(mPreference);
mLifecycle = new Lifecycle();
mContext = RuntimeEnvironment.application;
mController = new AssistContextPreferenceController(mContext, mLifecycle);
ReflectionHelpers.setField(mController, "mSettingObserver", mObserver);
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by DirtyUnicorns.
the class LocationPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mLifecycle = new Lifecycle();
mController = new LocationPreferenceController(mContext, mLifecycle);
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by DirtyUnicorns.
the class DevelopmentSwitchBarControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mLifecycle = new Lifecycle();
mSwitchBar = new SwitchBar(RuntimeEnvironment.application);
}
use of com.android.settingslib.core.lifecycle.Lifecycle 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;
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by DirtyUnicorns.
the class WifiP2PPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mLifecycle = new Lifecycle();
when(mContext.getSystemService(WifiManager.class)).thenReturn(mWifiManager);
when(mScreen.findPreference(anyString())).thenReturn(mWifiDirectPreference);
mController = new WifiP2pPreferenceController(mContext, mLifecycle, mWifiManager);
}
Aggregations