Since marshmallow update Bluetooth discovery using BluetoothAdapter.getDefaultAdapter().startDiscovery();
is broken.
This is because Bluetooth Adapter has been change in Android 6.0; You need to set the permission ACCESS_FINE_LOCATION
or ACCESS_COARSE_LOCATION
permission and need to use BluetoothLeScanner.startScan()
method to start the scan.
Same requirement if you're using BluetoothAdapter.getDefaultAdapter().startDiscovery();