Repository navigation
Conversation
- Settings > Screen > Lock Screen (config key "lock_screen", default on), using the same GetInt/SetInt/Save pattern as Bluetooth "Named Only". - Off: the idle timeout still blacks the panel and turns the backlight off, but no lock sound plays and the first key press wakes straight back to the launcher. The waking key is consumed, so it does not act on the page. On keeps today's TAB then ENTER unlock. - ui_screensaver.cpp reads the setting on every lock, so a change takes effect at the next lock without a restart. - Tests: the Screen menu order test lists the new entry, the lock-screen contract pins the wiring, and the LVGL harness answers config reads per key and covers the off path (no sound, any key wakes, consumed) and switching back on. Closes CardputerZero#245 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0135vUaG2FpgpGRJfB9LEPvZ
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.
Summary
Adds Settings → Screen → Lock Screen (On / Off), as discussed in #245.
Implements #245 (now closed). This is the PR requested in that issue.
Change
ui/settings/settings_page.cpp: a toggle entryLock Screenunder Screen. It follows the Bluetooth "Named Only" pattern:GetInt/SetInt/Saveon a new config keylock_screen, default1. If the save fails, the previous value is written back.ui/ui_screensaver.cpp:enter_lockscreen()readslock_screenon every lock, so a change applies at the next lock without a restart. When it is off,lock.mp3is skipped, andui_screensaver_filter_key()callsstop_screensaver(true, true)on the first fresh press beforeLockscreenStateModelsees the key.Tests
test_settings_menu_order.py: the Screen entries are nowBrightness,DarkTime,Lock Screen.test_lockscreen_contract.py: pins the wiring (the read on lock, the skipped sound, the bypass placed befores_lock.handle_key).low_battery_ui/test_low_battery_ui.cpp:lock_screen→"1"by default). Before, it returned the timeout for every key, solock_screenread as"0";test_lock_screen_off_wakes_on_any_key: no sound on lock, the backlight is off, any key is consumed and wakes the screen, and switching back on restores the TAB → ENTER lock.Results:
sh projects/APPLaunch/tests/run_tests.sh: passes, excepttest_settings_software_page_contract.py. That test fails on currentmasteras well (it expectsCONFIG_APPLAUNCH_LINUX_X86_CROSS_CP0in the SConstruct), so I skipped it locally.bash projects/APPLaunch/tests/low_battery_ui/run_tests.sh: passes for both the device and SDL keyboard backends. On unmodifiedmasterthe same harness passes as well.settings_http_worker.cppneedingcurl/curl.h, which my build image did not have; it is unrelated to this change.Note
I prepared this with AI assistance (Claude) and tested it on my own device. Happy to change the wording, for example "Wake with any key", or to move the entry if you prefer.