Repository navigation
fix: persist the lock screen music switches - #48
Merged
Merged
Conversation
HookSettings.write() never wrote the four keys that toSettings() reads for the lock screen music switches, so those switches could not survive a settings-process restart. The switches looked like they worked: update() changed the in-memory copy and Compose redrew, and the features themselves ran because SystemUI is driven by applySettings() over the probe bridge rather than through this file. The saved value was simply never written to disk, so the next HookSettingsStore construction read the default (false) and the switch came back off. Reopening the settings app is enough to see it: turn on the music lockscreen and lock screen lyrics switches, dismiss the settings app from recents, open it again - both switches are off again. Verified against this fix on Xiaomi 17 Pro Max (HyperOS 4, Android 17): both stay on. The same omission affects two related switches, fixed alongside: - KEY_LOCKSCREEN_MUSIC_LYRICS_HDR_ENABLED - KEY_LOCKSCREEN_MUSIC_LYRICS_KEEP_SCREEN_ON One file, four putBoolean calls, no logic change.
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.
What
HookSettings.write()never wrote four keys thattoSettings()reads for the lock screen music switches:KEY_LOCKSCREEN_MUSIC_LOCKSCREEN_ENABLEDKEY_LOCKSCREEN_MUSIC_LYRICS_ENABLEDKEY_LOCKSCREEN_MUSIC_LYRICS_HDR_ENABLEDKEY_LOCKSCREEN_MUSIC_LYRICS_KEEP_SCREEN_ONEach is defined and read, but had no corresponding
putBooleaninwrite(). This restores the write side. One file, fourputBooleancalls, no logic change.Why the switches appeared to work
That is the whole symptom: the switch is on until the settings process restarts, and the feature keeps working the entire time because SystemUI is driven by
applySettings()rather than by these keys.Reproduction
Both switches are off again. Locking and unlocking the screen in between does not reset them, which is what distinguishes this from a write failure.
Testing
Built and flashed on Xiaomi 17 Pro Max, HyperOS 4 (
OS4.0.8.0.XPBCNXM), Android 17 (SDK 37), arm64-v8a, LSPosed 2.2.1 (API 102) + Zygisk Next 1.5.2. Scopes: 系统界面 / 壁纸 / 息屏显示.The same symptom was reproduced on a second device (Xiaomi tablet, HyperOS 4 / Android 17), which is where this was first noticed; the fix is in shared settings code, not device-specific.
Compatibility
write()gains four writes for fieldsHookSettingsalready carried.falseexactly as today. Users will need to turn the switches on once after updating.Note on
host setting failednoiseWhile investigating I also hit this in
module.log, several times a second while a lock screen was up:It is unrelated to this bug (it comes from
HyperMusicCoverRuntimeBridge.send()re-sending an op that failed to deliver), so I left it out of this PR. Happy to open a separate issue with the logs if that is useful.