diff options
author | Sarah Kim <sarahchin@google.com> | 2023-06-03 00:21:40 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-06-03 00:21:40 +0000 |
commit | 819c81bbba0aa74a0aef1c493fd1e712eca9aff1 (patch) | |
tree | f7aa8846b620f0b51ae7055676f49de1f21d9a07 | |
parent | 0e8f6827c65633e65d3da6b423db20ef689f39c8 (diff) | |
parent | 1f515af2b9a187b8d86976a6af8dc95fead907b2 (diff) | |
download | telephony-819c81bbba0aa74a0aef1c493fd1e712eca9aff1.tar.gz |
Revert "RIL handle AIDL binder died for all services at the same time" am: 1f515af2b9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/23543264
Change-Id: Ia8992f9552ee1c93592e7d7acd67bdec4a520061
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | src/java/com/android/internal/telephony/RIL.java | 50 |
1 files changed, 14 insertions, 36 deletions
diff --git a/src/java/com/android/internal/telephony/RIL.java b/src/java/com/android/internal/telephony/RIL.java index c6820c146c..5ecdfcbbd4 100644 --- a/src/java/com/android/internal/telephony/RIL.java +++ b/src/java/com/android/internal/telephony/RIL.java @@ -385,15 +385,12 @@ public class RIL extends BaseCommands implements CommandsInterface { case EVENT_AIDL_PROXY_DEAD: int aidlService = msg.arg1; long msgCookie = (long) msg.obj; + riljLog("handleMessage: EVENT_AIDL_PROXY_DEAD cookie = " + msgCookie + + ", service = " + serviceToString(aidlService) + ", cookie = " + + mServiceCookies.get(aidlService)); if (msgCookie == mServiceCookies.get(aidlService).get()) { - riljLog("handleMessage: EVENT_AIDL_PROXY_DEAD cookie = " + msgCookie - + ", service = " + serviceToString(aidlService) + ", cookie = " - + mServiceCookies.get(aidlService)); mIsRadioProxyInitialized = false; resetProxyAndRequestList(aidlService); - } else { - riljLog("Ignore stale EVENT_AIDL_PROXY_DEAD for service " - + serviceToString(aidlService)); } break; } @@ -438,7 +435,7 @@ public class RIL extends BaseCommands implements CommandsInterface { public void serviceDied(long cookie) { // Deal with service going away riljLog("serviceDied"); - mRilHandler.sendMessageAtFrontOfQueue(mRilHandler.obtainMessage(EVENT_RADIO_PROXY_DEAD, + mRilHandler.sendMessage(mRilHandler.obtainMessage(EVENT_RADIO_PROXY_DEAD, HAL_SERVICE_RADIO, 0 /* ignored arg2 */, cookie)); } } @@ -471,14 +468,8 @@ public class RIL extends BaseCommands implements CommandsInterface { @Override public void binderDied() { riljLog("Service " + serviceToString(mService) + " has died."); - if (!mRilHandler.hasMessages(EVENT_AIDL_PROXY_DEAD)) { - mRilHandler.sendMessageAtFrontOfQueue(mRilHandler.obtainMessage( - EVENT_AIDL_PROXY_DEAD, mService, 0 /* ignored arg2 */, - mServiceCookies.get(mService).get())); - } else { - riljLog("Not sending redundant EVENT_AIDL_PROXY_DEAD for service " - + serviceToString(mService)); - } + mRilHandler.sendMessage(mRilHandler.obtainMessage(EVENT_AIDL_PROXY_DEAD, mService, + 0 /* ignored arg2 */, mServiceCookies.get(mService).get())); unlinkToDeath(); } } @@ -487,19 +478,14 @@ public class RIL extends BaseCommands implements CommandsInterface { if (service == HAL_SERVICE_RADIO) { mRadioProxy = null; } else { - for (int i = MIN_SERVICE_IDX; i <= MAX_SERVICE_IDX; i++) { - if (i == HAL_SERVICE_RADIO) continue; - if (mServiceProxies.get(i) == null) { - // This should only happen in tests - riljLoge("Null service proxy for service " + serviceToString(i)); - continue; - } - mServiceProxies.get(i).clear(); - // Increment the cookie so that death notification can be ignored - mServiceCookies.get(i).incrementAndGet(); - } + mServiceProxies.get(service).clear(); } + // Increment the cookie so that death notification can be ignored + mServiceCookies.get(service).incrementAndGet(); + + // TODO: If a service doesn't exist or is unimplemented, it shouldn't cause the radio to + // become unavailable for all other services setRadioState(TelephonyManager.RADIO_POWER_UNAVAILABLE, true /* forceNotifyRegistrants */); RILRequest.resetSerial(); @@ -509,15 +495,7 @@ public class RIL extends BaseCommands implements CommandsInterface { if (service == HAL_SERVICE_RADIO) { getRadioProxy(null); } else { - for (int i = MIN_SERVICE_IDX; i <= MAX_SERVICE_IDX; i++) { - if (i == HAL_SERVICE_RADIO) continue; - if (mServiceProxies.get(i) == null) { - // This should only happen in tests - riljLoge("Null service proxy for service " + serviceToString(i)); - continue; - } - getRadioServiceProxy(i, null); - } + getRadioServiceProxy(service, null); } } @@ -1804,7 +1782,7 @@ public class RIL extends BaseCommands implements CommandsInterface { RILRequest rr = obtainRequest(RIL_REQUEST_GET_IMSI, result, mRILDefaultWorkSource); if (RILJ_LOGD) { - riljLog(rr.serialString() + ">" + RILUtils.requestToString(rr.mRequest) + riljLog(rr.serialString() + "> " + RILUtils.requestToString(rr.mRequest) + " aid = " + aid); } try { |