Skip to content

refactor: improve maintainability across playback, native, downloads and quality gates - #795

Open
cwuom wants to merge 2 commits into
masterfrom
refactor/maintainability-90
Open

cwuom wants to merge 2 commits into
masterfrom
refactor/maintainability-90

Conversation

@cwuom

@cwuom cwuom commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

描述 / Description

Motivation. A full code review of master@b8855dfd3 produced an issue register of 47 items across architecture, playback, native, multi-ROM and performance (maintainability scored 5/10). This PR fixes the confirmed defects, restructures the entry points that were too large to read or change safely, and tightens the quality gates so that the same problems cannot quietly return. The change is kept as one PR at the maintainer's request.

Key changes

Playback (:playback:runtime, :playback:logic)

  • Cold start no longer opens SimpleCache on the initialization thread. Identity restore, directory preparation, index checks and the legacy import run in an IO warmup; paths that read cache contents call awaitPlaybackMediaCache(). Cache publication and detachment share one lock, so a release during warmup cannot leave a reference to a closed cache.
  • When the preference snapshot is missing, the cache limit is treated as unknown: the cache is read-only and never evicts until the real limit arrives. Previously the default 1 GiB limit could evict data for users with an unlimited cache.
  • Playback position and playing state are written only through PlaybackStatusOwner.publishPosition/publishPlaying(source, value); all 57 writers name their source. Values and timing are unchanged.
  • Lyric default offsets, fade preferences and the Listen Together playback gate moved out of PlayerManager into owner classes (atomic snapshots, a port for the gate). PlayerManager.kt went from 1998 to 1838 lines.
  • initializePlaybackEngine (505 lines) and observePlaybackSettings (415 lines) are now ordered tables of contents over lifecycle/engine/ and lifecycle/settings/.
  • Debug builds log off-main-thread PlayerManager calls (PlayerMainThreadContract); the playback request token advances under a lock.

Native (:native)

  • Crash forwarding calls the previous handler with the original siginfo/context; the crash-log claim is an atomic exchange.
  • frameBytes and the native stream generation are std::atomic with release/acquire.
  • DSP JNI handles are tokens in a registry, so a double release or a call after release no longer dereferences freed memory.
  • Symbols are hidden by default with a version script: each ABI exports exactly the 36 Java_* entry points; libusb_* exports dropped from about 100 to 0.
  • Five modules with no production caller are removed from lib_neri.so (sources and host tests kept). The reserve-transfer activation path is removed because the target count always equals the baseline by design; behavior is unchanged.

Multi-ROM and performance

  • Hidden API exemptions are installed in the main process only and narrowed from everything to four prefixes, derived from the reflection call sites and a scan of the release dex.
  • The XMSF network cut used for Super Island now holds a 60 s lease with an AlarmManager fallback that restores access even if the process is killed.
  • Xiaomi Super Island and ColorOS lock-screen lyric settings are hidden on devices without the capability (capability first, vendor second), including settings search.
  • The previous ANR is captured off the main thread after first interaction; blur reuses one RenderScript script and skips work at zero strength; Super Island artwork is scaled once off the main thread.
  • The @Composable keep rule is removed (release APK −4.9%, dex −7.5%); always-true SDK checks and the unused RenderScript build flags are removed.

Structure and gates

  • MainActivity.onCreate (~985 → 16 lines) and NeriAppContent (1529 → 179 lines) are split into named stages and NeriApp*.kt files; call order is unchanged.
  • Clear-downloads: 14 characterization tests were written and passed on the original code first, then the path was split into eight files (≤422 lines) and the 391-line function into named stages. The module README documents the stages and invariants.
  • The three platform playlist detail screens share a detail chrome and mutation helpers.
  • New gates: a function-length ratchet (120 lines, 200 for @Composable; baselined functions may only shrink) and a domain allowlist budget (new entries need a written reason). The CRAP scope and the allowlist are split per module, and line-budget tests scan directories instead of a hand-maintained list, which removes the most common merge conflicts.
  • 34 copies of locateProjectFile are replaced by the :common test fixtures.
  • docs/architecture/module-graph.md is generated and checked for staleness; docs/architecture/README.md / README_EN.md is a one-page entry for maintainers and AI agents.

Risks and compatibility

  • No storage format, preference key, Room schema, Worker name or JNI symbol name changes.
  • Intended behavior changes: vendor lyric settings are hidden on unsupported devices; the crash dialog after an ANR may appear up to ~3 s later; XMSF access is restored after the lease expires.
  • The narrowed hidden API prefixes need checking on Flyme (status-bar lyrics flag), HyperOS with Shizuku (XMSF firewall) and an Android 9 device.
  • The USB exclusive changes passed the host gates but were not run against a real DAC.
  • Baseline Profiles reference a few renamed playback members and should be regenerated.

类型 / Type

  • Bug 修复 / Bug fix
  • 新功能 / New feature
  • 文档更新 / Documentation update
  • 其他(请描述)/ Other (please describe): refactoring and new quality gates

修复或解决的问题 / Issues fixed or closed by this PR

None filed; the items come from an internal code review issue register.

清单 / Checklist

  • 我已阅读并遵循贡献指南 / I have read and followed the contribution guidelines
  • 我已在本地测试这些更改 / I have tested these changes locally
  • 我已运行必要的构建、测试或静态检查 / I have run the required build, tests, or static checks
  • 我已更新相关文档或注释(如适用)/ I have updated relevant documentation or comments (if applicable)
  • 本次更改没有破坏原有行为 / This change does not break existing behavior
  • 本次更改向下兼容(如适用)/ This change is backward compatible (if applicable)
  • 改动只包含一个可独立审查的主题;超过 50 个文件或新增 1000 行时已拆分,或在下方说明无法拆分的原因 / The change covers one independently reviewable topic; above 50 files or 1,000 added lines it is split, or the reason it cannot be split is explained below
  • 没有提交密钥、Token 或其他敏感信息 / No secrets, tokens, or other sensitive information are committed
  • UI 变更已附截图或录屏(如适用)/ UI changes include screenshots or recordings (if applicable)

AI 协助 / AI assistance

  • 未使用 AI Agent 协助开发 / No AI agent was used for this change
  • 使用了 AI Agent 协助开发 / An AI agent assisted with this change

使用的 AI 模型 / AI model(s) used:

Claude Opus 5.5 (claude-opus-5-5); GPT-6.2 Sol via Codex CLI for the native changes and an adversarial review of the playback changes

其他信息 / Additional information

How it was tested (all on the integrated tree)

  • ./gradlew verifyModularization verifyFunctionLength verifyDomainDependencyBudget :native:externalNativeBuildDebug: passed. 17,602 JVM tests, 0 failures, 7 skipped; combined CRAP 16,269 scoped methods, 0 above 9; domain dependencies 0 violations; lint for app and all 15 owned libraries.
  • USB host gate: release-werror-asserts 37/37. asan-ubsan and tsan 35/37: usb_pcm_pipeline_test and usb_pcm_allocation_test time out locally on the unchanged base as well, and no PCM source changed here.
  • DSP host tests (Release and ASan/UBSan) pass, including the new crash-forwarding test. All four ABIs build in Debug and Release.
  • :app:assembleRelease -PallowUnsignedRelease=true: R8 passes, 15,546,562 bytes.
  • Emulator smoke test (API 37, release build signed with the debug key): 12-step onboarding including the Now Playing and lyrics previews, Home, YouTube Music playback, next track, Now Playing lyrics with translation, settings search. No crash, ANR or missing-class error; hidden API exemptions installed with no denial in logcat.

Not run: connectedDebugAndroidTest, real devices, a real USB DAC, Macrobenchmark. The androidTest sources compile.

Why one PR: the maintainer asked for a single PR. The work was produced as ten ordered topic patches (native, quality gates, playback ×2, downloads, review fixes, ROM/performance, follow-ups, app UI, UI follow-ups) and can be split along those lines later if needed.

Screenshots: release-build smoke screenshots are prepared locally and will be added in a comment, since they cannot be uploaded from the CLI.

Left for follow-up: the main-thread Room read in the lazy-initialization fallback (changing it alters command semantics), an explicit song source field (affects the sync identity format), an SPSC ring for the USB realtime path, TSan coverage of the USB session core, and about 17 files still between 1,900 and 1,999 lines.

  • 播放缓存改为异步预热,等待方法在缓存未就绪时等待;缓存上限未知时禁止写入。
  • 播放位置与播放状态写入集中到 PlaybackStatusOwner,由 PlaybackStatusWriter 标记来源。
  • XMSF 断网新增 60 秒租约、闹钟恢复与退避重试。
  • 厂商歌词设置按 RomLyricSurfaceSupport 设备能力隐藏。
  • 下载清空流程拆分为多个阶段,新增 ANR 捕获等待与崩溃标记原子写入。
  • 新增 JVM/Robolectric 测试覆盖上述行为,以及质量脚本与 Listen Together 安全暂停恢复。
  • 未运行 connectedDebugAndroidTest、真机、USB DAC 及 Macrobenchmark。
  • Flyme、HyperOS with Shizuku、Android 9 需兼容性复核。

…and quality gates

Address the code review issue register in a single change.

Playback:
- open the media cache off the initialization thread and await it where
  cache contents are read; publish and detach the cache under one lock
- treat an unknown cache limit as read-only so default preferences never
  evict an unlimited cache
- route playback position and playing-state writes through
  PlaybackStatusOwner with an explicit writer source
- move lyric default offsets, fade preferences and the Listen Together
  gate out of PlayerManager into owner classes
- split initializePlaybackEngine and observePlaybackSettings by stage and
  topic; file misplaced extension functions by responsibility
- log off-main-thread PlayerManager calls in debug builds and advance the
  playback request token under a lock

Native:
- forward crash signals to the previous handler with the original siginfo
  and claim the crash log with an atomic exchange
- make frameBytes and the stream generation atomic
- replace raw DSP engine pointers with a token table
- export only Java_* symbols and drop never-called modules from lib_neri.so
- remove the unreachable reserve-transfer path and narrow feedback math to
  128-bit

ROM and performance:
- install narrowed hidden API exemptions in the main process only
- restore XMSF network access through a 60 s lease with an alarm fallback
- hide Xiaomi Super Island and ColorOS lock-screen lyric settings on
  devices without the capability
- capture the previous ANR off the main thread, reuse the blur script and
  scale Super Island artwork off the main thread
- remove the @composable keep rule and dead SDK checks

Structure and quality gates:
- split MainActivity.onCreate, NeriAppContent and the clear-downloads path
  into named stages, with characterization tests for clear-downloads
- share a detail chrome across the three platform playlist screens
- add a function-length ratchet and a domain allowlist budget, split the
  CRAP scope and allowlist per module, and scan line budgets by directory
- deduplicate locateProjectFile into the :common test fixtures
- generate docs/architecture/module-graph.md and add an architecture
  quick reference for maintainers and agents
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T00:23:48.792774Z 9c9cf37 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Explain Change →

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

本次变更新增并接入 PR 尺寸提示、函数长度、域依赖预算和模块图检查。应用启动、主界面、播放状态与歌单详情实现拆分为多个辅助组件。下载清理与全库删除恢复流程分阶段处理。缓存初始化改为延迟解析并支持异步预热。新增 ROM 歌词能力检测和 XMSF 网络租约。原生代码调整崩溃信号处理、DSP 句柄管理和 USB 传输实现,并补充相应测试。

Merge Risk: Low · up to 9c9cf · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 标题“refactor: improve maintainability across playback, native, downloads and quality gates”概括了本 PR 的主要内容:播放、原生层、下载及质量门禁的重构。标题涵盖多个领域,范围较宽,但与变更集一致,未描述不存在的内容,也不是空泛描述。
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.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@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 (2)

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

Other comments: 8

tools_pub/quality/function_length.py: 2

405-405: Minor · Functional Correctness · Quick win

统一使用 UTF-8 读写基线。

扫描器允许中文函数名,并以 UTF-8 读取源码。但基线使用系统默认编码。在 cp1252 环境中,读取 UTF-8 基线可能失败或改变函数键;写入含中文键的 ensure_ascii=False 结果也会失败。

请为配置和基线的 read_text()、write_text() 显式指定 encoding="utf-8"。根据检索经验,文件读写必须显式指定 UTF-8;标准流编码不控制文件编码。

Also applies to: 422-422

Source: Learnings


181-183: Minor · Functional Correctness · Quick win

不要在未完成的 if 表达式后停止计数。

合法的表达式函数可以在 if (flag) 后换行,再编写多行 listOf(...) 分支。此处会在 if (flag) 后停止,因此整个函数只计两行。即使分支超过配置上限,检查仍会通过。

请跟踪条件表达式是否完成,再判断换行是否结束函数体。

app/src/main/java/moe/ouom/neriplayer/activity/MainActivity.kt: 2

1264-1264: Minor · Functional Correctness · Quick win

不要把已本地化的房间通知再次当作错误码解析。

收到 member_joined:unauthorized 时,Line 1254 生成带昵称的入房提示。showListenTogetherStatusFeedback 再解析这条文案,把昵称中的 unauthorized 识别为认证错误。用户看到的是认证失败,而不是成员加入。

请让这里直接显示已本地化的文案,或将原始通知交给统一入口,只转换一次。


1303-1303: Minor · Functional Correctness · Quick win

只清除本次已处理的邀请。

邀请 A 正在入房时,如果用户打开另一个房间的邀请 B,onNewIntent 会将 B 写入待处理槽。A 完成后会无条件清空该槽。B 的原始 Intent 已被重置,用户必须重新打开链接。

请在待处理槽仍持有本次请求时才清除它。这样 A 仍会正常关闭,后到的 B 不会被清除。

app/src/main/java/moe/ouom/neriplayer/ui/NeriAppNavigationHost.kt: 1

323-323: Minor · Functional Correctness · Quick win

快捷方式超时回退可能选中媒体库,但导航栈不切换。

“随机播放收藏”等待收藏歌单期间,如果用户切换到其他主标签页,超时后的回退可能只选中媒体库。navigateToMainTab 使用的是组合时的 currentRoute,而 AppLauncherShortcutEffect 的键不包含该路由,等待期间不会重启。守卫 shouldDispatchMainTabNavigation 因此判定为“已在媒体库”,不调用 navController.navigate。结果是底栏显示媒体库,内容仍停留在用户切换到的标签页,并且显示“收藏为空”的提示。

建议在效果内读取最新的导航回调:

建议修改

     val latestOnLauncherShortcutRequestConsumed by rememberUpdatedState(onRequestConsumed)
+    val latestNavigateToMainTab by rememberUpdatedState(navigateToMainTab)
         launcherShortcutMainTabRoute(request.action)?.let { route ->
-            navigateToMainTab(route)
+            latestNavigateToMainTab(route)
                 } else {
-                    navigateToMainTab(Destinations.Library.route)
+                    latestNavigateToMainTab(Destinations.Library.route)
                 if (favoritesSongs.isEmpty()) {
-                    navigateToMainTab(Destinations.Library.route)
+                    latestNavigateToMainTab(Destinations.Library.route)
app/src/main/java/moe/ouom/neriplayer/util/crash/CrashReportStore.kt: 1

30-30: Minor · Data Integrity & Integration · Quick win

让标记检查和删除也使用同一把锁。

后台 ANR 检查可以与崩溃线程写入标记同时执行。当 FileOutputStream 已创建空标记、但尚未写入内容时,hasPendingCrashReport 会读到空文件,并调用未加锁的 clearPendingCrashReport 删除标记。崩溃线程随后向已删除文件的句柄写入,无法恢复标记。下次启动因此不会显示这份崩溃报告。

请将标记读取、有效性检查及删除纳入同一同步边界,避免把正在写入的标记当成无效标记清理。

app/src/main/java/moe/ouom/neriplayer/ui/theme/background/CustomBackground.kt: 1

186-186: Minor · Stability & Availability · Quick win

在创建输出 Allocation 失败时释放输入 Allocation。

如果 Allocation.createTyped 因内存不足而抛出异常,此时尚未进入 try,已创建的 inputAllocation 不会执行 destroy()。这会在内存紧张时继续占用原生资源,直到运行时回收。

请在创建输入 Allocation 后立即建立 try/finally,并在其内部创建和管理输出 Allocation。这样成功和失败路径都能释放已创建的资源。

modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/ltw/ListenTogetherPlaybackGate.kt: 1

99-101: Minor · Stability & Availability · Heavy lift

旧的安全恢复完成会清除之后登记的暂停。

恢复请求 A 在途时,若第二次音频路由中断登记了暂停 B,待恢复标记会被设为 true。A 的刷新结束后,applyResponse() 不检查暂停是否已变化。应用成功后,completeSafetyPauseResume() 会无条件清除待恢复标记。这样 B 的保持状态会被提前清除:shouldHoldPlaybackForSafetyPause() 返回 false,后续 requestSafetyPauseResume() 也返回 false。若路由中断仍然存在,播放可能不再被 B 保持。

完成回调只能清除发起它的那次暂停。发起恢复时应记录暂停代次,完成和重试时核对代次。代次不一致时,应忽略该结果并保留 B 的待恢复状态。

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b8855df and 56f8509.

Files ignored due to path filters: 10

  • .github/PULL_REQUEST_TEMPLATE.md is excluded by !**/*.md
  • CONTRIBUTING.md is excluded by !**/*.md
  • CONTRIBUTING_EN.md is excluded by !**/*.md
  • docs/architecture/README.md is excluded by !**/*.md
  • docs/architecture/README_EN.md is excluded by !**/*.md
  • docs/architecture/module-graph.md is excluded by !**/*.md
  • modules/download/runtime/README.md is excluded by !**/*.md
  • modules/native/src/main/cpp/cmake/NeriNativeExports.map is excluded by !**/*.map
  • tools_pub/quality/README.md is excluded by !**/*.md
  • tools_pub/quality/README_EN.md is excluded by !**/*.md
Files selected for processing: 289

  • .github/CODEOWNERS
  • .github/scripts/pr_size.py
  • .github/scripts/test_pr_size.py
  • .github/workflows/android_ci.yml
  • app/build.gradle.kts
  • app/proguard-rules.pro
  • app/src/main/java/moe/ouom/neriplayer/NeriPlayerApplication.kt
  • app/src/main/java/moe/ouom/neriplayer/activity/ListenTogetherNoticeText.kt
  • app/src/main/java/moe/ouom/neriplayer/activity/MainActivity.kt
  • app/src/main/java/moe/ouom/neriplayer/activity/MainStageDialogs.kt
  • app/src/main/java/moe/ouom/neriplayer/activity/MainStartupDialogs.kt
  • app/src/main/java/moe/ouom/neriplayer/core/startup/crash/StartupCrashReportManager.kt
  • app/src/main/java/moe/ouom/neriplayer/core/startup/safemode/SafeModeCrashReports.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/NeriApp.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/NeriAppAppearance.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/NeriAppMainTabRoute.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/NeriAppNavigationHost.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/NeriAppNavigators.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/NeriAppNowPlaying.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/NeriAppPlaybackStartup.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/NeriAppPreferences.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/NeriAppScene.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/NeriAppThemeReveal.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/network/OfflineModeState.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/playback/visual/NowPlayingBlurPolicy.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/screen/playlist/BiliPlaylistDetailScreen.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/screen/playlist/NeteaseCollectionDetailScreen.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/screen/playlist/YouTubeMusicPlaylistDetailScreen.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/screen/playlist/detail/PlaylistDetailChrome.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/screen/playlist/detail/PlaylistDetailMutations.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/screen/tab/settings/component/lyrics/SettingsLyricsOffsetSection.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/screen/tab/settings/component/lyrics/coloros/ColorOsSystemUiAssetLoader.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/screen/tab/settings/page/SettingsSearchIndex.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/settings/UnavailableSettingKeys.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/theme/background/CustomBackground.kt
  • app/src/main/java/moe/ouom/neriplayer/util/crash/AnrWatchdog.kt
  • app/src/main/java/moe/ouom/neriplayer/util/crash/CrashReportStore.kt
  • app/src/main/java/moe/ouom/neriplayer/util/platform/DeviceUtil.kt
  • app/src/test/java/moe/ouom/neriplayer/activity/ListenTogetherNoticeTextTest.kt
  • app/src/test/java/moe/ouom/neriplayer/architecture/LocalManagementLineBudgetPolicyTest.kt
  • app/src/test/java/moe/ouom/neriplayer/architecture/LocalManagementLineBudgetTest.kt
  • app/src/test/java/moe/ouom/neriplayer/architecture/OwnedMainSourceLineBudgetTest.kt
  • app/src/test/java/moe/ouom/neriplayer/core/startup/app/AppProcessClassifierTest.kt
  • app/src/test/java/moe/ouom/neriplayer/core/startup/legacy/LegacyDownloadUpgradePlanTest.kt
  • app/src/test/java/moe/ouom/neriplayer/ui/NeriAppProcessingBannerLayoutPolicyTest.kt
  • app/src/test/java/moe/ouom/neriplayer/ui/NeriAppStateHoldersTest.kt
  • app/src/test/java/moe/ouom/neriplayer/ui/NowPlayingBlurPolicyTest.kt
  • app/src/test/java/moe/ouom/neriplayer/ui/component/download/BatchDownloadManagerSheetTest.kt
  • app/src/test/java/moe/ouom/neriplayer/ui/screen/DownloadProgressClearActionContractTest.kt
  • app/src/test/java/moe/ouom/neriplayer/ui/screen/tab/SettingsDownloadDirectoryFlowContractTest.kt
  • app/src/test/java/moe/ouom/neriplayer/ui/settings/UnavailableSettingKeysTest.kt
  • app/src/test/java/moe/ouom/neriplayer/ui/theme/background/BitmapBlurPlanTest.kt
  • app/src/test/java/moe/ouom/neriplayer/util/crash/CrashReportStoreTest.kt
  • app/src/test/java/moe/ouom/neriplayer/util/crash/StartupCaptureGateTest.kt
  • build-logic/convention/src/main/kotlin/QualityConfig.kt
  • build-logic/convention/src/main/kotlin/build-logic.android.module-quality.gradle.kts
  • build-logic/convention/src/main/kotlin/build-logic.android.sync-integration-quality.gradle.kts
  • build-logic/convention/src/test/kotlin/QualityConfigTest.kt
  • build.gradle.kts
  • config/quality/crap-scope.json
  • config/quality/crap-scope/app.json
  • config/quality/crap-scope/common.json
  • config/quality/crap-scope/database.json
  • config/quality/crap-scope/download-logic.json
  • config/quality/crap-scope/download-runtime.json
  • config/quality/crap-scope/listentogether.json
  • config/quality/crap-scope/local.json
  • config/quality/crap-scope/ltwlan.json
  • config/quality/crap-scope/lyrics.json
  • config/quality/crap-scope/model.json
  • config/quality/crap-scope/platform.json
  • config/quality/crap-scope/playback-logic.json
  • config/quality/crap-scope/playback-runtime.json
  • config/quality/crap-scope/shared.json
  • config/quality/crap-scope/sync.json
  • config/quality/domain-dependencies/download-logic.json
  • config/quality/domain-dependencies/download-runtime.json
  • config/quality/domain-dependencies/listentogether.json
  • config/quality/domain-dependencies/ltwlan.json
  • config/quality/domain-dependencies/lyrics.json
  • config/quality/domain-dependencies/platform.json
  • config/quality/domain-dependencies/playback-logic.json
  • config/quality/domain-dependencies/sync.json
  • config/quality/domain-dependency-budget.json
  • config/quality/function-length-baseline/app.json
  • config/quality/function-length-baseline/database.json
  • config/quality/function-length-baseline/download-runtime.json
  • config/quality/function-length-baseline/local.json
  • config/quality/function-length-baseline/platform.json
  • config/quality/function-length-baseline/playback-runtime.json
  • config/quality/function-length.json
  • modules/common/src/test/java/moe/ouom/neriplayer/architecture/RefactoredSourceFamilyResolverTest.kt
  • modules/common/src/testFixtures/java/moe/ouom/neriplayer/architecture/RefactoredSourceFamilyResolver.kt
  • modules/download/runtime/src/main/java/moe/ouom/neriplayer/core/download/manager/batch/GlobalDownloadManagerClear.kt
  • modules/download/runtime/src/main/java/moe/ouom/neriplayer/core/download/manager/batch/GlobalDownloadManagerClearArtifacts.kt
  • modules/download/runtime/src/main/java/moe/ouom/neriplayer/core/download/manager/batch/GlobalDownloadManagerClearFence.kt
  • modules/download/runtime/src/main/java/moe/ouom/neriplayer/core/download/manager/batch/GlobalDownloadManagerClearFullDelete.kt
  • modules/download/runtime/src/main/java/moe/ouom/neriplayer/core/download/manager/batch/GlobalDownloadManagerClearProgress.kt
  • modules/download/runtime/src/main/java/moe/ouom/neriplayer/core/download/manager/batch/GlobalDownloadManagerClearRecovery.kt
  • modules/download/runtime/src/main/java/moe/ouom/neriplayer/core/download/manager/batch/GlobalDownloadManagerClearStop.kt
  • modules/download/runtime/src/main/java/moe/ouom/neriplayer/core/download/manager/batch/GlobalDownloadManagerNetworkPolicyPause.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/BatchDownloadExecutionHostCharacterizationTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/BatchDownloadOperationRecoveryTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/DownloadSourceAvailabilityContractTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/DownloadTaskBatchCancellationPolicyTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/DownloadedAudioTagWriterTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/GlobalDownloadManagerCatalogRaceTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/GlobalDownloadManagerFullDeleteRecoveryContractTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/GlobalDownloadManagerLegacyRuntimeCharacterizationTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/GlobalDownloadManagerStartupArtifactRecoveryContractTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/GlobalDownloadManagerStartupPolicyTestSupport.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/PendingDownloadRecoveryPolicyTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/PostCoreRecoveryOwnershipContractTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/PreparedPipelineRemovalTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/TerminalTemporaryWriteCleanupRetryPolicyTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/execution/DownloadBatchNetworkFenceTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/execution/DownloadClearFenceStoreContractTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/execution/DownloadExecutionDurableStatePolicyTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/execution/DownloadExecutionHostGroup2Test.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/execution/DownloadExecutionHostGroup3Test.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/execution/DownloadExecutionHostTestSupport.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/execution/UidtJobRunTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/execution/UidtStopCoordinatorTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/manager/batch/DownloadClearTestHarness.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/manager/batch/GlobalDownloadManagerClearPhaseCharacterizationTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/manager/batch/GlobalDownloadManagerClearSettlementCharacterizationTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/storage/commit/ManagedDownloadStorageCommitWriterTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/storage/migration/ManagedDownloadMigrationRecoveryTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/storage/migration/ManagedDownloadMigrationTerminalRecoveryContractTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/storage/migration/ManagedDownloadMigrationWorkerProgressPolicyTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/storage/queue/DownloadRecoveryRoomStoreRuntimeCharacterizationTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/storage/reference/ManagedDownloadReferenceLookupTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/player/download/AudioDownloadManagerCancellationLeaseContractTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/player/download/AudioDownloadManagerGroup2Test.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/player/download/AudioDownloadManagerGroup3Test.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/player/download/AudioDownloadManagerPostCoreEnrichmentContractTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/player/download/AudioDownloadManagerTest.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/player/download/AudioDownloadManagerTestSupport.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/player/download/playback/AudioDownloadManagerPlaybackRaceTest.kt
  • modules/listentogether/build.gradle.kts
  • modules/ltwlan/src/main/java/moe/ouom/neriplayer/lanltw/session/LanKeepAlive.kt
  • modules/ltwlan/src/test/java/moe/ouom/neriplayer/lanltw/session/LanKeepAliveTest.kt
  • modules/native/src/main/cpp/CMakeLists.txt
  • modules/native/src/main/cpp/crash/native_crash_handler.cpp
  • modules/native/src/main/cpp/crash/native_crash_signal.h
  • modules/native/src/main/cpp/dsp/neri_dsp_engine_handles.h
  • modules/native/src/main/cpp/dsp/neri_dsp_jni.cpp
  • modules/native/src/main/cpp/tests/dsp/CMakeLists.txt
  • modules/native/src/main/cpp/tests/dsp/neri_crash_signal_test.cpp
  • modules/native/src/main/cpp/tests/dsp/neri_dsp_engine_test.cpp
  • modules/native/src/main/cpp/tests/usb/CMakeLists.txt
  • modules/native/src/main/cpp/tests/usb/exclusive/usb_runtime_report_v2_test.cpp
  • modules/native/src/main/cpp/tests/usb/feedback/usb_feedback_in_transfer_set_test.cpp
  • modules/native/src/main/cpp/tests/usb/feedback/usb_feedback_rate_math_test.cpp
  • modules/native/src/main/cpp/tests/usb/iso/usb_iso_transfer_window_test.cpp
  • modules/native/src/main/cpp/third_party/libusb/CMakeLists.txt
  • modules/native/src/main/cpp/usb/CMakeLists.txt
  • modules/native/src/main/cpp/usb/exclusive/CMakeLists.txt
  • modules/native/src/main/cpp/usb/exclusive/usb_exclusive_device_session.cpp
  • modules/native/src/main/cpp/usb/exclusive/usb_exclusive_pcm_playback.cpp
  • modules/native/src/main/cpp/usb/exclusive/usb_exclusive_recovery.cpp
  • modules/native/src/main/cpp/usb/exclusive/usb_exclusive_runtime_report.cpp
  • modules/native/src/main/cpp/usb/exclusive/usb_exclusive_session_internal.h
  • modules/native/src/main/cpp/usb/exclusive/usb_exclusive_session_state.h
  • modules/native/src/main/cpp/usb/exclusive/usb_exclusive_transfer_run.cpp
  • modules/native/src/main/cpp/usb/feedback/usb_feedback_rate_math.cpp
  • modules/native/src/main/cpp/usb/iso/usb_iso_transfer_window.h
  • modules/platform/build.gradle.kts
  • modules/playback/logic/src/main/java/moe/ouom/neriplayer/core/player/runtime/progress/PlaybackStatusOwner.kt
  • modules/playback/logic/src/test/java/moe/ouom/neriplayer/core/player/policy/pending/PendingMediaLoadPolicyTest.kt
  • modules/playback/logic/src/test/java/moe/ouom/neriplayer/core/player/runtime/progress/PlaybackStatusOwnerTest.kt
  • modules/playback/runtime/src/androidTest/java/moe/ouom/neriplayer/core/player/lifecycle/PlaybackMediaCachePersistenceTest.kt
  • modules/playback/runtime/src/main/AndroidManifest.xml
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/PlayerManager.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/audio/route/PlayerManagerAudioDeviceRoutePort.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/debug/PlayerMainThreadContract.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/dlna/session/PlayerManagerDlnaAdapter.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/heartbeat/PlayerManagerHeartbeatExtensions.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lan/LanAudioPresentation.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lan/LanGuestPlaybackSnapshot.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lan/LanHostStreamPublisher.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lan/LanPlayerAdapter.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lifecycle/PlaybackMediaCacheOwner.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lifecycle/PlayerManagerBiliSubtitleSettings.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lifecycle/PlayerManagerLifecycleExtensions.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lifecycle/PlayerStorageCacheClear.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lifecycle/PlayerStorageCacheEstimate.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lifecycle/StoredAudioCaches.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lifecycle/engine/PlaybackDecoderDiagnosticsListener.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lifecycle/engine/PlaybackPlayerErrorHandling.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lifecycle/engine/PlaybackPlayerListener.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lifecycle/settings/CacheAndQualitySettingsObservers.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lifecycle/settings/LyricSettingsObservers.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lifecycle/settings/OutputSettingsObservers.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lifecycle/settings/PlaybackBehaviorSettingsObservers.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lifecycle/settings/SoundSettingsObservers.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/ltw/ListenTogetherPlaybackGate.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/ltw/PlayerManagerListenTogetherGatePort.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/ltw/PlayerManagerListenTogetherHost.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lyrics/LyricSourceDefaultOffsets.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lyrics/PlayerManagerExternalBluetoothLyrics.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lyrics/PlayerManagerLiveLyricSurfaces.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/lyrics/PlayerManagerLyricOffsetExtensions.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/network/PlayerManagerNetworkResume.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/persistence/PlayerManagerPersistenceExtensions.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/persistence/PlayerManagerQueueCommandExtensions.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/persistence/PlayerManagerRestoredPlaybackResume.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/persistence/PlayerManagerStatePersistenceExtensions.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/playback/PlaybackFadePreferences.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/playback/PlaybackRequestToken.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/playback/PlayerManagerPlaybackExtensions.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/playback/PlayerManagerPlaybackStartCommands.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/playback/PlayerManagerQueueNavigationExtensions.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/playback/PlayerManagerSeekExtensions.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/playback/ServerPlaybackRecovery.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/playlist/PlayerManagerFavoriteExtensions.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/privileged/coloros/ColorOsPrivilegedBackendFactory.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/service/AudioPlayerService.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/service/PlaybackServiceStartPolicy.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/service/lifecycle/PlayerManagerServiceLifecycleExtensions.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/service/lyrics/RomLyricSurfaceCapabilities.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/service/lyrics/ShizukuXmsfNetworkHelper.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/service/lyrics/XiaomiSuperIslandArtwork.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/service/lyrics/XiaomiSuperIslandLyricBridge.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/service/lyrics/XmsfNetworkLease.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/shizuku/AndroidRuntimeCompatibility.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/shizuku/ShizukuHook.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/url/CachedPlaybackDescriptor.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/url/PlayerManagerListenTogetherStreamExtensions.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/url/PlayerManagerPlaybackCandidates.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/url/PlayerManagerUrlExtensions.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/usb/recovery/PlayerManagerUsbInterruptedPlaybackPort.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/usb/route/PlayerManagerUsbPlaybackRoutePort.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/usb/route/PlayerManagerUsbRoutePlayerSnapshot.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/usb/route/PlayerManagerUsbSystemAudioRoutePort.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/watchdog/PlayerManagerStartupWatchdogExtensions.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/PlayerManagerListenTogetherGateTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/debug/PlayerMainThreadContractTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/dlna/DlnaRound3StressAndSecurityTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/lan/LanAudioPresentationTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/lan/LanQueueSelectionConsistencyTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/lan/LanQueueSelectionTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/lifecycle/LegacyPlaybackCacheUpgradeTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/lifecycle/PlaybackMediaCacheOwnerTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/lifecycle/PlaybackMediaCacheWarmupTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/lifecycle/PlayerInitializationPolicyTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/lifecycle/StoredAudioCachesTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/ltw/ListenTogetherPlaybackGateTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/lyrics/ExternalLyricSurfaceGateTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/lyrics/LyricSourceDefaultOffsetsOwnerTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/persistence/PlayerManagerCurrentSongCommandsTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/persistence/PlayerManagerQueueRemovalTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/persistence/PlayerRestoredPlaybackResumeAdmissionTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/playback/LateLongFormResumeTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/playback/PlaybackFadePreferencesOwnerTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/playback/PlaybackRequestTokenTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/playback/PlayerManagerAudioRouteMuteTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/playback/PlayerManagerBufferedSeekTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/playback/PlayerManagerPlaybackFailureRecoveryTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/playback/ServerPlaybackRecoveryTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/prefetch/PlayerManagerMediaPrefetchTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/service/AudioPlayerServicePolicyTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/service/AudioPlayerServiceRestoreFailureTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/service/lyrics/RomLyricSurfaceCapabilitiesTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/service/lyrics/ShizukuXmsfNetworkHelperLeaseTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/service/lyrics/XiaomiSuperIslandArtworkTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/service/lyrics/XmsfNetworkLeaseTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/shizuku/AndroidRuntimeCompatibilityTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/url/ManagedLocalPlaybackGateTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/url/PlayerManagerUrlRefreshCooldownTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/watchdog/DeferredBiliRecoveryTest.kt
  • modules/sync/build.gradle.kts
  • tools_pub/quality/crap_report.py
  • tools_pub/quality/domain_dependencies.py
  • tools_pub/quality/domain_dependency_budget.py
  • tools_pub/quality/function_length.py
  • tools_pub/quality/module_boundaries.py
  • tools_pub/quality/module_graph.py
  • tools_pub/quality/module_scope.py
  • tools_pub/quality/quality_config.py
  • tools_pub/quality/test_domain_dependencies.py
  • tools_pub/quality/test_domain_dependency_budget.py
  • tools_pub/quality/test_download_boundaries.py
  • tools_pub/quality/test_function_length.py
  • tools_pub/quality/test_module_boundaries.py
  • tools_pub/quality/test_module_graph.py
  • tools_pub/quality/test_player_boundaries.py
  • tools_pub/quality/test_quality_config.py
  • tools_pub/usb-async-lab
Files with no reviewable changes: 7

  • app/proguard-rules.pro
  • config/quality/crap-scope.json
  • config/quality/domain-dependencies/platform.json
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/GlobalDownloadManagerStartupPolicyTestSupport.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/download/execution/DownloadExecutionHostTestSupport.kt
  • modules/download/runtime/src/test/java/moe/ouom/neriplayer/core/player/download/AudioDownloadManagerTestSupport.kt
  • modules/native/src/main/cpp/usb/exclusive/usb_exclusive_session_internal.h

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Comment on lines +373 to +378
if (!PersistentDownloadedSongDeleteIntentStore.clear(appContext)) {
NPLogger.w(TAG, "无 catalog 全库删除恢复意图未清理,保留栅栏")
return false
}
if (PersistentDownloadClearFenceStore.hasPersistedFence(appContext) &&
!PersistentDownloadClearFenceStore.clear(appContext)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Major · Stability & Availability · Heavy lift

Persisted full-library delete fence can stay after its intent is cleared.

If the fence clear fails after the intent is cleared, or the process exits between the two writes, the FULL fence remains with no pending intent. Download workers treat the active fence as a block. On later starts, the recovery routes reach the FULL recovery loop, which returns without releasing the fence. The fence can therefore block downloads across restarts.

The archived-intent failure is different: a later start clears its fence through the check at GlobalDownloadManagerFacadeBootstrap.kt:395-405. The cleared-intent case has no equivalent check.

Define a release rule for a persisted FULL fence that has no pending intent. The rule must bind release to the fence epoch. It must confirm the catalog state before releasing. Add it to the startup recovery path, so that a later start can release the fence.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Checked this against the code. The "blocked across restarts" part does not hold:

  • A full delete persists the intent before the fence (GlobalDownloadManagerCatalogDelete.kt:166-194 → GlobalDownloadManagerCancellation.kt:705-723), and the intent is cleared only after the confirmed-empty catalog is persisted. A FULL fence without an intent therefore means the delete already finished; it is never a delete still in progress.
  • On the next start the bootstrap sees an active fence with no pending intent and takes the else branch (GlobalDownloadManagerFacadeBootstrap.kt:442-455): requestAllDownloadTaskCancellation(purpose = FULL_LIBRARY_DELETE, forceConvergence = true). That releases the fence through the epoch-bound clearIfCurrent and wakes the execution pump. A probe test that simulated a restart confirmed the fence is released and downloads unblock.

What remains is narrower. Within the same process, the fence stays until the next start, because the deferred FULL recovery loop returns when the intent is null. This logic is unchanged from master; it moved verbatim from GlobalDownloadManagerClear.kt. I'm keeping it out of this PR and tracking it as a follow-up.

- xmsf: retry a failed lease restore with backoff (1 min doubling up to
  30 min) until networking is restored, also when the receiver times out
- crash: take the marker lock for reads and deletes so a concurrent check
  cannot delete a marker that is still being written
- blur: release the input allocation when creating the output fails
- listen together: a resume started before a newer safety pause neither
  applies its room state nor clears the newer pause; show localized room
  notices as is instead of parsing them again; finishing a join clears
  only the invite it handled
- shortcuts: navigate with the latest main-tab callback after waiting for
  favorites
- quality: read and write baselines and registries as UTF-8, and keep
  counting an expression body past an `if (...)` line
@cwuom

cwuom commented Dec 2, 2026

Copy link
Copy Markdown
Owner Author

Addressed the grouped CodeRabbit comments in 9c9cf37. Items marked (pre-existing) behave the same on master; they are fixed here because each change is small.

  • function_length.py encoding: baseline, config and registry reads and writes pass encoding="utf-8". The same applies to module_graph.py, module_scope.py and domain_dependency_budget.py.
  • function_length.py, if (flag) on its own line: an expression body keeps counting when a line ends with the closing paren of an if condition. Regression test added.
  • MainActivity, room notice parsed twice (pre-existing): the localized notice is shown directly.
  • MainActivity, invite cleared unconditionally (pre-existing): finishing a join clears only the invite it handled; an invite opened in the meantime stays. Test added.
  • NeriAppNavigationHost, shortcut fallback (pre-existing): the effect reads navigateToMainTab through rememberUpdatedState.
  • CrashReportStore: marker reads, validity checks and deletes take the same lock as writes. The regression test holds the lock over an empty marker and checks that a concurrent check waits.
  • CustomBackground: the input allocation is released if creating the output allocation fails.
  • ListenTogetherPlaybackGate, stale completion (pre-existing): a completion settles only a resume that is still in flight, since a newer safety pause resets the in-flight flag. The resume owner also skips applying a response once a newer safety pause has superseded it. Tests are in ListenTogetherPlaybackGateTest and ListenTogetherSafetyPauseResumeOwnerTest.

Local checks: testDebugUnitTest, verifyCrap and lintDebug passed for :app, :playback:runtime and :listentogether (4,574, 2,773 and 477 tests, 0 failures). The function-length, module-boundary and module-graph checks and the quality script tests (198) also pass.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c9cf3751e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +92 to 93
maxCacheSizeKnown = true
mediaCache?.let { evictor?.updateLimit(it, maxCacheSize) }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Retry retained-cache migration when the cache limit becomes known

When playback initializes without a cached preference snapshot and cache warmup finishes before the settings flow emits, the owner opens read-only and migrateRetainedPlaybackCaches() returns because canWriteCache is false. Once the actual limit arrives, this method enables writes but only updates the existing evictor; it neither invokes the migration callback again nor schedules the skipped import. Consequently, audio in retained legacy or recovery stores remains unavailable for offline playback for the rest of that process, even when the user's cache setting permits importing it. Schedule the deferred migration when transitioning from an unknown limit to a writable cache.

Useful? React with 👍 / 👎.

@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.

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

Other comments: 3

app/src/test/java/moe/ouom/neriplayer/util/crash/CrashReportStoreTest.kt: 1

108-109: Minor · Maintainability & Code Quality · Quick win

确认检查线程已到达锁,再完成写入。

如果 checker 在 200ms 内尚未获得调度,checker.isAlive 仍为 true。主线程随后写完标记,检查线程才开始检查。即使删除 hasPendingCrashReport 的同步锁,这条路径也能通过全部断言,漏掉启动崩溃报告被删除的回归。

请在持锁期间,有界等待并确认检查线程因该监视器进入 BLOCKED 状态。线程提前结束或超时都应使测试失败。

依据检索学习:线程尚未结束不能证明线程已到达竞争检查点。

Source: Learnings

modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/service/lyrics/XmsfNetworkLease.kt: 1

37-37: Minor · Stability & Availability · Quick win

新租约不会重排退避中的旧闹钟。

恢复连续失败后,闹钟可能已排到退避时间。若随后重新断网并续约,renew() 不会移动该闹钟(Line 38)。新租约的到期时间因此早于闹钟时间,闹钟晚于 expiresAtElapsedMs + durationMs。这与类注释中“停止续约后最多两个租期就会被闹钟收回”的约定不符(Line 22)。

例如,闹钟在 120、180、300 秒的恢复失败后排到 540 秒。在 320 秒重新断网时,新到期时间为 380 秒,应排的闹钟为 440 秒。但闹钟仍为 540 秒,XMSF 会保持断网到 540 秒。延迟最长接近 30 分钟,其他应用的推送会受影响。闹钟到点后会再次尝试恢复,因此断网不会无限持续。

应在 renew() 中同时处理闹钟早于新到期时间的情况,以及闹钟晚于新到期时间加一个租期的情况。普通连续续约的合并逻辑保持不变。

建议修改

     @Synchronized
     fun renew(nowElapsedMs: Long) {
         expiresAtElapsedMs = nowElapsedMs + durationMs
         restoreRetries = 0
-        if (alarmAtElapsedMs < expiresAtElapsedMs) {
+        if (alarmAtElapsedMs < expiresAtElapsedMs || alarmAtElapsedMs > expiresAtElapsedMs + durationMs) {
             alarmAtElapsedMs = expiresAtElapsedMs + durationMs
             alarm.arm(alarmAtElapsedMs)
         }
     }
tools_pub/quality/function_length.py: 1

197-197: Minor · Functional Correctness · Quick win

检查在行尾闭合的外层 if 条件。

以下合法函数会被计为 2 行,而不是 4 行:

fun f(a: Boolean, b: Boolean) =
    if (if (a) b else false)
        1
    else 2

conditions[-1] 选择内层 if。内层条件没有在行尾结束,因此此处返回 False,expression_end 随即提前结束。即使后续分支超过长度限制,门禁仍可能通过。

请检查是否存在条件括号在行尾闭合的 if,而不是只检查最后一个匹配。保留完整单行 if 表达式的正常结束行为。

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 56f8509 and 9c9cf37.

Files selected for processing: 21

  • app/src/main/java/moe/ouom/neriplayer/activity/MainActivity.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/NeriAppNavigationHost.kt
  • app/src/main/java/moe/ouom/neriplayer/ui/theme/background/CustomBackground.kt
  • app/src/main/java/moe/ouom/neriplayer/util/crash/CrashReportStore.kt
  • app/src/test/java/moe/ouom/neriplayer/activity/ListenTogetherInviteSlotTest.kt
  • app/src/test/java/moe/ouom/neriplayer/util/crash/CrashReportStoreTest.kt
  • modules/listentogether/src/main/java/moe/ouom/neriplayer/data/ltw/playback/ListenTogetherPlaybackHost.kt
  • modules/listentogether/src/main/java/moe/ouom/neriplayer/data/ltw/session/liveness/ListenTogetherSafetyPauseResumeOwner.kt
  • modules/listentogether/src/test/java/moe/ouom/neriplayer/data/ltw/session/liveness/ListenTogetherSafetyPauseResumeOwnerTest.kt
  • modules/listentogether/src/test/java/moe/ouom/neriplayer/data/ltw/testing/FakeListenTogetherPlaybackHost.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/ltw/ListenTogetherPlaybackGate.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/ltw/PlayerManagerListenTogetherHost.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/service/lyrics/ShizukuXmsfNetworkHelper.kt
  • modules/playback/runtime/src/main/java/moe/ouom/neriplayer/core/player/service/lyrics/XmsfNetworkLease.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/ltw/ListenTogetherPlaybackGateTest.kt
  • modules/playback/runtime/src/test/java/moe/ouom/neriplayer/core/player/service/lyrics/XmsfNetworkLeaseTest.kt
  • tools_pub/quality/domain_dependency_budget.py
  • tools_pub/quality/function_length.py
  • tools_pub/quality/module_graph.py
  • tools_pub/quality/module_scope.py
  • tools_pub/quality/test_function_length.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

This branch has not been deployed

No deployments
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