Fix MSIM for CDMA and GSM Call Options.
This scenario was just... pretty broken before. Update, to pass
the right subscription ids to the right menus, display the right
strings, and obtain the correct phone reference for the sub id.
In particular, moved some initialization code into
GsmUmtsCallOptions so that initialization of its layout can be
shared between it and CallFeatureSettings.
Bug: 19301753
Change-Id: I00954c14f386f3e60b3824138b651c28a40a5c06
diff --git a/src/com/android/phone/CdmaCallOptions.java b/src/com/android/phone/CdmaCallOptions.java
index 8eecd27..8f7b1b1 100644
--- a/src/com/android/phone/CdmaCallOptions.java
+++ b/src/com/android/phone/CdmaCallOptions.java
@@ -29,6 +29,7 @@
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
import android.util.Log;
+import android.view.MenuItem;
public class CdmaCallOptions extends PreferenceActivity {
private static final String LOG_TAG = "CdmaCallOptions";
@@ -43,8 +44,12 @@
addPreferencesFromResource(R.xml.cdma_call_privacy);
+ SubscriptionInfoHelper subInfoHelper = new SubscriptionInfoHelper(this, getIntent());
+ subInfoHelper.setActionBarTitle(
+ getActionBar(), getResources(), R.string.labelCdmaMore_with_label);
+
mButtonVoicePrivacy = (CheckBoxPreference) findPreference(BUTTON_VP_KEY);
- if (PhoneGlobals.getPhone().getPhoneType() != PhoneConstants.PHONE_TYPE_CDMA
+ if (subInfoHelper.getPhone().getPhoneType() != PhoneConstants.PHONE_TYPE_CDMA
|| getResources().getBoolean(R.bool.config_voice_privacy_disable)) {
//disable the entire screen
getPreferenceScreen().setEnabled(false);
@@ -52,6 +57,16 @@
}
@Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ final int itemId = item.getItemId();
+ if (itemId == android.R.id.home) {
+ onBackPressed();
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ @Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
if (preference.getKey().equals(BUTTON_VP_KEY)) {
return true;