Add MSIM support for FDN.
Show title and get the Phone object to modify FDN settings for
according to subscription..
+ Add helper to provide common functionality for setting/getting
extras, getting the appropriate phone for a given subscription id,
and other miscellaneous things.
+ Show the subscription label in actionbar title of Call settings,
FDN settings, and FDN list. I didn't do this for edit/delete because
they have really long titles, and the context didn't seem necessary
at that point.
+ Pass the subscription label/id along in intents to the various FDN
setting activities.
+ Get the correct phone, so FDN setting changes are SIM-specific.
+ Take into account subscription id when providing a Uri for
modifying FDN settings, so that FDN contacts can be modified on a
per-sim basis.
- Delete some unused strings.
Bug: 18233666
Bug: 18232723
Bug: 18114923
Change-Id: I05c7149382adb7e7af36d38bab8a6875d5b20609
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index d254f8f..5c11521 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -64,6 +64,7 @@
import com.android.phone.settings.AccountSelectionPreference;
import com.android.phone.settings.VoicemailProviderSettings;
import com.android.phone.settings.VoicemailProviderSettingsUtil;
+import com.android.phone.settings.fdn.FdnSetting;
import com.android.services.telephony.sip.SipUtil;
import java.lang.String;
@@ -114,13 +115,6 @@
// to trigger its configuration UI
public static final String ACTION_CONFIGURE_VOICEMAIL =
"com.android.phone.CallFeaturesSetting.CONFIGURE_VOICEMAIL";
- // Extra on intent to Call Settings containing the id of the subscription to modify.
- public static final String SUB_ID_EXTRA =
- "com.android.phone.CallFeaturesSetting.SubscriptionId";
- // Extra on intent to Call Settings containing the label of the subscription to modify.
- public static final String SUB_LABEL_EXTRA =
- "com.android.phone.CallFeaturesSetting.SubscriptionLabel";
-
// Extra put in the return from VM provider config containing voicemail number to set
public static final String VM_NUMBER_EXTRA = "com.android.phone.VoicemailNumber";
// Extra put in the return from VM provider config containing call forwarding number to set
@@ -215,6 +209,8 @@
private static final String VOICEMAIL_VIBRATION_ALWAYS = "always";
private static final String VOICEMAIL_VIBRATION_NEVER = "never";
+ private SubscriptionInfoHelper mSubscriptionInfoHelper;
+
private EditPhoneNumberPreference mSubMenuVoicemailSettings;
/** Whether dialpad plays DTMF tone or not. */
@@ -1250,7 +1246,7 @@
} else if (id == VOICEMAIL_FWD_SAVING_DIALOG || id == VOICEMAIL_FWD_READING_DIALOG ||
id == VOICEMAIL_REVERTING_DIALOG) {
ProgressDialog dialog = new ProgressDialog(this);
- dialog.setTitle(getText(R.string.updating_title));
+ dialog.setTitle(getText(R.string.call_settings));
dialog.setIndeterminate(true);
dialog.setCancelable(false);
dialog.setMessage(getText(
@@ -1319,7 +1315,11 @@
// ACTION_ADD_VOICEMAIL action.
mShowVoicemailPreference = (icicle == null) &&
getIntent().getAction().equals(ACTION_ADD_VOICEMAIL);
- }
+
+ mSubscriptionInfoHelper = new SubscriptionInfoHelper(getIntent());
+ mSubscriptionInfoHelper.setActionBarTitle(
+ getActionBar(), getResources(), R.string.call_settings_with_label);
+ }
private void initPhoneAccountPreferences() {
mPhoneAccountSettingsPreference = findPreference(PHONE_ACCOUNT_SETTINGS_KEY);
@@ -1350,6 +1350,7 @@
}
addPreferencesFromResource(R.xml.call_feature_setting);
+
initPhoneAccountPreferences();
PreferenceScreen prefSet = getPreferenceScreen();
@@ -1427,15 +1428,16 @@
}
int phoneType = mPhone.getPhoneType();
+ Preference fdnButton = prefSet.findPreference(BUTTON_FDN_KEY);
if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
- Preference fdnButton = prefSet.findPreference(BUTTON_FDN_KEY);
- if (fdnButton != null) {
- prefSet.removePreference(fdnButton);
- }
+ prefSet.removePreference(fdnButton);
+
if (!getResources().getBoolean(R.bool.config_voice_privacy_disable)) {
addPreferencesFromResource(R.xml.cdma_call_privacy);
}
} else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
+ fdnButton.setIntent(mSubscriptionInfoHelper.getIntent(this, FdnSetting.class));
+
if (getResources().getBoolean(R.bool.config_additional_call_setting)) {
addPreferencesFromResource(R.xml.gsm_umts_call_options);
}