diff options
author | Lifu Tang <lifu@google.com> | 2015-04-06 22:39:40 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-06 22:39:40 +0000 |
commit | d858ed9784af6a19627fdabceed41dc8460ee6b0 (patch) | |
tree | fdf1b3136ec91808661aeb6406ec3a6ec400947a /src/com/android | |
parent | c36e1c4e0acd694edd5524f3719f984f1057ff59 (diff) | |
parent | 0ac63cdca22950ebad0f9ce82913768486983ac3 (diff) | |
download | packages_apps_Settings-d858ed9784af6a19627fdabceed41dc8460ee6b0.tar.gz packages_apps_Settings-d858ed9784af6a19627fdabceed41dc8460ee6b0.tar.bz2 packages_apps_Settings-d858ed9784af6a19627fdabceed41dc8460ee6b0.zip |
Merge "Updated system settings to control BLE scanning"
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/settings/location/ScanningSettings.java | 13 |
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); } |