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);
}
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);
}
Aggregations