Ignore connectionReady with invalid subscription
While SIM is disabled and enabled again,
if a clients register a callback before IMS service initializes the MMTEL feature connection,
invalid IMS connection state is notified to the client temporarily.
Bug: 227525553
Test: atest TeleServiceTests:ImsStateCallbackControllerTest
Change-Id: I537e63b0f9d401c9e6121fc53fb0287c2cc41aee
diff --git a/src/com/android/phone/ImsStateCallbackController.java b/src/com/android/phone/ImsStateCallbackController.java
index a7caab0..57c1787 100644
--- a/src/com/android/phone/ImsStateCallbackController.java
+++ b/src/com/android/phone/ImsStateCallbackController.java
@@ -296,6 +296,8 @@
logd(mLogPrefix + "connectionReady " + subId);
mSubId = subId;
+ if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) return;
+
mState = STATE_READY;
mReason = AVAILABLE;
mHasConfig = true;
@@ -439,6 +441,8 @@
logd(mLogPrefix + "connectionReady " + subId);
mSubId = subId;
+ if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) return;
+
mState = STATE_READY;
mReason = AVAILABLE;
mHasConfig = true;
@@ -642,7 +646,7 @@
}
void notifyInactive() {
- if (VDBG) logv("CallbackWrapper notifyInactive subId=" + mSubId);
+ logd("CallbackWrapper notifyInactive subId=" + mSubId);
try {
mCallback.onUnavailable(REASON_SUBSCRIPTION_INACTIVE);