aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <android@cerqueira.org>2016-11-16 17:47:31 +0000
committerAdrian DC <radian.dc@gmail.com>2016-12-03 20:44:45 +0100
commite4f80c747f54e56e70a487b935c27c8d52efae3c (patch)
tree962b60c9691e77f4c88c322acb597bf74e830905
parentaf44e9d7f8b26de5bd5890dd5da8c611aff9cd5a (diff)
downloadandroid_frameworks_opt_telephony-stable/cm-13.0-ZNH5Y.tar.gz
android_frameworks_opt_telephony-stable/cm-13.0-ZNH5Y.tar.bz2
android_frameworks_opt_telephony-stable/cm-13.0-ZNH5Y.zip
SubscriptionInfoUpdater: Unbreak usage of TelephonyPluginstable/cm-13.0-ZNH5Y
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. RM-290 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();
}