Repository navigation
实例默认关掉通知提示音 - #213
Merged
Merged
实例默认关掉通知提示音#213
Conversation
新实例第一次开机不做(首次媒体扫描会把默认铃声写回去),之后的开机补做。 Refs ModAVD/ModAVD#280
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.
Refs ModAVD/ModAVD#280
改了什么
实例默认关掉通知提示音。开了声音的实例,开机约 18 秒系统会弹安全中心「未设置屏幕锁定」通知,并响一声默认通知音;现在开机后第一步执行
settings delete system notification_sound(再读回确认是null)。设置没了,默认通知音就解析成空,不创建播放轨道;通知照常显示。不依赖声卡,不动媒体音量、触摸音、铃声,不关安全中心、不禁用别的包。internal/emu/notifysound.go,在afterBoot里排第一个步骤。instances.<i>.notificationSoundMuted。老实例升级后的下一次开机补做,之后用户自己设的铃声不会被每次开机覆盖;不另外读系统原始默认值(各镜像的默认铃声不同)。initialized)不做:系统首次媒体扫描结束时会把默认铃声写回,实测在第一次开机里删掉的设置,下次开机读回的又是默认值。新建流程里装执行桥的那次重启(或用户第一次开机)再做,那时没有安全中心通知(它要问题出现满 12 小时才发)。firstBootInit:它只跑一次、而且就是上面那个会被写回的时机,老实例也不会再经过它。settings put system notification_sound ''实测无效(空值被忽略,原值还在)。声音关(没有声卡)时调音量也不生效,所以不靠音量。changelog.d/280-notification-sound.change.md;3 条新日志中文补了英文译文。测试
notifysound_windows_test.go,客体命令用假的 shell,根目录是临时目录):读回判断、一次性 marker、首次开机不做、失败 / 取消不写 marker 下次重试。go vet ./...、gofmt -l .、GOOS=darwin GOARCH=arm64和GOOS=linux GOARCH=amd64的go vet ./...通过;go test ./...只有internal/update的TestSelfUpdatePathAliases、TestInstallBlocksRawAndSharedSDKStarts在本机失败,这个包不依赖emu,本改动没碰(本机同时有别的实例在跑)。safety_center_recommendation通知入队,SystemUI 的RingtonePlayer报error loading sound for content://settings/system/notification_sound,没有播放轨道,settings get读回null。对照:默认铃声在时,同类通知会有一条播放轨道。null、marker 写上;再把默认铃声放回、marker 在,重启后不再动。null,再开机仍是null。