Language Update for Wi-Fi/Bluetooth Scanning

Bug: 22046234
Change-Id: Iea8fa2368d1e568a8e1fdd3edefa8f4fc6053e48
This commit is contained in:
Lifu Tang
2015-06-23 17:54:56 -07:00
parent 52e728ab11
commit 55601622d5
3 changed files with 48 additions and 30 deletions

View File

@@ -708,8 +708,17 @@ public class WifiSettings extends RestrictedSettingsFragment
}
final CharSequence briefText = getText(R.string.wifi_empty_list_wifi_off);
if (isUiRestricted()) {
// Show only the brief text if the user is not allowed to configure scanning settings.
// Don't use WifiManager.isScanAlwaysAvailable() to check the Wi-Fi scanning mode. Instead,
// read the system settings directly. Because when the device is in Airplane mode, even if
// Wi-Fi scanning mode is on, WifiManager.isScanAlwaysAvailable() still returns "off".
final ContentResolver resolver = getActivity().getContentResolver();
final boolean wifiScanningMode = Settings.Global.getInt(
resolver, Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE, 0) == 1;
if (isUiRestricted() || !wifiScanningMode) {
// Show only the brief text if the user is not allowed to configure scanning settings,
// or the scanning mode has been turned off.
mEmptyView.setText(briefText, BufferType.SPANNABLE);
} else {
// Append the description of scanning settings with link.