use of com.android.settingslib.core.lifecycle.Lifecycle in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class DisabledSubscriptionControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
LifecycleOwner lifecycleOwner = () -> mLifecycle;
mLifecycle = new Lifecycle(lifecycleOwner);
doReturn(mSubscriptionManager).when(mContext).getSystemService(SubscriptionManager.class);
mCategory = new PreferenceCategory(mContext);
doReturn(mCategory).when(mScreen).findPreference(KEY);
mController = new DisabledSubscriptionController(mContext, KEY);
mController.init(mLifecycle, SUB_ID);
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class AirplaneModePreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
FakeFeatureFactory.setupForTest();
mContext = spy(RuntimeEnvironment.application);
mResolver = RuntimeEnvironment.application.getContentResolver();
doReturn(mPackageManager).when(mContext).getPackageManager();
mController = new AirplaneModePreferenceController(mContext, SettingsSlicesContract.KEY_AIRPLANE_MODE);
mPreferenceManager = new PreferenceManager(mContext);
mScreen = mPreferenceManager.createPreferenceScreen(mContext);
mPreference = new RestrictedSwitchPreference(mContext);
mPreference.setKey(SettingsSlicesContract.KEY_AIRPLANE_MODE);
mScreen.addPreference(mPreference);
mController.setFragment(null);
mLifecycleOwner = () -> mLifecycle;
mLifecycle = new Lifecycle(mLifecycleOwner);
mLifecycle.addObserver(mController);
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class RestrictedEncryptionPreferenceControllerTest method setUp.
@Before
public void setUp() {
mContext = RuntimeEnvironment.application;
mLifecycleOwner = () -> mLifecycle;
mLifecycle = new Lifecycle(mLifecycleOwner);
mInstallCredentialsPreferenceController = new InstallCredentialsPreferenceController(mContext);
mResetCredentialsPreferenceController = new ResetCredentialsPreferenceController(mContext, mLifecycle);
mUserCredentialsPreferenceController = new UserCredentialsPreferenceController(mContext);
mUserManager = ShadowUserManager.getShadow();
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class TrustAgentListPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mActivity = Robolectric.buildActivity(Activity.class).get();
mLifecycleOwner = () -> mLifecycle;
mLifecycle = new Lifecycle(mLifecycleOwner);
mFeatureFactory = FakeFeatureFactory.setupForTest();
when(mFeatureFactory.securityFeatureProvider.getLockPatternUtils(any(Context.class))).thenReturn(mLockPatternUtils);
when(mFeatureFactory.securityFeatureProvider.getTrustAgentManager()).thenReturn(mTrustAgentManager);
when(mCategory.getKey()).thenReturn(PREF_KEY_SECURITY_CATEGORY);
when(mCategory.getContext()).thenReturn(mActivity);
when(mScreen.findPreference(PREF_KEY_SECURITY_CATEGORY)).thenReturn(mCategory);
mController = new TrustAgentListPreferenceController(mActivity, mFragment, mLifecycle);
}
use of com.android.settingslib.core.lifecycle.Lifecycle in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class AssistContextPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
when(mScreen.findPreference(anyString())).thenReturn(mPreference);
mLifecycleOwner = () -> mLifecycle;
mLifecycle = new Lifecycle(mLifecycleOwner);
mContext = RuntimeEnvironment.application;
mController = new AssistContextPreferenceController(mContext, mLifecycle);
ReflectionHelpers.setField(mController, "mSettingObserver", mObserver);
}
Aggregations