summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLifu Tang <lifu@google.com>2015-04-06 22:39:40 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-04-06 22:39:40 +0000
commitd858ed9784af6a19627fdabceed41dc8460ee6b0 (patch)
treefdf1b3136ec91808661aeb6406ec3a6ec400947a
parentc36e1c4e0acd694edd5524f3719f984f1057ff59 (diff)
parent0ac63cdca22950ebad0f9ce82913768486983ac3 (diff)
downloadpackages_apps_Settings-d858ed9784af6a19627fdabceed41dc8460ee6b0.tar.gz
packages_apps_Settings-d858ed9784af6a19627fdabceed41dc8460ee6b0.tar.bz2
packages_apps_Settings-d858ed9784af6a19627fdabceed41dc8460ee6b0.zip
Merge "Updated system settings to control BLE scanning"
-rw-r--r--src/com/android/settings/location/ScanningSettings.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/settings/location/ScanningSettings.java b/src/com/android/settings/location/ScanningSettings.java
index 428701a29..5eb424de0 100644
--- a/src/com/android/settings/location/ScanningSettings.java
+++ b/src/com/android/settings/location/ScanningSettings.java
@@ -30,6 +30,7 @@ import com.android.settings.SettingsPreferenceFragment;
*/
public class ScanningSettings extends SettingsPreferenceFragment {
private static final String KEY_WIFI_SCAN_ALWAYS_AVAILABLE = "wifi_always_scanning";
+ private static final String KEY_BLUETOOTH_SCAN_ALWAYS_AVAILABLE = "bluetooth_always_scanning";
@Override
protected int getMetricsCategory() {
@@ -54,10 +55,14 @@ public class ScanningSettings extends SettingsPreferenceFragment {
}
private void initPreferences() {
- SwitchPreference scanAlwaysAvailable =
+ final SwitchPreference wifiScanAlwaysAvailable =
(SwitchPreference) findPreference(KEY_WIFI_SCAN_ALWAYS_AVAILABLE);
- scanAlwaysAvailable.setChecked(Global.getInt(getContentResolver(),
+ wifiScanAlwaysAvailable.setChecked(Global.getInt(getContentResolver(),
Global.WIFI_SCAN_ALWAYS_AVAILABLE, 0) == 1);
+ final SwitchPreference bleScanAlwaysAvailable =
+ (SwitchPreference) findPreference(KEY_BLUETOOTH_SCAN_ALWAYS_AVAILABLE);
+ bleScanAlwaysAvailable.setChecked(Global.getInt(getContentResolver(),
+ Global.BLE_SCAN_ALWAYS_AVAILABLE, 0) == 1);
}
@Override
@@ -67,6 +72,10 @@ public class ScanningSettings extends SettingsPreferenceFragment {
Global.putInt(getContentResolver(),
Global.WIFI_SCAN_ALWAYS_AVAILABLE,
((SwitchPreference) preference).isChecked() ? 1 : 0);
+ } else if (KEY_BLUETOOTH_SCAN_ALWAYS_AVAILABLE.equals(key)) {
+ Global.putInt(getContentResolver(),
+ Global.BLE_SCAN_ALWAYS_AVAILABLE,
+ ((SwitchPreference) preference).isChecked() ? 1 : 0);
} else {
return super.onPreferenceTreeClick(screen, preference);
}