use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by SudaMod.
the class WifiTetherPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mLifecycle = new Lifecycle();
FakeFeatureFactory.setupForTest(mFeatureFactoryContext);
mPreference = new MasterSwitchPreference(RuntimeEnvironment.application);
when(mContext.getSystemService(Context.CONNECTIVITY_SERVICE)).thenReturn(mConnectivityManager);
when(mContext.getSystemService(Context.WIFI_SERVICE)).thenReturn(mWifiManager);
when(mScreen.findPreference(anyString())).thenReturn(mPreference);
when(mConnectivityManager.getTetherableWifiRegexs()).thenReturn(new String[] { "1", "2" });
mController = new WifiTetherPreferenceController(mContext, mLifecycle);
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by SudaMod.
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 android_packages_apps_Settings by SudaMod.
the class BluetoothDetailsControllerTestBase method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mPreferenceManager = new PreferenceManager(mContext);
mScreen = mPreferenceManager.createPreferenceScreen(mContext);
mDeviceConfig = makeDefaultDeviceConfig();
when(mFragment.getActivity()).thenReturn(mActivity);
when(mActivity.getApplicationContext()).thenReturn(mContext);
when(mFragment.getContext()).thenReturn(mContext);
when(mFragment.getPreferenceManager()).thenReturn(mPreferenceManager);
when(mFragment.getPreferenceScreen()).thenReturn(mScreen);
mLifecycle = spy(new Lifecycle());
mBluetoothManager = new BluetoothManager(mContext);
mBluetoothAdapter = mBluetoothManager.getAdapter();
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by SudaMod.
the class ManageApplicationsTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mAppReset = new RoboMenuItem(R.id.reset_app_preferences);
ReflectionHelpers.setStaticField(ApplicationsState.class, "sInstance", mState);
when(mState.newSession(any())).thenReturn(mSession);
mBgLooper = Looper.myLooper();
when(mState.getBackgroundLooper()).thenReturn(mBgLooper);
mFragment = new ManageApplications();
ReflectionHelpers.setField(mFragment, "mLifecycle", new Lifecycle());
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by SudaMod.
the class AssistFlashScreenPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
when(mScreen.findPreference(anyString())).thenReturn(mPreference);
mLifecycle = new Lifecycle();
mContext = RuntimeEnvironment.application;
mController = spy(new AssistFlashScreenPreferenceController(mContext, mLifecycle));
mLifecycle.addObserver(mController);
ReflectionHelpers.setField(mController, "mSettingObserver", mObserver);
}
Aggregations