summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jordan Liu <jminjie@google.com> 2019-08-19 17:34:02 -0700
committer android-build-merger <android-build-merger@google.com> 2019-08-19 17:34:02 -0700
commitbe27410a123e1170a696cd202d49092c563d94dc (patch)
treea192ee35ffcea000d21ada315b06693dabf0b510
parentba28a3a57efc15685b7a78ee8362707d0b617051 (diff)
parent77e183ba6e71903c2c01ff8e736aeef19df11122 (diff)
Merge "Do not notify SS change with invalid subId" am: 3878f50107
am: 77e183ba6e Change-Id: I5ac6db21166a18f64b7cd4a9ae6d0b305c4b9523
-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 1a6faecaecfd..863843265c3e 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();
}