What triggers the BluetoothDevice.ACTION_ACL broadcasts?

筅森魡賤 提交于 2019-11-29 23:00:16

I'm working with androids really messed up bt for quite some time now,

here is what i can tell you:

ACTION_ACL_CONNECTED is sent whenever a successful connection was established. This one is as simple as it gets.

Now the rather annoying part.

ACTION_ACL_DISCONNECTED is sent whenever the connection was closed on a HARDWARE level. WHEN that happens is a bit up to the device itself. IF you manually disconnect/plug out the other device, it somehow does not send a "dude, im gone" signal to the droid, instead after up to 20 seconds some watchdog barks and the connection is being closed and the intent is sent.

Now i did try this only with SPP devices that I connect to. A headset afaik is actively connecting by itself because its not SPP. So it automatically connects to you, if you are paired and in listening mode. Now i dont know what the headset does if you "power it off". Maybe it disconnects properly or maybe it just disrupts the connection without saying goodbye. In the latter case it would take some time for the watchdog to disconnect from the droid side, which can take from 0 to 20 seconds, dont ask me why, its just my observation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!