Fix that voicemail number displayed as unknown after reboot device
Refresh the message waiting (voicemail) indicator after carrier config
loaded.
Bug: 161768263
Test: manual
Change-Id: I23d8eb4f6233feaf49b1e880feb212b9bb5b7c3b
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index b678b4e..79d1581 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -120,6 +120,7 @@
private static final int EVENT_RESTART_SIP = 14;
private static final int EVENT_DATA_ROAMING_SETTINGS_CHANGED = 15;
private static final int EVENT_MOBILE_DATA_SETTINGS_CHANGED = 16;
+ private static final int EVENT_CARRIER_CONFIG_CHANGED = 17;
// The MMI codes are also used by the InCallScreen.
public static final int MMI_INITIATE = 51;
@@ -305,6 +306,12 @@
case EVENT_MOBILE_DATA_SETTINGS_CHANGED:
updateDataRoamingStatus();
break;
+ case EVENT_CARRIER_CONFIG_CHANGED:
+ int subId = (Integer) msg.obj;
+ // The voicemail number could be overridden by carrier config, so need to
+ // refresh the message waiting (voicemail) indicator.
+ refreshMwiIndicator(subId);
+ break;
}
}
};
@@ -709,6 +716,12 @@
if (VDBG) Log.v(LOG_TAG, "carrier config changed.");
updateDataRoamingStatus();
updateLimitedSimFunctionForDualSim();
+ int subId = intent.getIntExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX,
+ SubscriptionManager.INVALID_SUBSCRIPTION_ID);
+ if (SubscriptionManager.isValidSubscriptionId(subId)) {
+ mHandler.sendMessage(mHandler.obtainMessage(EVENT_CARRIER_CONFIG_CHANGED,
+ new Integer(subId)));
+ }
} else if (action.equals(TelephonyIntents.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED)) {
// We also need to pay attention when default data subscription changes.
if (VDBG) Log.v(LOG_TAG, "default data sub changed.");