Loading src/java/com/android/internal/telephony/RIL.java +6 −26 Original line number Original line Diff line number Diff line Loading @@ -285,10 +285,6 @@ public class RIL extends BaseCommands implements CommandsInterface { " mRadioProxyCookie = " + mRadioProxyCookie.get()); " mRadioProxyCookie = " + mRadioProxyCookie.get()); if ((long) msg.obj == mRadioProxyCookie.get()) { if ((long) msg.obj == mRadioProxyCookie.get()) { resetProxyAndRequestList(); resetProxyAndRequestList(); // todo: rild should be back up since message was sent with a delay. this is // a hack. getRadioProxy(null); } } break; break; } } Loading Loading @@ -323,11 +319,7 @@ public class RIL extends BaseCommands implements CommandsInterface { public void serviceDied(long cookie) { public void serviceDied(long cookie) { // Deal with service going away // Deal with service going away riljLog("serviceDied"); riljLog("serviceDied"); // todo: temp hack to send delayed message so that rild is back up by then mRilHandler.sendMessage(mRilHandler.obtainMessage(EVENT_RADIO_PROXY_DEAD, cookie)); //mRilHandler.sendMessage(mRilHandler.obtainMessage(EVENT_RADIO_PROXY_DEAD, cookie)); mRilHandler.sendMessageDelayed( mRilHandler.obtainMessage(EVENT_RADIO_PROXY_DEAD, cookie), IRADIO_GET_SERVICE_DELAY_MILLIS); } } } } Loading @@ -343,9 +335,7 @@ public class RIL extends BaseCommands implements CommandsInterface { // Clear request list on close // Clear request list on close clearRequestList(RADIO_NOT_AVAILABLE, false); clearRequestList(RADIO_NOT_AVAILABLE, false); // todo: need to get service right away so setResponseFunctions() can be called for getRadioProxy(null); // unsolicited indications. getService() is not a blocking call, so it doesn't help to call // it here. Current hack is to call getService() on death notification after a delay. } } /** Returns a {@link IRadio} instance or null if the service is not available. */ /** Returns a {@link IRadio} instance or null if the service is not available. */ Loading @@ -366,7 +356,8 @@ public class RIL extends BaseCommands implements CommandsInterface { } } try { try { mRadioProxy = IRadio.getService(HIDL_SERVICE_NAME[mPhoneId == null ? 0 : mPhoneId]); mRadioProxy = IRadio.getService(HIDL_SERVICE_NAME[mPhoneId == null ? 0 : mPhoneId], true); if (mRadioProxy != null) { if (mRadioProxy != null) { mRadioProxy.linkToDeath(mRadioProxyDeathRecipient, mRadioProxy.linkToDeath(mRadioProxyDeathRecipient, mRadioProxyCookie.incrementAndGet()); mRadioProxyCookie.incrementAndGet()); Loading @@ -380,17 +371,13 @@ public class RIL extends BaseCommands implements CommandsInterface { } } if (mRadioProxy == null) { if (mRadioProxy == null) { // getService() is a blocking call, so this should never happen riljLoge("getRadioProxy: mRadioProxy == null"); if (result != null) { if (result != null) { AsyncResult.forMessage(result, null, AsyncResult.forMessage(result, null, CommandException.fromRilErrno(RADIO_NOT_AVAILABLE)); CommandException.fromRilErrno(RADIO_NOT_AVAILABLE)); result.sendToTarget(); result.sendToTarget(); } } // if service is not up, treat it like death notification to try to get service again mRilHandler.sendMessageDelayed( mRilHandler.obtainMessage(EVENT_RADIO_PROXY_DEAD, mRadioProxyCookie.incrementAndGet()), IRADIO_GET_SERVICE_DELAY_MILLIS); } } return mRadioProxy; return mRadioProxy; Loading Loading @@ -475,13 +462,6 @@ public class RIL extends BaseCommands implements CommandsInterface { private void handleRadioProxyExceptionForRR(RILRequest rr, String caller, Exception e) { private void handleRadioProxyExceptionForRR(RILRequest rr, String caller, Exception e) { riljLoge(caller + ": " + e); riljLoge(caller + ": " + e); resetProxyAndRequestList(); resetProxyAndRequestList(); // service most likely died, handle exception like death notification to try to get service // again mRilHandler.sendMessageDelayed( mRilHandler.obtainMessage(EVENT_RADIO_PROXY_DEAD, mRadioProxyCookie.incrementAndGet()), IRADIO_GET_SERVICE_DELAY_MILLIS); } } private String convertNullToEmptyString(String string) { private String convertNullToEmptyString(String string) { Loading src/java/com/android/internal/telephony/RadioConfig.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -166,7 +166,7 @@ public class RadioConfig extends Handler { } } try { try { mRadioConfigProxy = IRadioConfig.getService(RADIO_CONFIG_SERVICE_NAME); mRadioConfigProxy = IRadioConfig.getService(RADIO_CONFIG_SERVICE_NAME, true); if (mRadioConfigProxy != null) { if (mRadioConfigProxy != null) { mRadioConfigProxy.linkToDeath(mServiceDeathRecipient, mRadioConfigProxy.linkToDeath(mServiceDeathRecipient, mRadioConfigProxyCookie.incrementAndGet()); mRadioConfigProxyCookie.incrementAndGet()); Loading @@ -177,7 +177,7 @@ public class RadioConfig extends Handler { } } } catch (RemoteException | RuntimeException e) { } catch (RemoteException | RuntimeException e) { mRadioConfigProxy = null; mRadioConfigProxy = null; loge("getRadioConfigProxy: RadioProxy getService/setResponseFunctions: " + e); loge("getRadioConfigProxy: RadioConfigProxy getService/setResponseFunctions: " + e); } } if (mRadioConfigProxy == null) { if (mRadioConfigProxy == null) { Loading Loading
src/java/com/android/internal/telephony/RIL.java +6 −26 Original line number Original line Diff line number Diff line Loading @@ -285,10 +285,6 @@ public class RIL extends BaseCommands implements CommandsInterface { " mRadioProxyCookie = " + mRadioProxyCookie.get()); " mRadioProxyCookie = " + mRadioProxyCookie.get()); if ((long) msg.obj == mRadioProxyCookie.get()) { if ((long) msg.obj == mRadioProxyCookie.get()) { resetProxyAndRequestList(); resetProxyAndRequestList(); // todo: rild should be back up since message was sent with a delay. this is // a hack. getRadioProxy(null); } } break; break; } } Loading Loading @@ -323,11 +319,7 @@ public class RIL extends BaseCommands implements CommandsInterface { public void serviceDied(long cookie) { public void serviceDied(long cookie) { // Deal with service going away // Deal with service going away riljLog("serviceDied"); riljLog("serviceDied"); // todo: temp hack to send delayed message so that rild is back up by then mRilHandler.sendMessage(mRilHandler.obtainMessage(EVENT_RADIO_PROXY_DEAD, cookie)); //mRilHandler.sendMessage(mRilHandler.obtainMessage(EVENT_RADIO_PROXY_DEAD, cookie)); mRilHandler.sendMessageDelayed( mRilHandler.obtainMessage(EVENT_RADIO_PROXY_DEAD, cookie), IRADIO_GET_SERVICE_DELAY_MILLIS); } } } } Loading @@ -343,9 +335,7 @@ public class RIL extends BaseCommands implements CommandsInterface { // Clear request list on close // Clear request list on close clearRequestList(RADIO_NOT_AVAILABLE, false); clearRequestList(RADIO_NOT_AVAILABLE, false); // todo: need to get service right away so setResponseFunctions() can be called for getRadioProxy(null); // unsolicited indications. getService() is not a blocking call, so it doesn't help to call // it here. Current hack is to call getService() on death notification after a delay. } } /** Returns a {@link IRadio} instance or null if the service is not available. */ /** Returns a {@link IRadio} instance or null if the service is not available. */ Loading @@ -366,7 +356,8 @@ public class RIL extends BaseCommands implements CommandsInterface { } } try { try { mRadioProxy = IRadio.getService(HIDL_SERVICE_NAME[mPhoneId == null ? 0 : mPhoneId]); mRadioProxy = IRadio.getService(HIDL_SERVICE_NAME[mPhoneId == null ? 0 : mPhoneId], true); if (mRadioProxy != null) { if (mRadioProxy != null) { mRadioProxy.linkToDeath(mRadioProxyDeathRecipient, mRadioProxy.linkToDeath(mRadioProxyDeathRecipient, mRadioProxyCookie.incrementAndGet()); mRadioProxyCookie.incrementAndGet()); Loading @@ -380,17 +371,13 @@ public class RIL extends BaseCommands implements CommandsInterface { } } if (mRadioProxy == null) { if (mRadioProxy == null) { // getService() is a blocking call, so this should never happen riljLoge("getRadioProxy: mRadioProxy == null"); if (result != null) { if (result != null) { AsyncResult.forMessage(result, null, AsyncResult.forMessage(result, null, CommandException.fromRilErrno(RADIO_NOT_AVAILABLE)); CommandException.fromRilErrno(RADIO_NOT_AVAILABLE)); result.sendToTarget(); result.sendToTarget(); } } // if service is not up, treat it like death notification to try to get service again mRilHandler.sendMessageDelayed( mRilHandler.obtainMessage(EVENT_RADIO_PROXY_DEAD, mRadioProxyCookie.incrementAndGet()), IRADIO_GET_SERVICE_DELAY_MILLIS); } } return mRadioProxy; return mRadioProxy; Loading Loading @@ -475,13 +462,6 @@ public class RIL extends BaseCommands implements CommandsInterface { private void handleRadioProxyExceptionForRR(RILRequest rr, String caller, Exception e) { private void handleRadioProxyExceptionForRR(RILRequest rr, String caller, Exception e) { riljLoge(caller + ": " + e); riljLoge(caller + ": " + e); resetProxyAndRequestList(); resetProxyAndRequestList(); // service most likely died, handle exception like death notification to try to get service // again mRilHandler.sendMessageDelayed( mRilHandler.obtainMessage(EVENT_RADIO_PROXY_DEAD, mRadioProxyCookie.incrementAndGet()), IRADIO_GET_SERVICE_DELAY_MILLIS); } } private String convertNullToEmptyString(String string) { private String convertNullToEmptyString(String string) { Loading
src/java/com/android/internal/telephony/RadioConfig.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -166,7 +166,7 @@ public class RadioConfig extends Handler { } } try { try { mRadioConfigProxy = IRadioConfig.getService(RADIO_CONFIG_SERVICE_NAME); mRadioConfigProxy = IRadioConfig.getService(RADIO_CONFIG_SERVICE_NAME, true); if (mRadioConfigProxy != null) { if (mRadioConfigProxy != null) { mRadioConfigProxy.linkToDeath(mServiceDeathRecipient, mRadioConfigProxy.linkToDeath(mServiceDeathRecipient, mRadioConfigProxyCookie.incrementAndGet()); mRadioConfigProxyCookie.incrementAndGet()); Loading @@ -177,7 +177,7 @@ public class RadioConfig extends Handler { } } } catch (RemoteException | RuntimeException e) { } catch (RemoteException | RuntimeException e) { mRadioConfigProxy = null; mRadioConfigProxy = null; loge("getRadioConfigProxy: RadioProxy getService/setResponseFunctions: " + e); loge("getRadioConfigProxy: RadioConfigProxy getService/setResponseFunctions: " + e); } } if (mRadioConfigProxy == null) { if (mRadioConfigProxy == null) { Loading