diff options
author | Ricardo Cerqueira <android@cerqueira.org> | 2016-11-16 17:47:31 +0000 |
---|---|---|
committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2016-11-16 10:54:31 -0700 |
commit | 6a72b07e15968e07c034945c23d350deaa24c4b8 (patch) | |
tree | 9552682cf2e09895051fa981d07795b8f0f7a4c5 | |
parent | 575bb6492dbf94599bbd73efba2b147fdbcc5144 (diff) | |
download | android_frameworks_opt_telephony-stable/cm-13.0-ZNH2K.tar.gz android_frameworks_opt_telephony-stable/cm-13.0-ZNH2K.tar.bz2 android_frameworks_opt_telephony-stable/cm-13.0-ZNH2K.zip |
SubscriptionInfoUpdater: Unbreak usage of TelephonyPluginstable/cm-13.0-ZNH2K
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
(cherry picked from commit b51f0ccf5d961e0525efeae75395b7b0207f57ed)
-rw-r--r-- | src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java | 10 |
1 files 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 bdd9b6502..05865c445 100644 --- a/src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java +++ b/src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java @@ -364,7 +364,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; @@ -414,7 +414,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); } } @@ -618,10 +618,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(); } |