Repository navigation
omamobile-shell: serialize overlapping power-key actions - #508
Conversation
A second short press can arrive while the first is still locking and powering the panel off. Serialize short actions so the later press sees the completed transition. Use the captured release time for debounce, and close the lock descriptor in the action subprocess so background helpers cannot keep it held. The focused host regression fails against main with the wrong screen state and passes with this fix, covering wake, debounce, brightness preservation and lock descriptor inheritance. Co-Authored-By: Codex <noreply@openai.com>
|
Thank you, @Gr-linkk, for chasing this. The double press that left the phone dark is a real annoyance, and serializing the short action is a clean way to fix it. I like the details: the release time is taken before the wait, so the 800 ms debounce still means what it did, and the lock fd is closed in the subshell, so One change, please: bound the wait. Before it merges it also needs a run on a phone at this head. The shell runs on every phone, and this changes the power key on my 7 Pro too. If you can boot it on your Pixel 6, please paste a A small, optional one: I'll set the version at merge, since 0.2.102 is also taken by a few other open shell PRs, and the title will become |
Drop a short press with a diagnostic after five seconds waiting for the previous action. Keep display transitions serialized without queueing later presses indefinitely behind a stuck helper. The regression fails against the previous unbounded wait and passes with the timeout, preserving debounce/display state and recovering after the holder exits. Restrict its PATH to explicit utilities and desktop stubs. Keep the existing draft version; the maintainer will assign it at merge. Co-Authored-By: Codex <noreply@openai.com>
|
Thank you, @Gr-linkk. The bound is exactly what I was after: a press #420 (double tap to wake) merged last night and changes the same script. One question that #420 raises, not a condition: its two new actions, Since your Pixel 6 is busy with the battery work, I'll do the phone run |
# Conflicts: # packages/omamobile-shell/test/all # packages/omamobile-shell/version
|
Merged as omamobile-shell 0.2.112. On my 7 Pro the overlapping presses, the two quick presses, the locked wake, the long press and a double tap just after Power all behaved. Thank you, @Gr-linkk. The open question about #420's |
…ekross#508) * omamobile-shell 0.2.102: serialize power key actions A second short press can arrive while the first is still locking and powering the panel off. Serialize short actions so the later press sees the completed transition. Use the captured release time for debounce, and close the lock descriptor in the action subprocess so background helpers cannot keep it held. The focused host regression fails against main with the wrong screen state and passes with this fix, covering wake, debounce, brightness preservation and lock descriptor inheritance. Co-Authored-By: Codex <noreply@openai.com> * omamobile-shell 0.2.102: bound the power-key lock wait Drop a short press with a diagnostic after five seconds waiting for the previous action. Keep display transitions serialized without queueing later presses indefinitely behind a stuck helper. The regression fails against the previous unbounded wait and passes with the timeout, preserving debounce/display state and recovering after the holder exits. Restrict its PATH to explicit utilities and desktop stubs. Keep the existing draft version; the maintainer will assign it at merge. Co-Authored-By: Codex <noreply@openai.com> --------- Co-authored-by: Gr-linkk <280405187+Gr-linkk@users.noreply.github.com> Co-authored-by: Codex <noreply@openai.com> Co-authored-by: Derek Ross <derekross@gmail.com>
A second short power-key release can arrive while the first action is still locking and turning the panel off. Both actions then see a lit screen, and the second can save zero brightness or leave the phone dark when it should wake.
Serialize short actions with flock so each sees the completed display transition. Capture the release timestamp before waiting so presses within the existing 800 ms debounce interval still count as bounce. Close the lock descriptor in the action subprocess so background helpers cannot retain it.
In response to Derek's review, limit lock acquisition to five seconds. If it fails, drop that press with
omamobile-keys: short-press lock wait failed; dropping presson stderr, without changing debounce or display state. This preserves mutual exclusion instead of starting concurrent display transitions. It does not kill or repair the original stuck helper; fresh presses can act once that action releases the lock.The host regression now uses an eight-second lock helper to verify bounded waiting, diagnostic output, unchanged state and a successful wake after release. Its PATH contains only stubs and explicitly linked test utilities, so future unstubbed desktop commands cannot run on the host.
Offline validation
tests/packages omamobile-shellpasses.tests/all,tools/pr-checkagainst the PR base, and whitespace checks pass.Remaining phone qualification — keep draft
No phone was accessed for this follow-up. A phone-smoke report at the updated candidate and the following physical checks remain required: presses about one second apart during screen-off restore the old brightness; presses about 0.2 seconds apart produce one action; secure-lock press reaches the PIN pad; long press still opens the system menu. Derek offered to perform this on his Pixel 7 Pro if the Pixel 6 is unavailable. The Pixel 6 remains reserved for separate battery work.
Historical Pixel 6 evidence from 2026-11-05 used local shell 0.2.15 and kernel
7.3.0-rc6-oriole-hsi1-late-dev0-g4bd35d34abb9-dirty: guarded software overlap restored brightness/DPMS and the owner observed a physical off/wake pair. That is not validation of this candidate. Secure-lock, physical rapid-overlap and reboot paths remain unqualified here.The existing draft package version is 0.2.102; Derek will assign the final version at merge. Independent of #421 (no battery/glyph changes). #420 changes the same handler; whichever lands second must reconcile it and rerun the overlap test.
Prepared with AI assistance (Codex).