Search in sources :

Example 1 with WifiConnectionPreferenceController

use of com.android.settings.wifi.WifiConnectionPreferenceController in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class WifiConnectionPreferenceControllerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    mContext = spy(RuntimeEnvironment.application);
    WifiTrackerFactory.setTestingWifiTracker(mWifiTracker);
    mLifecycleOwner = () -> mLifecycle;
    mLifecycle = new Lifecycle(mLifecycleOwner);
    when(mScreen.findPreference(eq(KEY))).thenReturn(mPreferenceCategory);
    when(mScreen.getContext()).thenReturn(mContext);
    mUpdateListener = () -> mOnChildUpdatedCount++;
    mController = new WifiConnectionPreferenceController(mContext, mLifecycle, mUpdateListener, KEY, 0, 0);
}
Also used : Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) WifiConnectionPreferenceController(com.android.settings.wifi.WifiConnectionPreferenceController) Before(org.junit.Before)

Example 2 with WifiConnectionPreferenceController

use of com.android.settings.wifi.WifiConnectionPreferenceController in project android_packages_apps_Settings by omnirom.

the class MultiNetworkHeaderControllerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    mContext = spy(ApplicationProvider.getApplicationContext());
    when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager);
    mHeaderController = new MultiNetworkHeaderController(mContext, KEY_HEADER) {

        @Override
        WifiConnectionPreferenceController createWifiController(Lifecycle lifecycle) {
            return mWifiController;
        }

        @Override
        SubscriptionsPreferenceController createSubscriptionsController(Lifecycle lifecycle) {
            return mSubscriptionsController;
        }
    };
    if (Looper.myLooper() == null) {
        Looper.prepare();
    }
    mPreferenceManager = new PreferenceManager(mContext);
    mPreferenceScreen = mPreferenceManager.createPreferenceScreen(mContext);
    mPreferenceScreen.setInitialExpandedChildrenCount(EXPANDED_CHILDREN_COUNT);
    when(mPreferenceCategory.getKey()).thenReturn(KEY_HEADER);
    when(mPreferenceCategory.getPreferenceCount()).thenReturn(3);
    mPreferenceScreen.addPreference(mPreferenceCategory);
}
Also used : Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) WifiConnectionPreferenceController(com.android.settings.wifi.WifiConnectionPreferenceController) PreferenceManager(androidx.preference.PreferenceManager) Before(org.junit.Before)

Example 3 with WifiConnectionPreferenceController

use of com.android.settings.wifi.WifiConnectionPreferenceController in project android_packages_apps_Settings by omnirom.

the class WifiConnectionPreferenceControllerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    mContext = spy(RuntimeEnvironment.application);
    mLifecycleOwner = () -> mLifecycle;
    mLifecycle = new Lifecycle(mLifecycleOwner);
    when(mScreen.findPreference(eq(KEY))).thenReturn(mPreferenceCategory);
    when(mScreen.getContext()).thenReturn(mContext);
    mUpdateListener = () -> mOnChildUpdatedCount++;
    mController = new WifiConnectionPreferenceController(mContext, mLifecycle, mUpdateListener, KEY, 0, 0);
    mController.mWifiPickerTracker = mWifiPickerTracker;
}
Also used : Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) WifiConnectionPreferenceController(com.android.settings.wifi.WifiConnectionPreferenceController) Before(org.junit.Before)

Aggregations

WifiConnectionPreferenceController (com.android.settings.wifi.WifiConnectionPreferenceController)3 Lifecycle (com.android.settingslib.core.lifecycle.Lifecycle)3 Before (org.junit.Before)3 PreferenceManager (androidx.preference.PreferenceManager)1