Skip to content

feat: stop playback and service on task removal and enhance audio route loss handling - #314

Open
cwuom wants to merge 2 commits into
masterfrom
intention/fix-task-removed-playback
Open

feat: stop playback and service on task removal and enhance audio route loss handling#314
cwuom wants to merge 2 commits into
masterfrom
intention/fix-task-removed-playback

Conversation

@cwuom

@cwuom cwuom commented Aug 10, 2026

Copy link
Copy Markdown
Owner

用户可见行为

  • 移除任务时,如果存在播放内容且传输处于活动状态,应用会立即停止播放并停止服务。
  • 移除任务时,如果传输未处于活动状态,应用会保留服务并更新通知。
  • 移除任务时,如果没有播放内容,应用不会执行播放、持久化或通知操作。
  • 蓝牙断开期间,应用会先抑制播放,再执行延迟暂停。
  • 音频路由丢失时,应用会刷新播放器输出并停止进度更新。
  • 暂停队列会在移除任务后保留。

兼容性影响

  • 内部 pauseImplpauseInternal 增加音频输出刷新参数。
  • 新增立即持久化状态流程,并设置 3 秒超时。
  • 未修改导出的公共实体。

测试

  • 新增任务移除策略和执行流程测试。
  • 覆盖活动传输、Listen Together、暂停队列、空播放内容、持久化顺序、播放停止失败及通知更新场景。

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cwuom, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 22 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Pro Plus

Run ID: 13bacc70-26d3-4a93-9783-76f28bc5f9bf

📥 Commits

Reviewing files that changed from the base of the PR and between 26e5667 and 8445a21.

📒 Files selected for processing (6)
  • app/src/main/java/moe/ouom/neriplayer/core/player/PlayerManager.kt
  • app/src/main/java/moe/ouom/neriplayer/core/player/lifecycle/PlayerManagerLifecycleExtensions.kt
  • app/src/main/java/moe/ouom/neriplayer/core/player/persistence/PlayerManagerPersistenceExtensions.kt
  • app/src/main/java/moe/ouom/neriplayer/core/player/playback/PlayerManagerPlaybackExtensions.kt
  • app/src/main/java/moe/ouom/neriplayer/core/player/service/AudioPlayerService.kt
  • app/src/test/java/moe/ouom/neriplayer/core/player/service/AudioPlayerServicePolicyTest.kt

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

此变更调整音频路由丢失时的暂停流程。流程会先抑制播放,再按需刷新播放器输出并设置为 STATE_IDLE。新增即时停止和立即持久化接口。任务移除时,服务仅在存在播放内容且传输活动时停止播放;其他场景会持久化状态或更新通知。新增任务移除策略和执行流程测试。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了任务移除时停止播放和服务,以及音频路由丢失处理增强这两个主要变更。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]

This comment was marked as outdated.

@cwuom

cwuom commented Aug 10, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 25 minutes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Pro Plus

Run ID: d9c2b3b8-3ff6-452b-80bf-0d5b0b1b3cb1

📥 Commits

Reviewing files that changed from the base of the PR and between 7e58536 and 8445a21.

📒 Files selected for processing (5)
  • app/src/main/java/moe/ouom/neriplayer/core/player/PlayerManager.kt
  • app/src/main/java/moe/ouom/neriplayer/core/player/persistence/PlayerManagerPersistenceExtensions.kt
  • app/src/main/java/moe/ouom/neriplayer/core/player/playback/PlayerManagerPlaybackExtensions.kt
  • app/src/main/java/moe/ouom/neriplayer/core/player/service/AudioPlayerService.kt
  • app/src/test/java/moe/ouom/neriplayer/core/player/service/AudioPlayerServicePolicyTest.kt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant