支持将 WiTV 设为启动桌面 - #9
Merged
Merged
Conversation
Add an opt-in "作为桌面启动" toggle under 播放选项. It flips a disabled-by-default HOME activity-alias, so the system never sees WiTV as a launcher unless the user asks for it. Apps can't make themselves the default home, so enabling it opens the system home settings, or on boxes without that page briefly enables a second HOME alias to make the system drop the saved default and re-ask. The exit dialog gets a "切换应用" button listing other launchers and every launchable app, plus a "更改默认桌面…" entry — the only way out to other apps once WiTV is home. PlayerActivity becomes singleTask so Home returns to the running instance, and "休息一下" moves the task back instead of finishing when WiTV is the default home (finishing would just get it relaunched). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Testing on a p230 (Android 7.1) turned up four problems: - Pressing Home with WiTV as default launcher started a second PlayerActivity in the home stack while the original task kept running, so two players pulled the stream at once. A new instance now finishes the old one, and the old one no longer clears the PlayerManager the new one registered. - On boot the box's mediacodec service crashes (SIGILL) and is gone for ~30 s. ExoPlayer's playback thread blocked on the codec query while the data kept arriving, and the 15 s source timeout then gave up with "all sources failed". Warm up MediaCodecList on a background thread before playing, with a hint if it takes a while, so the source timer only starts once decoding is possible. Also wait for network before the first load. - The app switcher listed com.android.provision as a launcher. Only list HOME activities with the default priority, which drops setup wizards and FallbackHome. - The system home settings page was opened inside WiTV's task; open it in its own task. Docs: add the launcher section with real-device screenshots to the user guide and refresh the exit dialog and playback settings screenshots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
改动概要
activity-alias:开关不打开时,系统完全不会把 WiTV 当作桌面。PlayerActivity改为singleTask,新实例创建时会关掉旧实例。作为桌面被拉起时,它可能和从启动器打开的那个实例分属两个任务;不做处理的话,两个播放器会同时拉流。finish()。否则系统会立刻把桌面重新拉起来。MediaCodecList,然后才起播。测试盒子开机时 mediacodec 会崩溃,约 30 秒不可用。这期间 ExoPlayer 的播放线程卡在解码器查询上,15 秒的换源超时一到就判为「所有播放源均不可用」。预热之后,换源计时从能解码时才开始。FallbackHome,它们是优先级不为默认值的 HOME 组件。测试
./gradlew testDebugUnitTest(LauncherHelperTest:排除自身、按包名去重、按名称排序、过滤非桌面的 HOME 组件)./gradlew assembleDebug已知行为
🤖 Generated with Claude Code