Pass subId on intent back to call settings.
Use the subscription info helper to configure the intent dispatched
when the UP arrow is clicked so that the user navigates backwards
to Call Settings for the SIM which they have been viewing.
Bug: 18633885
Change-Id: If89a5f280e058d88c13ac52c2070b7a248f63bea
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index de57fbc..9956397 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -1412,8 +1412,9 @@
* Finish current Activity and go up to the top level Settings ({@link CallFeaturesSetting}).
* This is useful for implementing "HomeAsUp" capability for second-level Settings.
*/
- public static void goUpToTopLevelSetting(Activity activity) {
- Intent intent = new Intent(activity, CallFeaturesSetting.class);
+ public static void goUpToTopLevelSetting(
+ Activity activity, SubscriptionInfoHelper subscriptionInfoHelper) {
+ Intent intent = subscriptionInfoHelper.getIntent(activity, CallFeaturesSetting.class);
intent.setAction(Intent.ACTION_MAIN);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
activity.startActivity(intent);
diff --git a/src/com/android/phone/GsmUmtsAdditionalCallOptions.java b/src/com/android/phone/GsmUmtsAdditionalCallOptions.java
index 0540547..30ce1fa 100644
--- a/src/com/android/phone/GsmUmtsAdditionalCallOptions.java
+++ b/src/com/android/phone/GsmUmtsAdditionalCallOptions.java
@@ -25,6 +25,7 @@
private final ArrayList<Preference> mPreferences = new ArrayList<Preference>();
private int mInitIndex = 0;
private Phone mPhone;
+ private SubscriptionInfoHelper mSubscriptionInfoHelper;
@Override
protected void onCreate(Bundle icicle) {
@@ -32,10 +33,10 @@
addPreferencesFromResource(R.xml.gsm_umts_additional_options);
- SubscriptionInfoHelper subscriptionInfoHelper = new SubscriptionInfoHelper(getIntent());
- subscriptionInfoHelper.setActionBarTitle(
+ mSubscriptionInfoHelper = new SubscriptionInfoHelper(getIntent());
+ mSubscriptionInfoHelper.setActionBarTitle(
getActionBar(), getResources(), R.string.additional_gsm_call_settings_with_label);
- mPhone = subscriptionInfoHelper.getPhone();
+ mPhone = mSubscriptionInfoHelper.getPhone();
PreferenceScreen prefSet = getPreferenceScreen();
mCLIRButton = (CLIRListPreference) prefSet.findPreference(BUTTON_CLIR_KEY);
@@ -94,7 +95,7 @@
public boolean onOptionsItemSelected(MenuItem item) {
final int itemId = item.getItemId();
if (itemId == android.R.id.home) { // See ActionBar#setDisplayHomeAsUpEnabled()
- CallFeaturesSetting.goUpToTopLevelSetting(this);
+ CallFeaturesSetting.goUpToTopLevelSetting(this, mSubscriptionInfoHelper);
return true;
}
return super.onOptionsItemSelected(item);
diff --git a/src/com/android/phone/GsmUmtsCallForwardOptions.java b/src/com/android/phone/GsmUmtsCallForwardOptions.java
index 3c4bebe..fe27850 100644
--- a/src/com/android/phone/GsmUmtsCallForwardOptions.java
+++ b/src/com/android/phone/GsmUmtsCallForwardOptions.java
@@ -45,6 +45,7 @@
private boolean mFirstResume;
private Bundle mIcicle;
private Phone mPhone;
+ private SubscriptionInfoHelper mSubscriptionInfoHelper;
@Override
protected void onCreate(Bundle icicle) {
@@ -52,10 +53,10 @@
addPreferencesFromResource(R.xml.callforward_options);
- SubscriptionInfoHelper subscriptionInfoHelper = new SubscriptionInfoHelper(getIntent());
- subscriptionInfoHelper.setActionBarTitle(
+ mSubscriptionInfoHelper = new SubscriptionInfoHelper(getIntent());
+ mSubscriptionInfoHelper.setActionBarTitle(
getActionBar(), getResources(), R.string.call_forwarding_settings_with_label);
- mPhone = subscriptionInfoHelper.getPhone();
+ mPhone = mSubscriptionInfoHelper.getPhone();
PreferenceScreen prefSet = getPreferenceScreen();
mButtonCFU = (CallForwardEditPreference) prefSet.findPreference(BUTTON_CFU_KEY);
@@ -181,7 +182,7 @@
public boolean onOptionsItemSelected(MenuItem item) {
final int itemId = item.getItemId();
if (itemId == android.R.id.home) { // See ActionBar#setDisplayHomeAsUpEnabled()
- CallFeaturesSetting.goUpToTopLevelSetting(this);
+ CallFeaturesSetting.goUpToTopLevelSetting(this, mSubscriptionInfoHelper);
return true;
}
return super.onOptionsItemSelected(item);
diff --git a/src/com/android/phone/settings/fdn/FdnSetting.java b/src/com/android/phone/settings/fdn/FdnSetting.java
index 8716d37..acbe0b8 100644
--- a/src/com/android/phone/settings/fdn/FdnSetting.java
+++ b/src/com/android/phone/settings/fdn/FdnSetting.java
@@ -521,7 +521,7 @@
public boolean onOptionsItemSelected(MenuItem item) {
final int itemId = item.getItemId();
if (itemId == android.R.id.home) { // See ActionBar#setDisplayHomeAsUpEnabled()
- CallFeaturesSetting.goUpToTopLevelSetting(this);
+ CallFeaturesSetting.goUpToTopLevelSetting(this, mSubscriptionInfoHelper);
return true;
}
return super.onOptionsItemSelected(item);