Wi-Fi Calling settings UI update

Bug: 28404126
Change-Id: Id9c44c0b97d2ef81502a65e9238e47656068db50
diff --git a/res/values/strings.xml b/res/values/strings.xml
index eb88210..b029799 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1984,6 +1984,7 @@
     <!-- Wi-Fi Calling settings. Text displayed when Wi-Fi Calling is off -->
     <string name="wifi_calling_off_explanation">When Wi-Fi calling is on, your phone can route calls via Wi-Fi networks or your carrier\u2019s network, depending on your preference and which signal is stronger. Before turning on this feature, check with your carrier regarding fees and other details.</string>
     <string name="emergency_address_title">Update Emergency Address</string>
+    <string name="emergency_address_summary">Address used by emergency services as your location if you make a 911 call using WiFi</string>
 
 
     <!-- Sound and alerts settings -->
diff --git a/res/xml/wifi_calling_settings.xml b/res/xml/wifi_calling_settings.xml
index 57e9efb..c32582c 100644
--- a/res/xml/wifi_calling_settings.xml
+++ b/res/xml/wifi_calling_settings.xml
@@ -29,7 +29,7 @@
     <Preference
         android:key="emergency_address_key"
         android:title="@string/emergency_address_title"
-        android:summary="@string/emergency_address_title">
+        android:summary="@string/emergency_address_summary">
     </Preference>
 
 </PreferenceScreen>
diff --git a/src/com/android/settings/WifiCallingSettings.java b/src/com/android/settings/WifiCallingSettings.java
index 0d8202d..b93b246 100644
--- a/src/com/android/settings/WifiCallingSettings.java
+++ b/src/com/android/settings/WifiCallingSettings.java
@@ -60,10 +60,16 @@
 
     private static final int REQUEST_CHECK_WFC_EMERGENCY_ADDRESS = 1;
 
+    public static final String EXTRA_LAUNCH_CARRIER_APP = "EXTRA_LAUNCH_CARRIER_APP";
+
+    public static final int LAUCH_APP_ACTIVATE = 0;
+    public static final int LAUCH_APP_UPDATE = 1;
+
     //UI objects
     private SwitchBar mSwitchBar;
     private Switch mSwitch;
     private ListPreference mButtonWfcMode;
+    private Preference mUpdateAddress;
     private TextView mEmptyView;
 
     private boolean mValidListener = false;
@@ -106,6 +112,7 @@
                     final Context context = getActivity();
                     Intent carrierAppIntent = getCarrierActivityIntent(context);
                     if (carrierAppIntent != null) {
+                        carrierAppIntent.putExtra(EXTRA_LAUNCH_CARRIER_APP, LAUCH_APP_UPDATE);
                         startActivity(carrierAppIntent);
                     }
                     return true;
@@ -185,7 +192,7 @@
         mButtonWfcMode = (ListPreference) findPreference(BUTTON_WFC_MODE);
         mButtonWfcMode.setOnPreferenceChangeListener(this);
 
-        Preference mUpdateAddress = (Preference) findPreference(PREFERENCE_EMERGENCY_ADDRESS);
+        mUpdateAddress = (Preference) findPreference(PREFERENCE_EMERGENCY_ADDRESS);
         mUpdateAddress.setOnPreferenceClickListener(mUpdateAddressListener);
 
         mIntentFilter = new IntentFilter();
@@ -274,6 +281,7 @@
         // Call address management activity before turning on WFC
         Intent carrierAppIntent = getCarrierActivityIntent(context);
         if (carrierAppIntent != null) {
+            carrierAppIntent.putExtra(EXTRA_LAUNCH_CARRIER_APP, LAUCH_APP_ACTIVATE);
             startActivityForResult(carrierAppIntent, REQUEST_CHECK_WFC_EMERGENCY_ADDRESS);
         } else {
             updateWfcMode(context, true);
@@ -343,8 +351,10 @@
         final PreferenceScreen preferenceScreen = getPreferenceScreen();
         if (wfcEnabled) {
             preferenceScreen.addPreference(mButtonWfcMode);
+            preferenceScreen.addPreference(mUpdateAddress);
         } else {
             preferenceScreen.removePreference(mButtonWfcMode);
+            preferenceScreen.removePreference(mUpdateAddress);
         }
         preferenceScreen.setEnabled(mEditableWfcMode);
     }