Search in sources :

Example 6 with Lifecycle

use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by LineageOS.

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

Example 7 with Lifecycle

use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by LineageOS.

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

Example 8 with Lifecycle

use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by LineageOS.

the class DevelopmentSwitchBarControllerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    mLifecycle = new Lifecycle();
    mSwitchBar = new SwitchBar(RuntimeEnvironment.application);
}
Also used : SwitchBar(com.android.settings.widget.SwitchBar) Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) Before(org.junit.Before)

Example 9 with Lifecycle

use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by LineageOS.

the class BuildNumberPreferenceControllerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    mFactory = FakeFeatureFactory.setupForTest(mContext);
    mLifecycle = new Lifecycle();
    when(mContext.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
    mController = new BuildNumberPreferenceController(mContext, mActivity, mFragment, mLifecycle);
    mPreference = new Preference(RuntimeEnvironment.application);
    mPreference.setKey(mController.getPreferenceKey());
}
Also used : Preference(android.support.v7.preference.Preference) Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) Before(org.junit.Before)

Example 10 with Lifecycle

use of com.android.settingslib.core.lifecycle.Lifecycle in project android_packages_apps_Settings by LineageOS.

the class FirmwareVersionPreferenceControllerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    mLifecycle = new Lifecycle();
    when(mContext.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
    when(mContext.getSystemService(Context.DEVICE_POLICY_SERVICE)).thenReturn(null);
    mController = new FirmwareVersionPreferenceController(mContext, mLifecycle);
    when(mPreferenceScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
}
Also used : Lifecycle(com.android.settingslib.core.lifecycle.Lifecycle) 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