Repository navigation
fix: wake RFCOMM reader when receive queue has space - #18
Merged
Merged
Conversation
xiwangly2
marked this pull request as ready for review
October 15, 2026 04:19
Owner
|
Thanks for contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RFCOMM 接收队列达到 64 KiB 后,读取线程会等待可用空间,但
takePendingLocked()消费数据后没有通知它。即使队列已排空,后续recv()仍可能持续超时。本次在消费释放空间后调用
lock.notifyAll(),覆盖整块读取和部分读取两条路径。队列修改仍在同一把锁内完成,读取线程重新取得锁后再检查容量和关闭状态。新增 shared 模块的 Robolectric 回归测试,仅替换 Android BluetoothSocket 边界,运行真实队列和读取线程:
验证(基于最新 main
39485f9)::shared:testDebugUnitTest:422 项通过,无失败或跳过。:mobile:lintDebug、:mobile:assembleDebug和git diff --check通过。sh依赖限制;两类代表用例已在不含此修复的源码上复现。完整 common 覆盖请结合 Linux CI 结果。已在萤火虫车机验证;上述结果验证的是实际实现的 JVM 队列与线程路径。