summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jordan Liu <jminjie@google.com> 2019-06-24 11:27:34 -0700
committer Jordan Liu <jminjie@google.com> 2019-08-16 18:11:23 +0000
commit55b2bc4615209e7eea936ccf466943dbb6ec3eb4 (patch)
tree8b1c0134f394d5593e744d88edb6f68d59d3d7b7
parente6c9ed5f903fba5b24ebcc2c3952e8d897ed3e8d (diff)
Do not notify SS change with invalid subId
(This is a reupload of ag/8541406.) If a service state change is reported as a subscription is becoming invalid (i.e. no longer connected to a phone), the current behavior can sometimes notify this change to all PhoneStateListeners regardless of which subId they registered to listen on (namely this happens when the subscription was attached to the default phone). This change removes that behavior so that no listeners are notified if the subscription is invalid. Test: manually verified on DSDS that when 1. erasing eSIM when it is default and 2. removing pSIM when it is default, the service state triangle for the other SIM is unaffected Also made sure that signal strength is rebroadcast when sub becomes valid, so b/138357571 did not show up 5/5 times Bug: 133140128 Change-Id: I2ba6a971fff4e29ccd2166c381308fcd953f5bc0
-rw-r--r--services/core/java/com/android/server/TelephonyRegistry.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java
index e66e596d5038..f7e825eecc12 100644
--- a/services/core/java/com/android/server/TelephonyRegistry.java
+++ b/services/core/java/com/android/server/TelephonyRegistry.java
@@ -1027,7 +1027,12 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
log(str);
}
mLocalLog.log(str);
- if (validatePhoneId(phoneId)) {
+ // for service state updates, don't notify clients when subId is invalid. This prevents
+ // us from sending incorrect notifications like b/133140128
+ // In the future, we can remove this logic for every notification here and add a
+ // callback so listeners know when their PhoneStateListener's subId becomes invalid, but
+ // for now we use the simplest fix.
+ if (validatePhoneId(phoneId) && SubscriptionManager.isValidSubscriptionId(subId)) {
mServiceState[phoneId] = state;
for (Record r : mRecords) {
@@ -1059,7 +1064,8 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
}
}
} else {
- log("notifyServiceStateForSubscriber: INVALID phoneId=" + phoneId);
+ log("notifyServiceStateForSubscriber: INVALID phoneId=" + phoneId
+ + " or subId=" + subId);
}
handleRemoveListLocked();
}