When voicemail number is unknown, show voicemail setup on notification click.
1. In NotificationMgr changed intent when no voicemail number is found so
that it will trigger opening of the voicemail screen.
2. In CallFeaturesSetting added new intent extra to indicate we just want
to open the voicemail settings. This intent is used by Google Voice, and
I wanted to ensure that the code path for that case is not changed, hence
the new extra.
Bug: 17795834
Change-Id: I62b3d6c99558dc698565459aa0d43cd4efdd6fdd
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index 9956397..1d054a6 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -131,6 +131,12 @@
*/
public static final String IGNORE_PROVIDER_EXTRA = "com.android.phone.ProviderToIgnore";
+ /**
+ * String Extra put into ACTION_ADD_VOICEMAIL to indicate that the voicemail setup screen should
+ * be opened.
+ */
+ public static final String SETUP_VOICEMAIL_EXTRA = "com.android.phone.SetupVoicemail";
+
// string constants
private static final String NUM_PROJECTION[] = {CommonDataKinds.Phone.NUMBER};
@@ -287,6 +293,11 @@
*/
private boolean mShowVoicemailPreference = false;
+ /**
+ * Used to indicate that the voicemail setup screen should be shown.
+ */
+ private boolean mSetupVoicemail = false;
+
/*
* Click Listeners, handle click based on objects attached to UI.
*/
@@ -713,6 +724,9 @@
} else {
saveVoiceMailAndForwardingNumberStage2();
}
+
+ // Refresh the MWI indicator if it is already showing.
+ PhoneGlobals.getInstance().refreshMwiIndicator(mSubscriptionInfoHelper.getSubId());
}
private final Handler mGetOptionComplete = new Handler() {
@@ -1107,6 +1121,8 @@
// ACTION_ADD_VOICEMAIL action.
mShowVoicemailPreference = (icicle == null) &&
TextUtils.equals(getIntent().getAction(), ACTION_ADD_VOICEMAIL);
+ mSetupVoicemail = mShowVoicemailPreference &&
+ getIntent().getBooleanExtra(SETUP_VOICEMAIL_EXTRA, false);
mSubscriptionInfoHelper = new SubscriptionInfoHelper(getIntent());
mSubscriptionInfoHelper.setActionBarTitle(
@@ -1268,7 +1284,10 @@
// We only bring up the dialog the first time we are called (not after orientation change)
if (mShowVoicemailPreference) {
if (DBG) log("ACTION_ADD_VOICEMAIL Intent is thrown");
- if (mVoicemailProviders.hasMoreThanOneVoicemailProvider()) {
+ if (mSetupVoicemail) {
+ simulatePreferenceClick(mVoicemailSettingsScreen);
+ mSetupVoicemail = false;
+ } else if (mVoicemailProviders.hasMoreThanOneVoicemailProvider()) {
if (DBG) log("Voicemail data has more than one provider.");
simulatePreferenceClick(mVoicemailProviders);
} else {