From 0dc4311333fda923a421c8226dc05cbcc6d41e93 Mon Sep 17 00:00:00 2001 From: Meng Wang Date: Thu, 2 Jun 2016 17:06:22 -0700 Subject: [PATCH] Wi-Fi Calling settings UI update Bug: 28404126 Change-Id: Id9c44c0b97d2ef81502a65e9238e47656068db50 --- res/values/strings.xml | 1 + res/xml/wifi_calling_settings.xml | 2 +- src/com/android/settings/WifiCallingSettings.java | 12 +++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index eb882102a20..b0297991bc3 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1984,6 +1984,7 @@ 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. Update Emergency Address + Address used by emergency services as your location if you make a 911 call using WiFi diff --git a/res/xml/wifi_calling_settings.xml b/res/xml/wifi_calling_settings.xml index 57e9efba5cd..c32582c7493 100644 --- a/res/xml/wifi_calling_settings.xml +++ b/res/xml/wifi_calling_settings.xml @@ -29,7 +29,7 @@ + android:summary="@string/emergency_address_summary"> diff --git a/src/com/android/settings/WifiCallingSettings.java b/src/com/android/settings/WifiCallingSettings.java index 0d8202d0ccd..b93b24627fa 100644 --- a/src/com/android/settings/WifiCallingSettings.java +++ b/src/com/android/settings/WifiCallingSettings.java @@ -60,10 +60,16 @@ public class WifiCallingSettings extends SettingsPreferenceFragment 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 @@ public class WifiCallingSettings extends SettingsPreferenceFragment 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 @@ public class WifiCallingSettings extends SettingsPreferenceFragment 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 @@ public class WifiCallingSettings extends SettingsPreferenceFragment // 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 @@ public class WifiCallingSettings extends SettingsPreferenceFragment final PreferenceScreen preferenceScreen = getPreferenceScreen(); if (wfcEnabled) { preferenceScreen.addPreference(mButtonWfcMode); + preferenceScreen.addPreference(mUpdateAddress); } else { preferenceScreen.removePreference(mButtonWfcMode); + preferenceScreen.removePreference(mUpdateAddress); } preferenceScreen.setEnabled(mEditableWfcMode); }