Loading src/java/com/android/internal/telephony/RIL.java +7 −38 Original line number Diff line number Diff line Loading @@ -4719,9 +4719,7 @@ public class RIL extends BaseCommands implements CommandsInterface { workSource = getDeafultWorkSourceIfInvalid(workSource); IRadio radioProxy = getRadioProxy(result); if (radioProxy == null) { return; } if (radioProxy == null) return; RILRequest rr = obtainRequest(RIL_REQUEST_SET_ALLOWED_CARRIERS, result, workSource); Loading Loading @@ -4801,9 +4799,7 @@ public class RIL extends BaseCommands implements CommandsInterface { workSource = getDeafultWorkSourceIfInvalid(workSource); IRadio radioProxy = getRadioProxy(result); if (radioProxy == null) { return; } if (radioProxy == null) return; RILRequest rr = obtainRequest(RIL_REQUEST_GET_ALLOWED_CARRIERS, result, workSource); Loading Loading @@ -5130,10 +5126,7 @@ public class RIL extends BaseCommands implements CommandsInterface { int contextId, KeepalivePacketData packetData, int intervalMillis, Message result) { checkNotNull(packetData, "KeepaliveRequest cannot be null."); IRadio radioProxy = getRadioProxy(result); if (radioProxy == null) { riljLoge("Radio Proxy object is null!"); return; } if (radioProxy == null) return; if (mRadioVersion.less(RADIO_HAL_VERSION_1_1)) { if (result != null) { Loading Loading @@ -5188,10 +5181,7 @@ public class RIL extends BaseCommands implements CommandsInterface { @Override public void stopNattKeepalive(int sessionHandle, Message result) { IRadio radioProxy = getRadioProxy(result); if (radioProxy == null) { Rlog.e(RIL.RILJ_LOG_TAG, "Radio Proxy object is null!"); return; } if (radioProxy == null) return; if (mRadioVersion.less(RADIO_HAL_VERSION_1_1)) { if (result != null) { Loading Loading @@ -5253,14 +5243,7 @@ public class RIL extends BaseCommands implements CommandsInterface { @Override public void enableUiccApplications(boolean enable, Message onCompleteMessage) { IRadio radioProxy = getRadioProxy(onCompleteMessage); if (radioProxy == null) { Rlog.e(RIL.RILJ_LOG_TAG, "Radio Proxy object is null!"); if (onCompleteMessage != null) { AsyncResult.forMessage(onCompleteMessage, null, CommandException.fromRilErrno(RADIO_NOT_AVAILABLE)); onCompleteMessage.sendToTarget(); } } if (radioProxy == null) return; if (mRadioVersion.less(RADIO_HAL_VERSION_1_5)) { if (onCompleteMessage != null) { Loading Loading @@ -5294,14 +5277,7 @@ public class RIL extends BaseCommands implements CommandsInterface { @Override public void areUiccApplicationsEnabled(Message onCompleteMessage) { IRadio radioProxy = getRadioProxy(onCompleteMessage); if (radioProxy == null) { Rlog.e(RIL.RILJ_LOG_TAG, "Radio Proxy object is null!"); if (onCompleteMessage != null) { AsyncResult.forMessage(onCompleteMessage, null, CommandException.fromRilErrno(RADIO_NOT_AVAILABLE)); onCompleteMessage.sendToTarget(); } } if (radioProxy == null) return; if (mRadioVersion.less(RADIO_HAL_VERSION_1_5)) { if (onCompleteMessage != null) { Loading Loading @@ -5389,14 +5365,7 @@ public class RIL extends BaseCommands implements CommandsInterface { @Override public void getBarringInfo(Message result) { IRadio radioProxy = getRadioProxy(result); if (radioProxy == null) { Rlog.e(RIL.RILJ_LOG_TAG, "Radio Proxy object is null!"); if (result != null) { AsyncResult.forMessage(result, null, CommandException.fromRilErrno(RADIO_NOT_AVAILABLE)); result.sendToTarget(); } } if (radioProxy == null) return; if (mRadioVersion.less(RADIO_HAL_VERSION_1_5)) { if (result != null) { Loading tests/telephonytests/src/com/android/internal/telephony/RILTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -2490,6 +2490,19 @@ public class RILTest extends TelephonyTest { RIL_REQUEST_GET_UICC_APPLICATIONS_ENABLEMENT); } @Test public void testAreUiccApplicationsEnabled_nullRadioProxy() throws Exception { // Not supported on Radio 1.0. doReturn(null).when(mRILUnderTest).getRadioProxy(any()); Message message = obtainMessage(); mRILUnderTest.areUiccApplicationsEnabled(message); processAllMessages(); verify(mRadioProxy, never()).areUiccApplicationsEnabled(mSerialNumberCaptor.capture()); // Sending message is handled by getRadioProxy when proxy is null. // areUiccApplicationsEnabled shouldn't explicitly send another callback. assertEquals(null, message.obj); } @Test public void testSetGetCompatVersion() throws Exception { final int testRequest = RIL_REQUEST_GET_UICC_APPLICATIONS_ENABLEMENT; Loading Loading
src/java/com/android/internal/telephony/RIL.java +7 −38 Original line number Diff line number Diff line Loading @@ -4719,9 +4719,7 @@ public class RIL extends BaseCommands implements CommandsInterface { workSource = getDeafultWorkSourceIfInvalid(workSource); IRadio radioProxy = getRadioProxy(result); if (radioProxy == null) { return; } if (radioProxy == null) return; RILRequest rr = obtainRequest(RIL_REQUEST_SET_ALLOWED_CARRIERS, result, workSource); Loading Loading @@ -4801,9 +4799,7 @@ public class RIL extends BaseCommands implements CommandsInterface { workSource = getDeafultWorkSourceIfInvalid(workSource); IRadio radioProxy = getRadioProxy(result); if (radioProxy == null) { return; } if (radioProxy == null) return; RILRequest rr = obtainRequest(RIL_REQUEST_GET_ALLOWED_CARRIERS, result, workSource); Loading Loading @@ -5130,10 +5126,7 @@ public class RIL extends BaseCommands implements CommandsInterface { int contextId, KeepalivePacketData packetData, int intervalMillis, Message result) { checkNotNull(packetData, "KeepaliveRequest cannot be null."); IRadio radioProxy = getRadioProxy(result); if (radioProxy == null) { riljLoge("Radio Proxy object is null!"); return; } if (radioProxy == null) return; if (mRadioVersion.less(RADIO_HAL_VERSION_1_1)) { if (result != null) { Loading Loading @@ -5188,10 +5181,7 @@ public class RIL extends BaseCommands implements CommandsInterface { @Override public void stopNattKeepalive(int sessionHandle, Message result) { IRadio radioProxy = getRadioProxy(result); if (radioProxy == null) { Rlog.e(RIL.RILJ_LOG_TAG, "Radio Proxy object is null!"); return; } if (radioProxy == null) return; if (mRadioVersion.less(RADIO_HAL_VERSION_1_1)) { if (result != null) { Loading Loading @@ -5253,14 +5243,7 @@ public class RIL extends BaseCommands implements CommandsInterface { @Override public void enableUiccApplications(boolean enable, Message onCompleteMessage) { IRadio radioProxy = getRadioProxy(onCompleteMessage); if (radioProxy == null) { Rlog.e(RIL.RILJ_LOG_TAG, "Radio Proxy object is null!"); if (onCompleteMessage != null) { AsyncResult.forMessage(onCompleteMessage, null, CommandException.fromRilErrno(RADIO_NOT_AVAILABLE)); onCompleteMessage.sendToTarget(); } } if (radioProxy == null) return; if (mRadioVersion.less(RADIO_HAL_VERSION_1_5)) { if (onCompleteMessage != null) { Loading Loading @@ -5294,14 +5277,7 @@ public class RIL extends BaseCommands implements CommandsInterface { @Override public void areUiccApplicationsEnabled(Message onCompleteMessage) { IRadio radioProxy = getRadioProxy(onCompleteMessage); if (radioProxy == null) { Rlog.e(RIL.RILJ_LOG_TAG, "Radio Proxy object is null!"); if (onCompleteMessage != null) { AsyncResult.forMessage(onCompleteMessage, null, CommandException.fromRilErrno(RADIO_NOT_AVAILABLE)); onCompleteMessage.sendToTarget(); } } if (radioProxy == null) return; if (mRadioVersion.less(RADIO_HAL_VERSION_1_5)) { if (onCompleteMessage != null) { Loading Loading @@ -5389,14 +5365,7 @@ public class RIL extends BaseCommands implements CommandsInterface { @Override public void getBarringInfo(Message result) { IRadio radioProxy = getRadioProxy(result); if (radioProxy == null) { Rlog.e(RIL.RILJ_LOG_TAG, "Radio Proxy object is null!"); if (result != null) { AsyncResult.forMessage(result, null, CommandException.fromRilErrno(RADIO_NOT_AVAILABLE)); result.sendToTarget(); } } if (radioProxy == null) return; if (mRadioVersion.less(RADIO_HAL_VERSION_1_5)) { if (result != null) { Loading
tests/telephonytests/src/com/android/internal/telephony/RILTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -2490,6 +2490,19 @@ public class RILTest extends TelephonyTest { RIL_REQUEST_GET_UICC_APPLICATIONS_ENABLEMENT); } @Test public void testAreUiccApplicationsEnabled_nullRadioProxy() throws Exception { // Not supported on Radio 1.0. doReturn(null).when(mRILUnderTest).getRadioProxy(any()); Message message = obtainMessage(); mRILUnderTest.areUiccApplicationsEnabled(message); processAllMessages(); verify(mRadioProxy, never()).areUiccApplicationsEnabled(mSerialNumberCaptor.capture()); // Sending message is handled by getRadioProxy when proxy is null. // areUiccApplicationsEnabled shouldn't explicitly send another callback. assertEquals(null, message.obj); } @Test public void testSetGetCompatVersion() throws Exception { final int testRequest = RIL_REQUEST_GET_UICC_APPLICATIONS_ENABLEMENT; Loading