diff options
author | Etan Cohen <etancohen@google.com> | 2015-03-31 11:26:54 -0700 |
---|---|---|
committer | Etan Cohen <etancohen@google.com> | 2015-03-31 11:26:54 -0700 |
commit | 7caa77e40c58e2fe51b9358772af4e5c5832147a (patch) | |
tree | 67ab2939da775197464129531d1b03be8353b7c1 /src | |
parent | 0ef5c998f2f248195fbc8334e72cfdb87c77e614 (diff) | |
parent | 22416075708990c5820fd18de7c028c017c6f1ab (diff) | |
download | packages_apps_Settings-7caa77e40c58e2fe51b9358772af4e5c5832147a.zip packages_apps_Settings-7caa77e40c58e2fe51b9358772af4e5c5832147a.tar.gz packages_apps_Settings-7caa77e40c58e2fe51b9358772af4e5c5832147a.tar.bz2 |
Merge commit '2241607' into merge
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/WifiCallingSettings.java | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/com/android/settings/WifiCallingSettings.java b/src/com/android/settings/WifiCallingSettings.java index 0638c94..c950949 100644 --- a/src/com/android/settings/WifiCallingSettings.java +++ b/src/com/android/settings/WifiCallingSettings.java @@ -25,10 +25,12 @@ import android.content.IntentFilter; import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; +import android.preference.PreferenceScreen; import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; import android.util.Log; import android.widget.Switch; +import android.widget.TextView; import com.android.ims.ImsConfig; import com.android.ims.ImsManager; @@ -53,6 +55,7 @@ public class WifiCallingSettings extends SettingsPreferenceFragment private SwitchBar mSwitchBar; private Switch mSwitch; private ListPreference mButtonWfcMode; + private TextView mEmptyView; private final PhoneStateListener mPhoneStateListener = new PhoneStateListener() { /* @@ -90,6 +93,10 @@ public class WifiCallingSettings extends SettingsPreferenceFragment mSwitchBar = activity.getSwitchBar(); mSwitch = mSwitchBar.getSwitch(); mSwitchBar.show(); + + mEmptyView = (TextView) getView().findViewById(android.R.id.empty); + getListView().setEmptyView(mEmptyView); + mEmptyView.setText(R.string.wifi_calling_off_explanation); } @Override @@ -107,7 +114,7 @@ public class WifiCallingSettings extends SettingsPreferenceFragment AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setMessage(message) .setTitle(title) - .setIcon(android.R.drawable.stat_sys_warning) + .setIcon(android.R.drawable.ic_dialog_alert) .setPositiveButton(android.R.string.ok, null); AlertDialog dialog = builder.create(); dialog.show(); @@ -212,6 +219,13 @@ public class WifiCallingSettings extends SettingsPreferenceFragment int wfcMode = ImsManager.getWfcMode(context); mButtonWfcMode.setSummary(getWfcModeSummary(context, wfcMode)); mButtonWfcMode.setEnabled(isChecked); + + final PreferenceScreen preferenceScreen = getPreferenceScreen(); + if (isChecked) { + preferenceScreen.addPreference(mButtonWfcMode); + } else { + preferenceScreen.removePreference(mButtonWfcMode); + } } @Override @@ -230,17 +244,17 @@ public class WifiCallingSettings extends SettingsPreferenceFragment } static int getWfcModeSummary(Context context, int wfcMode) { - int resId = R.string.wifi_calling_off_summary; + int resId = com.android.internal.R.string.wifi_calling_off_summary; if (ImsManager.isWfcEnabledByUser(context)) { switch (wfcMode) { case ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY: - resId = R.string.wfc_mode_wifi_only_summary; + resId = com.android.internal.R.string.wfc_mode_wifi_only_summary; break; case ImsConfig.WfcModeFeatureValueConstants.CELLULAR_PREFERRED: - resId = R.string.wfc_mode_cellular_preferred_summary; + resId = com.android.internal.R.string.wfc_mode_cellular_preferred_summary; break; case ImsConfig.WfcModeFeatureValueConstants.WIFI_PREFERRED: - resId = R.string.wfc_mode_wifi_preferred_summary; + resId = com.android.internal.R.string.wfc_mode_wifi_preferred_summary; break; default: Log.e(TAG, "Unexpected WFC mode value: " + wfcMode); |