summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/bluetooth
diff options
context:
space:
mode:
authorLifu Tang <lifu@google.com>2015-06-23 17:54:56 -0700
committerLifu Tang <lifu@google.com>2015-06-23 18:54:27 -0700
commit55601622d5ddd9d9ef0ace09ade96e999879bff7 (patch)
tree9201fecd0c33d6b80693c2fffe2092791ed26de7 /src/com/android/settings/bluetooth
parent52e728ab114d37b24a0c50dba58f8d81b4e1ea9b (diff)
downloadpackages_apps_Settings-55601622d5ddd9d9ef0ace09ade96e999879bff7.tar.gz
packages_apps_Settings-55601622d5ddd9d9ef0ace09ade96e999879bff7.tar.bz2
packages_apps_Settings-55601622d5ddd9d9ef0ace09ade96e999879bff7.zip
Language Update for Wi-Fi/Bluetooth Scanning
Bug: 22046234 Change-Id: Iea8fa2368d1e568a8e1fdd3edefa8f4fc6053e48
Diffstat (limited to 'src/com/android/settings/bluetooth')
-rwxr-xr-xsrc/com/android/settings/bluetooth/BluetoothSettings.java38
1 files changed, 25 insertions, 13 deletions
diff --git a/src/com/android/settings/bluetooth/BluetoothSettings.java b/src/com/android/settings/bluetooth/BluetoothSettings.java
index 663deef6a..68f47e7a6 100755
--- a/src/com/android/settings/bluetooth/BluetoothSettings.java
+++ b/src/com/android/settings/bluetooth/BluetoothSettings.java
@@ -21,6 +21,7 @@ import static android.os.UserManager.DISALLOW_CONFIG_BLUETOOTH;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
+import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
@@ -30,6 +31,7 @@ import android.preference.Preference;
import android.preference.PreferenceCategory;
import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
+import android.provider.Settings;
import android.text.Spannable;
import android.text.style.TextAppearanceSpan;
import android.util.Log;
@@ -381,20 +383,30 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem
return;
}
final CharSequence briefText = getText(R.string.bluetooth_empty_list_bluetooth_off);
- final StringBuilder contentBuilder = new StringBuilder();
- contentBuilder.append(briefText);
- contentBuilder.append("\n\n");
- contentBuilder.append(getText(R.string.ble_scan_notify_text));
+
+ final ContentResolver resolver = getActivity().getContentResolver();
+ final boolean bleScanningMode = Settings.Global.getInt(
+ resolver, Settings.Global.BLE_SCAN_ALWAYS_AVAILABLE, 0) == 1;
+
+ if (!bleScanningMode) {
+ // Show only the brief text if the scanning mode has been turned off.
+ mEmptyView.setText(briefText, TextView.BufferType.SPANNABLE);
+ } else {
+ final StringBuilder contentBuilder = new StringBuilder();
+ contentBuilder.append(briefText);
+ contentBuilder.append("\n\n");
+ contentBuilder.append(getText(R.string.ble_scan_notify_text));
+ LinkifyUtils.linkify(mEmptyView, contentBuilder, new LinkifyUtils.OnClickListener() {
+ @Override
+ public void onClick() {
+ final SettingsActivity activity =
+ (SettingsActivity) BluetoothSettings.this.getActivity();
+ activity.startPreferencePanel(ScanningSettings.class.getName(), null,
+ R.string.location_scanning_screen_title, null, null, 0);
+ }
+ });
+ }
getPreferenceScreen().removeAll();
- LinkifyUtils.linkify(mEmptyView, contentBuilder, new LinkifyUtils.OnClickListener() {
- @Override
- public void onClick() {
- final SettingsActivity activity =
- (SettingsActivity) BluetoothSettings.this.getActivity();
- activity.startPreferencePanel(ScanningSettings.class.getName(), null,
- R.string.location_scanning_screen_title, null, null, 0);
- }
- });
Spannable boldSpan = (Spannable) mEmptyView.getText();
boldSpan.setSpan(
new TextAppearanceSpan(getActivity(), android.R.style.TextAppearance_Medium), 0,