aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <android@cerqueira.org>2016-11-16 17:47:31 +0000
committerRicardo Cerqueira <android@cerqueira.org>2016-11-16 17:52:33 +0000
commitb51f0ccf5d961e0525efeae75395b7b0207f57ed (patch)
tree962b60c9691e77f4c88c322acb597bf74e830905
parentca30c6aad73d5191317c22498701f6b0ab9b7633 (diff)
downloadandroid_frameworks_opt_telephony-b51f0ccf5d961e0525efeae75395b7b0207f57ed.tar.gz
android_frameworks_opt_telephony-b51f0ccf5d961e0525efeae75395b7b0207f57ed.tar.bz2
android_frameworks_opt_telephony-b51f0ccf5d961e0525efeae75395b7b0207f57ed.zip
SubscriptionInfoUpdater: Unbreak usage of TelephonyPluginreplicant-6.0-0003replicant-6.0-0002replicant-6.0-0001
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
-rw-r--r--src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java10
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 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();
}