Search in sources :

Example 56 with Lifecycle

use of com.android.settingslib.core.lifecycle.Lifecycle in project platform_packages_apps_Settings by BlissRoms.

the class WifiInfoPreferenceControllerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    mLifecycle = new Lifecycle();
    when(mContext.getSystemService(WifiManager.class)).thenReturn(mWifiManager);
    when(mScreen.findPreference(anyString())).thenReturn(mMacPreference).thenReturn(mIpPreference);
    mController = new WifiInfoPreferenceController(mContext, mLifecycle, mWifiManager);
}
Also used : Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) Before(org.junit.Before)

Example 57 with Lifecycle

use of com.android.settingslib.core.lifecycle.Lifecycle in project platform_packages_apps_Settings by BlissRoms.

the class ActionBarShadowControllerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    when(mActivity.getActionBar()).thenReturn(mActionBar);
    mView = new View(RuntimeEnvironment.application);
    mLifecycle = new Lifecycle();
}
Also used : Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) Before(org.junit.Before)

Example 58 with Lifecycle

use of com.android.settingslib.core.lifecycle.Lifecycle in project platform_packages_apps_Settings by BlissRoms.

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);
}
Also used : Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) Before(org.junit.Before)

Example 59 with Lifecycle

use of com.android.settingslib.core.lifecycle.Lifecycle in project platform_packages_apps_Settings by BlissRoms.

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);
}
Also used : Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) Before(org.junit.Before)

Example 60 with Lifecycle

use of com.android.settingslib.core.lifecycle.Lifecycle in project platform_packages_apps_Settings by BlissRoms.

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();
}
Also used : BluetoothManager(android.bluetooth.BluetoothManager) Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) PreferenceManager(android.support.v7.preference.PreferenceManager) Before(org.junit.Before)

Aggregations

Lifecycle (com.android.settingslib.core.lifecycle.Lifecycle)259 Before (org.junit.Before)218 AbstractPreferenceController (com.android.settingslib.core.AbstractPreferenceController)33 ArrayList (java.util.ArrayList)32 PreferenceManager (androidx.preference.PreferenceManager)16 Preference (androidx.preference.Preference)15 TextView (android.widget.TextView)11 SettingsActivity (com.android.settings.SettingsActivity)10 Handler (android.os.Handler)9 LinkProperties (android.net.LinkProperties)8 Network (android.net.Network)8 NetworkRequest (android.net.NetworkRequest)8 LockScreenNotificationPreferenceController (com.android.settings.notification.LockScreenNotificationPreferenceController)8 BluetoothManager (android.bluetooth.BluetoothManager)7 Intent (android.content.Intent)7 PreferenceCategory (androidx.preference.PreferenceCategory)7 SwitchBar (com.android.settings.widget.SwitchBar)7 BluetoothCodecConfig (android.bluetooth.BluetoothCodecConfig)6 Bundle (android.os.Bundle)6 RecyclerView (android.support.v7.widget.RecyclerView)6