Don't show scan-always text if it is off.

bug:9206410
Change-Id: If7e06f50d3d8db6ea198f437d4d268e65ec96c16
This commit is contained in:
Robert Greenwalt
2013-05-30 11:33:36 -07:00
parent 1182f6755f
commit 5ac904321d

View File

@@ -743,16 +743,19 @@ public class WifiSettings extends SettingsPreferenceFragment
private void setOffMessage() { private void setOffMessage() {
if (mEmptyView != null) { if (mEmptyView != null) {
mEmptyView.setText(R.string.wifi_empty_list_wifi_off); mEmptyView.setText(R.string.wifi_empty_list_wifi_off);
mEmptyView.append("\n\n"); if (Settings.Global.getInt(getActivity().getContentResolver(),
int resId; Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE, 0) == 1) {
if (Settings.Secure.isLocationProviderEnabled(getActivity().getContentResolver(), mEmptyView.append("\n\n");
LocationManager.NETWORK_PROVIDER)) { int resId;
resId = R.string.wifi_scan_notify_text_location_on; if (Settings.Secure.isLocationProviderEnabled(getActivity().getContentResolver(),
} else { LocationManager.NETWORK_PROVIDER)) {
resId = R.string.wifi_scan_notify_text_location_off; resId = R.string.wifi_scan_notify_text_location_on;
} else {
resId = R.string.wifi_scan_notify_text_location_off;
}
CharSequence charSeq = getText(resId);
mEmptyView.append(charSeq);
} }
CharSequence charSeq = getText(resId);
mEmptyView.append(charSeq);
} }
getPreferenceScreen().removeAll(); getPreferenceScreen().removeAll();
} }