From b51f0ccf5d961e0525efeae75395b7b0207f57ed Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Wed, 16 Nov 2016 17:47:31 +0000 Subject: SubscriptionInfoUpdater: Unbreak usage of TelephonyPlugin Change I5b829662b466f609cd22adfa7d3b754757258463 made some changes to how and when we accept to update the subInfo records which depend on state flags and messages added the SubscriptionInfoUpdater. However, a delegated TelephonyPlugin (say... QTI extensions) isn't aware of those, won't manipulate them, and won't generate the expected update messages, resulting in missed data updates and inconsistent subscriptionInfo objects (in particular, as a result of hot swaps) So... return the behavior of the exported updateSubscriptionInfoByIccId() to the original expectations, and reserve the new behavior for internal calls. Change-Id: I4c9e9c40756d049d346145cb03e0c3c5c84e13ad --- .../android/internal/telephony/SubscriptionInfoUpdater.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java b/src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java index 373df340a..24c0f2d3a 100644 --- a/src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java +++ b/src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java @@ -365,7 +365,7 @@ public class SubscriptionInfoUpdater extends Handler { case EVENT_UPDATE_INSERTED_SIM_COUNT: logd("EVENT_UPDATE_INSERTED_SIM_COUNT: locked sims: " + mLockedSims.cardinality()); if (isAllIccIdQueryDone() && !hasMessages(EVENT_UPDATE_INSERTED_SIM_COUNT)) { - updateSubscriptionInfoByIccId(); + updateSubscriptionInfoByIccIdInternal(false); logd("update inserted sim count, current sim count: " + mCurrentSimCount); } break; @@ -415,7 +415,7 @@ public class SubscriptionInfoUpdater extends Handler { private void update(int slotId) { sendMessageDelayed(obtainMessage(EVENT_UPDATE_INSERTED_SIM_COUNT, slotId), DELAY_MILLIS); if (isAllIccIdQueryDone()) { - updateSubscriptionInfoByIccId(); + updateSubscriptionInfoByIccIdInternal(false); } } @@ -614,10 +614,14 @@ public class SubscriptionInfoUpdater extends Handler { * only what the current list contains. */ synchronized protected void updateSubscriptionInfoByIccId() { + updateSubscriptionInfoByIccIdInternal(true); + } + + synchronized private void updateSubscriptionInfoByIccIdInternal(boolean forceUpdate) { logd("updateSubscriptionInfoByIccId:+ Start"); // only update external state if we have no pending updates pending - boolean update = !hasMessages(EVENT_UPDATE_INSERTED_SIM_COUNT); + boolean update = !hasMessages(EVENT_UPDATE_INSERTED_SIM_COUNT) || forceUpdate; if (update) { mSubscriptionManager.clearSubscriptionInfo(); } -- cgit v1.2.3