am 04301e3d: am 3845f270: am 27dcfbbd: Merge "Fixed a Bluetooth discovery bug." into lmp-dev

* commit '04301e3d9b1b8dc0b21b97d01856474fa10990d5':
  Fixed a Bluetooth discovery bug.
This commit is contained in:
PauloftheWest
2014-09-20 00:13:33 +00:00
committed by Android Git Automerger

View File

@@ -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) {