发送 AVRCP 播放命令,收到广播垃圾邮件

发布于 2024-10-14 20:46:56 字数 670 浏览 3 评论 0原文

我有一些硬件可以将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼角的笑意。 2024-10-21 20:46:56

这个问题已经解决了。结果发现是硬件的问题。我发送了 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文