diff options
author | PauloftheWest <paulofthewest@google.com> | 2014-09-19 12:39:28 -0700 |
---|---|---|
committer | PauloftheWest <paulofthewest@google.com> | 2014-09-19 14:07:29 -0700 |
commit | 9bab4ea695efb6205b48d667db49f1964cf680ad (patch) | |
tree | b922afb23cead1cf1426a46098d8afb10a3a9a5b /src/com/android/settings/bluetooth | |
parent | 6e1d8277e6c6443ad286bf25a7decb4f5a9b0cdf (diff) | |
download | packages_apps_Settings-9bab4ea695efb6205b48d667db49f1964cf680ad.tar.gz packages_apps_Settings-9bab4ea695efb6205b48d667db49f1964cf680ad.tar.bz2 packages_apps_Settings-9bab4ea695efb6205b48d667db49f1964cf680ad.zip |
Fixed a Bluetooth discovery bug.
+ Now when a user goes to Settings->Bluetooth and turns on Bluetooth,
the device will be discoverable.
Bug: 17368189
Change-Id: Ia0d8000ddf7e3c3b43172c08ee28e7305d205462
Diffstat (limited to 'src/com/android/settings/bluetooth')
-rwxr-xr-x | src/com/android/settings/bluetooth/BluetoothSettings.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/settings/bluetooth/BluetoothSettings.java b/src/com/android/settings/bluetooth/BluetoothSettings.java index 826a45102..dd2c9df16 100755 --- a/src/com/android/settings/bluetooth/BluetoothSettings.java +++ b/src/com/android/settings/bluetooth/BluetoothSettings.java @@ -98,10 +98,17 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem private final BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { - String action = intent.getAction(); + final String action = intent.getAction(); + final int state = + intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR); + if (action.equals(BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED)) { updateDeviceName(context); } + + if (state == BluetoothAdapter.STATE_ON) { + mInitiateDiscoverable = true; + } } private void updateDeviceName(Context context) { |