Commit 3c5580b1 authored by Andreas Schildbach's avatar Andreas Schildbach
Browse files

ScannerFragment.kt: Better debug output for BOND_STATE_CHANGED broadcast.

parent fd6ac67c
......@@ -65,7 +65,9 @@ class ScannerFragment : Fragment() {
val receiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
System.out.println("===== onReceive " + intent)
val bondState = intent.extras!!.getInt(BluetoothDevice.EXTRA_BOND_STATE)
val device = intent.extras!!.getParcelable(BluetoothDevice.EXTRA_DEVICE) as BluetoothDevice?
System.out.println("=== onReceive ${intent.action} ${if (bondState == BluetoothDevice.BOND_NONE) "NONE" else if (bondState == BluetoothDevice.BOND_BONDING) "BONDING" else if (bondState == BluetoothDevice.BOND_BONDED) "BONDED" else bondState} ${device}")
listAdapter.notifyDataSetChanged()
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment