use of com.android.settingslib.core.lifecycle.Lifecycle in project platform_packages_apps_Settings by BlissRoms.
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 platform_packages_apps_Settings by BlissRoms.
the class VpnPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
when(mContext.getSystemService(Context.CONNECTIVITY_SERVICE)).thenReturn(mConnectivityManager);
when(mBinder.queryLocalInterface("android.net.IConnectivityManager")).thenReturn(mConnectivityManagerService);
ShadowServiceManager.addService(Context.CONNECTIVITY_SERVICE, mBinder);
when(mScreen.findPreference(anyString())).thenReturn(mPreference);
mController = spy(new VpnPreferenceController(mContext));
mLifecycle = new Lifecycle();
mLifecycle.addObserver(mController);
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project platform_packages_apps_Settings by BlissRoms.
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);
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project platform_packages_apps_Settings by BlissRoms.
the class WpsPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mLifecycle = new Lifecycle();
when(mContext.getSystemService(WifiManager.class)).thenReturn(mWifiManager);
when(mScreen.findPreference(anyString())).thenReturn(mWpsPushPref).thenReturn(mWpsPinPref);
mController = new WpsPreferenceController(mContext, mLifecycle, mWifiManager, mFragmentManager);
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project platform_packages_apps_Settings by BlissRoms.
the class WifiDetailActionBarObserverTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mLifecycle = new Lifecycle();
when(mockFragment.getActivity()).thenReturn(mockActivity);
when(mockActivity.getActionBar()).thenReturn(mockActionBar);
mObserver = new WifiDetailActionBarObserver(mContext, mockFragment);
mLifecycle.addObserver(mObserver);
}
Aggregations