Search in sources :

Example 1 with NetworkScanRequest

use of android.telephony.NetworkScanRequest in project android_frameworks_opt_telephony by LineageOS.

the class RILTest method testStartNetworkScanWithUnsupportedResponse.

@FlakyTest
@Test
public void testStartNetworkScanWithUnsupportedResponse() throws Exception {
    // Use Radio HAL v1.5
    try {
        replaceInstance(RIL.class, "mRadioVersion", mRILUnderTest, mRadioVersionV15);
    } catch (Exception e) {
    }
    NetworkScanRequest nsr = getNetworkScanRequestForTesting();
    mRILUnderTest.startNetworkScan(nsr, obtainMessage());
    // Verify the v1.5 HAL methed is called firstly
    verify(mRadioProxy).startNetworkScan_1_5(mSerialNumberCaptor.capture(), any());
    // Before we find a way to trigger real RadioResponse method, emulate the behaivor.
    Consumer<RILRequest> unsupportedResponseEmulator = rr -> {
        mRILUnderTest.setCompatVersion(rr.getRequest(), RIL.RADIO_HAL_VERSION_1_4);
        mRILUnderTest.startNetworkScan(nsr, Message.obtain(rr.getResult()));
    };
    verifyRILUnsupportedResponse(mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_START_NETWORK_SCAN, unsupportedResponseEmulator);
    // Verify the fallback method is invoked
    verify(mRadioProxy).startNetworkScan_1_4(eq(mSerialNumberCaptor.getValue() + 1), any());
}
Also used : RIL_REQUEST_SIM_CLOSE_CHANNEL(com.android.internal.telephony.RILConstants.RIL_REQUEST_SIM_CLOSE_CHANNEL) RIL_REQUEST_GET_CURRENT_CALLS(com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_CURRENT_CALLS) FlakyTest(androidx.test.filters.FlakyTest) Arrays(java.util.Arrays) RIL_REQUEST_SIM_AUTHENTICATION(com.android.internal.telephony.RILConstants.RIL_REQUEST_SIM_AUTHENTICATION) RIL_REQUEST_START_LCE(com.android.internal.telephony.RILConstants.RIL_REQUEST_START_LCE) CellInfoNr(android.telephony.CellInfoNr) RadioError(android.hardware.radio.V1_0.RadioError) SmsManager(android.telephony.SmsManager) DataProfile(android.telephony.data.DataProfile) InetAddresses(android.net.InetAddresses) RIL_REQUEST_GET_HARDWARE_CONFIG(com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_HARDWARE_CONFIG) RIL_REQUEST_SET_INITIAL_ATTACH_APN(com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_INITIAL_ATTACH_APN) CellInfo(android.telephony.CellInfo) CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND(com.android.internal.telephony.RILConstants.RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND) RIL_REQUEST_SETUP_DATA_CALL(com.android.internal.telephony.RILConstants.RIL_REQUEST_SETUP_DATA_CALL) RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND(com.android.internal.telephony.RILConstants.RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND) DataProfileInfo(android.hardware.radio.V1_0.DataProfileInfo) IPowerManager(android.os.IPowerManager) RadioResponseType(android.hardware.radio.V1_0.RadioResponseType) Handler(android.os.Handler) Looper(android.os.Looper) RIL_REQUEST_GET_IMSI(com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_IMSI) CarrierIdentifier(android.service.carrier.CarrierIdentifier) Mockito.doReturn(org.mockito.Mockito.doReturn) ConnectivityManager(android.net.ConnectivityManager) NvWriteItem(android.hardware.radio.V1_0.NvWriteItem) RIL_REQUEST_REPORT_SMS_MEMORY_STATUS(com.android.internal.telephony.RILConstants.RIL_REQUEST_REPORT_SMS_MEMORY_STATUS) RIL_REQUEST_START_NETWORK_SCAN(com.android.internal.telephony.RILConstants.RIL_REQUEST_START_NETWORK_SCAN) RIL_REQUEST_SIGNAL_STRENGTH(com.android.internal.telephony.RILConstants.RIL_REQUEST_SIGNAL_STRENGTH) Set(java.util.Set) RIL_REQUEST_SHUTDOWN(com.android.internal.telephony.RILConstants.RIL_REQUEST_SHUTDOWN) IRadio(android.hardware.radio.V1_5.IRadio) CellIdentityWcdma(android.telephony.CellIdentityWcdma) RIL_REQUEST_OPERATOR(com.android.internal.telephony.RILConstants.RIL_REQUEST_OPERATOR) Matchers.any(org.mockito.Matchers.any) RIL_REQUEST_VOICE_RADIO_TECH(com.android.internal.telephony.RILConstants.RIL_REQUEST_VOICE_RADIO_TECH) Message(android.os.Message) RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE(com.android.internal.telephony.RILConstants.RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE) RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE(com.android.internal.telephony.RILConstants.RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE) Mockito.mock(org.mockito.Mockito.mock) RadioAccessSpecifier(android.telephony.RadioAccessSpecifier) Assert.assertEquals(junit.framework.Assert.assertEquals) ApnSetting(android.telephony.data.ApnSetting) RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER(com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER) RIL_REQUEST_GET_CELL_INFO_LIST(com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_CELL_INFO_LIST) RIL_REQUEST_ALLOW_DATA(com.android.internal.telephony.RILConstants.RIL_REQUEST_ALLOW_DATA) Mock(org.mockito.Mock) RIL_REQUEST_RADIO_POWER(com.android.internal.telephony.RILConstants.RIL_REQUEST_RADIO_POWER) RunWith(org.junit.runner.RunWith) RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE(com.android.internal.telephony.RILConstants.RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE) RIL_REQUEST_ENTER_SIM_PUK2(com.android.internal.telephony.RILConstants.RIL_REQUEST_ENTER_SIM_PUK2) ArgumentMatchers.anyBoolean(org.mockito.ArgumentMatchers.anyBoolean) Mockito.spy(org.mockito.Mockito.spy) RIL_REQUEST_GET_BARRING_INFO(com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_BARRING_INFO) ArrayList(java.util.ArrayList) Assert.assertTrue(junit.framework.Assert.assertTrue) RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU(com.android.internal.telephony.RILConstants.RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU) DataCallResponse(android.telephony.data.DataCallResponse) Carrier(android.hardware.radio.V1_0.Carrier) CellSignalStrengthLte(android.telephony.CellSignalStrengthLte) RIL_REQUEST_SEND_SMS(com.android.internal.telephony.RILConstants.RIL_REQUEST_SEND_SMS) Assert.assertNull(junit.framework.Assert.assertNull) RIL_REQUEST_UDUB(com.android.internal.telephony.RILConstants.RIL_REQUEST_UDUB) Before(org.junit.Before) RIL_REQUEST_NV_RESET_CONFIG(com.android.internal.telephony.RILConstants.RIL_REQUEST_NV_RESET_CONFIG) Mockito.times(org.mockito.Mockito.times) IOemHook(android.hardware.radio.deprecated.V1_0.IOemHook) Test(org.junit.Test) WorkSource(android.os.WorkSource) CdmaSmsMessage(android.hardware.radio.V1_0.CdmaSmsMessage) Mockito.never(org.mockito.Mockito.never) SignalStrength(android.telephony.SignalStrength) CellIdentityNr(android.telephony.CellIdentityNr) ImsSmsMessage(android.hardware.radio.V1_0.ImsSmsMessage) RIL_REQUEST_ENTER_SIM_PIN(com.android.internal.telephony.RILConstants.RIL_REQUEST_ENTER_SIM_PIN) CellInfoLte(android.telephony.CellInfoLte) CellSignalStrengthGsm(android.telephony.CellSignalStrengthGsm) CellSignalStrengthCdma(android.telephony.CellSignalStrengthCdma) RIL_REQUEST_DATA_REGISTRATION_STATE(com.android.internal.telephony.RILConstants.RIL_REQUEST_DATA_REGISTRATION_STATE) RIL_REQUEST_SEND_SMS_EXPECT_MORE(com.android.internal.telephony.RILConstants.RIL_REQUEST_SEND_SMS_EXPECT_MORE) RIL_REQUEST_IMS_SEND_SMS(com.android.internal.telephony.RILConstants.RIL_REQUEST_IMS_SEND_SMS) RIL_REQUEST_SET_SMSC_ADDRESS(com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_SMSC_ADDRESS) PowerManager(android.os.PowerManager) RIL_REQUEST_DTMF(com.android.internal.telephony.RILConstants.RIL_REQUEST_DTMF) Assert.assertNotNull(junit.framework.Assert.assertNotNull) Matchers.eq(org.mockito.Matchers.eq) RadioResponseInfo(android.hardware.radio.V1_0.RadioResponseInfo) After(org.junit.After) RIL_REQUEST_GET_RADIO_CAPABILITY(com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_RADIO_CAPABILITY) Mockito.atLeast(org.mockito.Mockito.atLeast) RIL_REQUEST_GET_ACTIVITY_INFO(com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_ACTIVITY_INFO) SmsWriteArgs(android.hardware.radio.V1_0.SmsWriteArgs) RIL_REQUEST_ENTER_SIM_PIN2(com.android.internal.telephony.RILConstants.RIL_REQUEST_ENTER_SIM_PIN2) RIL_REQUEST_HANGUP(com.android.internal.telephony.RILConstants.RIL_REQUEST_HANGUP) RIL_REQUEST_IMS_REGISTRATION_STATE(com.android.internal.telephony.RILConstants.RIL_REQUEST_IMS_REGISTRATION_STATE) RIL_REQUEST_STOP_LCE(com.android.internal.telephony.RILConstants.RIL_REQUEST_STOP_LCE) CellInfoCdma(android.telephony.CellInfoCdma) CellInfoGsm(android.telephony.CellInfoGsm) ServiceState(android.telephony.ServiceState) RIL_REQUEST_NV_WRITE_ITEM(com.android.internal.telephony.RILConstants.RIL_REQUEST_NV_WRITE_ITEM) CellIdentityTdscdma(android.telephony.CellIdentityTdscdma) AndroidTestingRunner(android.testing.AndroidTestingRunner) RIL_REQUEST_WRITE_SMS_TO_SIM(com.android.internal.telephony.RILConstants.RIL_REQUEST_WRITE_SMS_TO_SIM) CellIdentityCdma(android.telephony.CellIdentityCdma) RIL_REQUEST_ENABLE_UICC_APPLICATIONS(com.android.internal.telephony.RILConstants.RIL_REQUEST_ENABLE_UICC_APPLICATIONS) List(java.util.List) RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING(com.android.internal.telephony.RILConstants.RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING) ApplicationInfo(android.content.pm.ApplicationInfo) Context(android.content.Context) RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM(com.android.internal.telephony.RILConstants.RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM) AccessNetworkConstants(android.telephony.AccessNetworkConstants) RIL_REQUEST_CHANGE_SIM_PIN2(com.android.internal.telephony.RILConstants.RIL_REQUEST_CHANGE_SIM_PIN2) RIL_REQUEST_DELETE_SMS_ON_SIM(com.android.internal.telephony.RILConstants.RIL_REQUEST_DELETE_SMS_ON_SIM) RIL_REQUEST_CHANGE_SIM_PIN(com.android.internal.telephony.RILConstants.RIL_REQUEST_CHANGE_SIM_PIN) RIL_REQUEST_VOICE_REGISTRATION_STATE(com.android.internal.telephony.RILConstants.RIL_REQUEST_VOICE_REGISTRATION_STATE) CellInfoWcdma(android.telephony.CellInfoWcdma) RIL_REQUEST_SEND_DEVICE_STATE(com.android.internal.telephony.RILConstants.RIL_REQUEST_SEND_DEVICE_STATE) HashSet(java.util.HashSet) IThermalService(android.os.IThermalService) ArgumentCaptor(org.mockito.ArgumentCaptor) RIL_REQUEST_GET_SIM_STATUS(com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_SIM_STATUS) TelephonyManager(android.telephony.TelephonyManager) RIL_REQUEST_GET_UICC_APPLICATIONS_ENABLEMENT(com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_UICC_APPLICATIONS_ENABLEMENT) RIL_REQUEST_NV_READ_ITEM(com.android.internal.telephony.RILConstants.RIL_REQUEST_NV_READ_ITEM) CellIdentityGsm(android.telephony.CellIdentityGsm) RIL_REQUEST_CONFERENCE(com.android.internal.telephony.RILConstants.RIL_REQUEST_CONFERENCE) RIL_REQUEST_GET_SMSC_ADDRESS(com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_SMSC_ADDRESS) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) RIL_REQUEST_PULL_LCEDATA(com.android.internal.telephony.RILConstants.RIL_REQUEST_PULL_LCEDATA) RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE(com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE) CellInfoTdscdma(android.telephony.CellInfoTdscdma) DcTracker(com.android.internal.telephony.dataconnection.DcTracker) RIL_REQUEST_LAST_CALL_FAIL_CAUSE(com.android.internal.telephony.RILConstants.RIL_REQUEST_LAST_CALL_FAIL_CAUSE) TestableLooper(android.testing.TestableLooper) RIL_REQUEST_ENTER_SIM_PUK(com.android.internal.telephony.RILConstants.RIL_REQUEST_ENTER_SIM_PUK) NetworkScanRequest(android.telephony.NetworkScanRequest) RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION(com.android.internal.telephony.RILConstants.RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION) RIL_REQUEST_SIM_OPEN_CHANNEL(com.android.internal.telephony.RILConstants.RIL_REQUEST_SIM_OPEN_CHANNEL) LinkAddress(android.net.LinkAddress) RIL_REQUEST_DEVICE_IDENTITY(com.android.internal.telephony.RILConstants.RIL_REQUEST_DEVICE_IDENTITY) Mockito.verify(org.mockito.Mockito.verify) Consumer(java.util.function.Consumer) GsmSmsMessage(android.hardware.radio.V1_0.GsmSmsMessage) CellSignalStrengthTdscdma(android.telephony.CellSignalStrengthTdscdma) RIL_REQUEST_SET_SIM_CARD_POWER(com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_SIM_CARD_POWER) CellSignalStrengthWcdma(android.telephony.CellSignalStrengthWcdma) CellIdentityLte(android.telephony.CellIdentityLte) Collections(java.util.Collections) Assert.assertFalse(junit.framework.Assert.assertFalse) NetworkScanRequest(android.telephony.NetworkScanRequest) FlakyTest(androidx.test.filters.FlakyTest) FlakyTest(androidx.test.filters.FlakyTest) Test(org.junit.Test)

Example 2 with NetworkScanRequest

use of android.telephony.NetworkScanRequest in project android_frameworks_opt_telephony by LineageOS.

the class RILTest method getNetworkScanRequestForTesting.

private NetworkScanRequest getNetworkScanRequestForTesting() {
    // Construct a NetworkScanRequest for testing
    List<CellInfo> allCellInfo = mTelephonyManager.getAllCellInfo();
    List<RadioAccessSpecifier> radioAccessSpecifier = new ArrayList<>();
    for (int i = 0; i < allCellInfo.size(); i++) {
        RadioAccessSpecifier ras = getRadioAccessSpecifier(allCellInfo.get(i));
        if (ras != null) {
            radioAccessSpecifier.add(ras);
        }
    }
    if (radioAccessSpecifier.size() == 0) {
        RadioAccessSpecifier gsm = new RadioAccessSpecifier(AccessNetworkConstants.AccessNetworkType.GERAN, null, /* bands */
        null);
        radioAccessSpecifier.add(gsm);
    }
    RadioAccessSpecifier[] radioAccessSpecifierArray = new RadioAccessSpecifier[radioAccessSpecifier.size()];
    return new NetworkScanRequest(NetworkScanRequest.SCAN_TYPE_ONE_SHOT, /* scan type */
    radioAccessSpecifier.toArray(radioAccessSpecifierArray), 5, /* search periodicity */
    60, /* max search time */
    true, /*enable incremental results*/
    5, /* incremental results periodicity */
    null);
}
Also used : NetworkScanRequest(android.telephony.NetworkScanRequest) CellInfo(android.telephony.CellInfo) ArrayList(java.util.ArrayList) RadioAccessSpecifier(android.telephony.RadioAccessSpecifier)

Example 3 with NetworkScanRequest

use of android.telephony.NetworkScanRequest in project android_packages_apps_Settings by omnirom.

the class NetworkScanHelperTest method createNetworkScanForPreferredAccessNetworks_deviceHasNrSa_hasNgran.

@Test
public void createNetworkScanForPreferredAccessNetworks_deviceHasNrSa_hasNgran() {
    int[] deviceNrCapabilities = new int[] { PhoneCapability.DEVICE_NR_CAPABILITY_NSA, PhoneCapability.DEVICE_NR_CAPABILITY_SA };
    PhoneCapability phoneCapability = createPhoneCapability(deviceNrCapabilities);
    doReturn(TelephonyManager.NETWORK_CLASS_BITMASK_2G | TelephonyManager.NETWORK_CLASS_BITMASK_3G | TelephonyManager.NETWORK_CLASS_BITMASK_4G | TelephonyManager.NETWORK_CLASS_BITMASK_5G).when(mTelephonyManager).getPreferredNetworkTypeBitmask();
    doReturn(phoneCapability).when(mTelephonyManager).getPhoneCapability();
    List<RadioAccessSpecifier> radioAccessSpecifiers = new ArrayList<>();
    radioAccessSpecifiers.add(new RadioAccessSpecifier(AccessNetworkConstants.AccessNetworkType.GERAN, null, null));
    radioAccessSpecifiers.add(new RadioAccessSpecifier(AccessNetworkConstants.AccessNetworkType.UTRAN, null, null));
    radioAccessSpecifiers.add(new RadioAccessSpecifier(AccessNetworkConstants.AccessNetworkType.EUTRAN, null, null));
    radioAccessSpecifiers.add(new RadioAccessSpecifier(AccessNetworkConstants.AccessNetworkType.NGRAN, null, null));
    NetworkScanRequest expectedNetworkScanRequest = createNetworkScanRequest(radioAccessSpecifiers);
    assertEquals(expectedNetworkScanRequest, mNetworkScanHelper.createNetworkScanForPreferredAccessNetworks());
}
Also used : PhoneCapability(android.telephony.PhoneCapability) NetworkScanRequest(android.telephony.NetworkScanRequest) ArrayList(java.util.ArrayList) RadioAccessSpecifier(android.telephony.RadioAccessSpecifier) Test(org.junit.Test)

Example 4 with NetworkScanRequest

use of android.telephony.NetworkScanRequest in project android_packages_apps_Settings by omnirom.

the class NetworkScanHelper method createNetworkScanForPreferredAccessNetworks.

@VisibleForTesting
NetworkScanRequest createNetworkScanForPreferredAccessNetworks() {
    long networkTypeBitmap3gpp = mTelephonyManager.getPreferredNetworkTypeBitmask() & TelephonyManager.NETWORK_STANDARDS_FAMILY_BITMASK_3GPP;
    List<RadioAccessSpecifier> radioAccessSpecifiers = new ArrayList<>();
    // that they can't connect to.
    if (networkTypeBitmap3gpp == 0 || (networkTypeBitmap3gpp & TelephonyManager.NETWORK_CLASS_BITMASK_2G) != 0) {
        radioAccessSpecifiers.add(new RadioAccessSpecifier(AccessNetworkType.GERAN, null, null));
    }
    if (networkTypeBitmap3gpp == 0 || (networkTypeBitmap3gpp & TelephonyManager.NETWORK_CLASS_BITMASK_3G) != 0) {
        radioAccessSpecifiers.add(new RadioAccessSpecifier(AccessNetworkType.UTRAN, null, null));
    }
    if (networkTypeBitmap3gpp == 0 || (networkTypeBitmap3gpp & TelephonyManager.NETWORK_CLASS_BITMASK_4G) != 0) {
        radioAccessSpecifiers.add(new RadioAccessSpecifier(AccessNetworkType.EUTRAN, null, null));
    }
    // 
    if (networkTypeBitmap3gpp == 0 || (hasNrSaCapability() && (networkTypeBitmap3gpp & TelephonyManager.NETWORK_CLASS_BITMASK_5G) != 0)) {
        radioAccessSpecifiers.add(new RadioAccessSpecifier(AccessNetworkType.NGRAN, null, null));
        Log.d(TAG, "radioAccessSpecifiers add NGRAN.");
    }
    return new NetworkScanRequest(NetworkScanRequest.SCAN_TYPE_ONE_SHOT, radioAccessSpecifiers.toArray(new RadioAccessSpecifier[radioAccessSpecifiers.size()]), SEARCH_PERIODICITY_SEC, MAX_SEARCH_TIME_SEC, INCREMENTAL_RESULTS, INCREMENTAL_RESULTS_PERIODICITY_SEC, null);
}
Also used : NetworkScanRequest(android.telephony.NetworkScanRequest) ArrayList(java.util.ArrayList) RadioAccessSpecifier(android.telephony.RadioAccessSpecifier) VisibleForTesting(androidx.annotation.VisibleForTesting)

Example 5 with NetworkScanRequest

use of android.telephony.NetworkScanRequest in project android_packages_apps_Settings by omnirom.

the class NetworkScanHelperTest method createNetworkScanForPreferredAccessNetworks_deviceNoNrSa_noNgran.

@Test
public void createNetworkScanForPreferredAccessNetworks_deviceNoNrSa_noNgran() {
    int[] deviceNrCapabilities = new int[] { PhoneCapability.DEVICE_NR_CAPABILITY_NSA };
    PhoneCapability phoneCapability = createPhoneCapability(deviceNrCapabilities);
    doReturn(TelephonyManager.NETWORK_CLASS_BITMASK_2G | TelephonyManager.NETWORK_CLASS_BITMASK_3G | TelephonyManager.NETWORK_CLASS_BITMASK_4G | TelephonyManager.NETWORK_CLASS_BITMASK_5G).when(mTelephonyManager).getPreferredNetworkTypeBitmask();
    doReturn(phoneCapability).when(mTelephonyManager).getPhoneCapability();
    List<RadioAccessSpecifier> radioAccessSpecifiers = new ArrayList<>();
    radioAccessSpecifiers.add(new RadioAccessSpecifier(AccessNetworkConstants.AccessNetworkType.GERAN, null, null));
    radioAccessSpecifiers.add(new RadioAccessSpecifier(AccessNetworkConstants.AccessNetworkType.UTRAN, null, null));
    radioAccessSpecifiers.add(new RadioAccessSpecifier(AccessNetworkConstants.AccessNetworkType.EUTRAN, null, null));
    NetworkScanRequest expectedNetworkScanRequest = createNetworkScanRequest(radioAccessSpecifiers);
    assertEquals(expectedNetworkScanRequest, mNetworkScanHelper.createNetworkScanForPreferredAccessNetworks());
}
Also used : PhoneCapability(android.telephony.PhoneCapability) NetworkScanRequest(android.telephony.NetworkScanRequest) ArrayList(java.util.ArrayList) RadioAccessSpecifier(android.telephony.RadioAccessSpecifier) Test(org.junit.Test)

Aggregations

NetworkScanRequest (android.telephony.NetworkScanRequest)8 RadioAccessSpecifier (android.telephony.RadioAccessSpecifier)7 ArrayList (java.util.ArrayList)6 Test (org.junit.Test)4 Message (android.os.Message)2 CellInfo (android.telephony.CellInfo)2 Context (android.content.Context)1 ApplicationInfo (android.content.pm.ApplicationInfo)1 Carrier (android.hardware.radio.V1_0.Carrier)1 CdmaSmsMessage (android.hardware.radio.V1_0.CdmaSmsMessage)1 DataProfileInfo (android.hardware.radio.V1_0.DataProfileInfo)1 GsmSmsMessage (android.hardware.radio.V1_0.GsmSmsMessage)1 IRadio (android.hardware.radio.V1_0.IRadio)1 ImsSmsMessage (android.hardware.radio.V1_0.ImsSmsMessage)1 NvWriteItem (android.hardware.radio.V1_0.NvWriteItem)1 RadioError (android.hardware.radio.V1_0.RadioError)1 RadioResponseInfo (android.hardware.radio.V1_0.RadioResponseInfo)1 RadioResponseType (android.hardware.radio.V1_0.RadioResponseType)1 SmsWriteArgs (android.hardware.radio.V1_0.SmsWriteArgs)1 IRadio (android.hardware.radio.V1_5.IRadio)1