发送 AVRCP 播放命令,收到广播垃圾邮件
我有一些硬件可以将 AVRCP 播放命令发送到手机 蓝牙连接时。我看到的是 MEDIA_BUTTON 操作 在调试器中一遍又一遍地发送意图垃圾邮件。这会引起问题 有一些应用程序,但主要是 Pandora。潘多拉会不断播放/暂停 一遍又一遍。这几乎就像 AVRCP 命令被发送到 生成持续发送的 MEDIA_BUTTON 广播的电话 一遍又一遍。
我设置了一个广播接收器来捕获它并尝试确定是什么 正在进行中。以下是垃圾邮件的内容:
01-17 12:20:04.324: 错误/NPT:(1558): 意图{ act=android.intent.action.MEDIA_BUTTON (有额外内容)} 01-17 12:20:04.324: 错误/NPT:(1558):KeyEvent{操作=0 代码=85 重复=0 元=0 扫描码=200 mFlags=8}
这是蓝牙播放/暂停媒体键。这是应该的 是,因为 AVRCP 命令触发了这个,但正如我所说,它就像 操作系统只是不断地发送垃圾邮件。
我尝试过使用 abortBroadcast() 方法来阻止它,但这已经 没有效果。我猜广播是无序的并且不能 明确停止?
我已经验证这不是硬件垃圾邮件 AVRCP 命令 调试我的固件代码。如果我 拔掉硬件插头。
我用的是2.2。
谢谢。
I have some hardware that sends the AVRCP play command to the phone
upon bluetooth connection. What I am seeing is the MEDIA_BUTTON action
intent spammed over and over in the debugger. This is causing problems
with a few apps but mainly Pandora. Pandora will constantly play/pause
over and over. It is almost like the AVRCP command gets sent to the
phone which generates a MEDIA_BUTTON broadcast that keeps getting sent
out over and over.
I set up a Broadcast Receiver to catch it and try to determine what's
going on. Here is what is being spammed:
01-17 12:20:04.324: ERROR/NPT:(1558):
Intent {
act=android.intent.action.MEDIA_BUTTON
(has extras) } 01-17 12:20:04.324:
ERROR/NPT:(1558): KeyEvent{action=0
code=85 repeat=0 meta=0 scancode=200
mFlags=8}
which is the bluetooth Play/Pause media key. This is what it should
be, as the AVRCP command triggers this, but as I said, it's like the
OS just keeps spamming this.
I have tried using the abortBroadcast()
method to stop it but that has
no effect. I am guessing the broadcast is non-ordered and can't be
stopped explicitly?
I have verified it is not the hardware spamming the AVRCP command by
debugging my firmware code. The spamming behavior also continues if I
unplug the hardware.
I am using 2.2.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题已经解决了。结果发现是硬件的问题。我发送了 AVRCP 播放按钮向下命令,但从未发送按钮向上命令。手机基本上将其视为“按住”播放按钮,因此它不断发送广播。
This has been resolved. Turns out it was a problem with the hardware. I was sending the AVRCP play button down command but never sending the button up command. The phone was basically seeing this as the play button being "held down" so it kept sending the broadcast.