use of com.android.internal.telephony.RILConstants.RIL_REQUEST_START_NETWORK_SCAN 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());
}
Aggregations