Trigger checkRemovedSim when carrier config changed
VvmSimStateTracker scans all known PhoneAccountHandle when a SIM is
removed to inform the VisualVoicemailService which one is removed.
It rely on SubscriptionManager.getActiveSubscriptionInfoForIccIndex()
to determine if a SIM is still present.
The SubscriptionInfo might not be updated yet when
ACTION_SIM_STATE_CHANGED is received. In this CL, the same scan will
be triggered when the ACTION_CARRIER_CONFIG_CHANGED on an invalid
subId.
Bug: 37286583
Change-Id: I0f236527f2d4f8dae0f870f90635e0647f5fb3a8
Fixes: 37286583
Test: manual - remove SIM
diff --git a/src/com/android/phone/vvm/VvmSimStateTracker.java b/src/com/android/phone/vvm/VvmSimStateTracker.java
index 24b78c4..c648d9c 100644
--- a/src/com/android/phone/vvm/VvmSimStateTracker.java
+++ b/src/com/android/phone/vvm/VvmSimStateTracker.java
@@ -122,11 +122,11 @@
case TelephonyIntents.ACTION_SIM_STATE_CHANGED:
if (IccCardConstants.INTENT_VALUE_ICC_ABSENT.equals(
intent.getStringExtra(IccCardConstants.INTENT_KEY_ICC_STATE))) {
- // onSimRemoved will scan all known accounts with isPhoneAccountActive() to find
+ // checkRemovedSim will scan all known accounts with isPhoneAccountActive() to find
// which SIM is removed.
// ACTION_SIM_STATE_CHANGED only provides subId which cannot be converted to a
// PhoneAccountHandle when the SIM is absent.
- onSimRemoved(context);
+ checkRemovedSim(context);
}
break;
case CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED:
@@ -135,6 +135,7 @@
if (!SubscriptionManager.isValidSubscriptionId(subId)) {
VvmLog.i(TAG, "Received SIM change for invalid subscription id.");
+ checkRemovedSim(context);
return;
}
@@ -172,7 +173,7 @@
RemoteVvmTaskManager.startCellServiceConnected(context, phoneAccountHandle);
}
- private void onSimRemoved(Context context) {
+ private void checkRemovedSim(Context context) {
SubscriptionManager subscriptionManager = SubscriptionManager.from(context);
if (!isBootCompleted()) {
for (PhoneAccountHandle phoneAccountHandle : sPreBootHandles) {