Search in sources :

Example 1 with DataDuringCallsPreferenceController

use of com.android.settings.network.telephony.DataDuringCallsPreferenceController in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class DataDuringCallsPreferenceControllerTest method getAvailabilityStatus_noInit_notAvailable.

@Test
public void getAvailabilityStatus_noInit_notAvailable() {
    ShadowSubscriptionManager.setDefaultDataSubscriptionId(SUB_ID_1);
    DataDuringCallsPreferenceController controller = new DataDuringCallsPreferenceController(mContext, PREF_KEY);
    // note that we purposely don't call init first on the controller
    assertThat(controller.getAvailabilityStatus(INVALID_SUBSCRIPTION_ID)).isEqualTo(CONDITIONALLY_UNAVAILABLE);
}
Also used : DataDuringCallsPreferenceController(com.android.settings.network.telephony.DataDuringCallsPreferenceController) Test(org.junit.Test)

Example 2 with DataDuringCallsPreferenceController

use of com.android.settings.network.telephony.DataDuringCallsPreferenceController in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class DataDuringCallsPreferenceControllerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    mContext = spy(RuntimeEnvironment.application);
    doReturn(mTelephonyManager).when(mContext).getSystemService(eq(TelephonyManager.class));
    when(mTelephonyManager.createForSubscriptionId(anyInt())).thenReturn(mTelephonyManager);
    mSwitchPreference = new SwitchPreference(mContext);
    when(mPreferenceScreen.findPreference(PREF_KEY)).thenReturn(mSwitchPreference);
    mController = new DataDuringCallsPreferenceController(mContext, PREF_KEY);
    mController.init(mLifecycle, SUB_ID_1);
}
Also used : TelephonyManager(android.telephony.TelephonyManager) SwitchPreference(androidx.preference.SwitchPreference) DataDuringCallsPreferenceController(com.android.settings.network.telephony.DataDuringCallsPreferenceController) Before(org.junit.Before)

Aggregations

DataDuringCallsPreferenceController (com.android.settings.network.telephony.DataDuringCallsPreferenceController)2 TelephonyManager (android.telephony.TelephonyManager)1 SwitchPreference (androidx.preference.SwitchPreference)1 Before (org.junit.Before)1 Test (org.junit.Test)1