Repository navigation
Conversation
|
@Somnius thank you, the careful parts of this are good: the theme is checked for exactly the two key entries before anything is written, the write is atomic with the mode kept, nothing above 0.125 or 60 ms can be written, and the first version of the file is kept once. It also goes back on Escape like every Settings page must since #643. I replayed the stack onto today's main and its tests pass there. Three things before it can go in. The first is a bug, the other two are decisions I owe you. 1. On a phone without the theme, "Silent, whole phone" works and nothing can turn it back. Since no package ships the theme yet, that's every phone but yours. Please refuse Off (and disable the buttons) where the theme is missing, and add that case to the test. 2. 3. The row shows on every phone, and only yours has the theme. I'd rather not show a page that opens to an error. Two ways: keep this as a draft until the theme and the udev rule ship in a package (the #538 work), or have the catalog hide the row when your Smaller things: the "Lef 2026-11-08" notes in the script's header would read better as a pointer to #538; the Versions: #643 took 0.1.1 today, so #628 becomes 0.1.2 and this one 0.1.3; I'll set them at merge. After #628 is in, rebase with |
d46bd91 to
5dda1cc
Compare
|
@derekross, thank you. All three are done, and the branch is rebased with your command, so it is on top of main now and the version is 0.1.3.
The smaller things: the header points to #538 instead of dated notes, the README says that changing the level restarts feedbackd, and there's a core test that goes to the page and back to the root. Two failure paths of What ran: the haptics and display backend tests locally, and on GitHub both checks pass on this head (5dda1cc): Policy, and Tests (tests/all, every package), which includes the Settings tests. I did not run test/all on my own phone for this head, because the phone is off. |
|
Here's the page running on my Pixel 8 Pro, at Medium. It stays a draft until the theme and udev rule ship with #538, as agreed. @marselnenaj, this one and #630 (Change PIN) and #860 (Battery charge limit) are pages on top of the Settings app you started in #526. It's a great app to build on, so if you see anything that doesn't fit how you meant it to grow, tell me. |
…77759-charger The page runs backends/charge.sh like the Display page does. Setting a value runs systemctl start --no-ask-password omamobile-charge-limit@N.service (a polkit rule allows those five instances for the active local user), which runs libexec/charge-limit as root: start threshold 0 (resume 5 below), then the end threshold, and only then /etc/omamobile/charge-limit is saved. No writable end threshold or a failed write: exit 1, nothing saved. At boot a udev rule on the charger's add pulls in omamobile-charge-limit-apply.service, which applies the saved value on husky only (device tree google,zuma-husky). Units have StartLimitIntervalSec=0. Note: the page is inert on husky today. omamobile-device-husky blacklists max77759_charger, so there is no max77759-charger power supply and the page says the limit is not available until that blacklist is lifted. Version 0.1.3 (to be renumbered at merge; derekross#629 and derekross#630 hold 0.1.3/0.1.4). Tests: test/charge-backend.sh against a scratch root (backend, helper, a stand-in systemctl, polkit/unit/udev contents, staged paths and modes), core tests open BatteryPage and check the runner's charge entry.
|
Thanks, Lef. All three points from last time are answered in the code as you describe: Before it leaves draft:
One thought, not a condition: changing the level stops feedbackd, and on our phones that is also what rings a call. Refusing the change while a call is ringing would avoid a silenced ring. I did not run the tests or the page this round; CI is green on this head. |
…77759-charger The page runs backends/charge.sh like the Display page does. Setting a value runs systemctl start --no-ask-password omamobile-charge-limit@N.service (a polkit rule allows those five instances for the active local user), which runs libexec/charge-limit as root: start threshold 0 (resume 5 below), then the end threshold, and only then /etc/omamobile/charge-limit is saved. No writable end threshold or a failed write: exit 1, nothing saved. At boot a udev rule on the charger's add pulls in omamobile-charge-limit-apply.service, which applies the saved value on husky only (device tree google,zuma-husky). Units have StartLimitIntervalSec=0. Note: the page is inert on husky today. omamobile-device-husky blacklists max77759_charger, so there is no max77759-charger power supply and the page says the limit is not available until that blacklist is lifted. Version 0.1.3 (to be renumbered at merge; derekross#629 and derekross#630 hold 0.1.3/0.1.4). Tests: test/charge-backend.sh against a scratch root (backend, helper, a stand-in systemctl, polkit/unit/udev contents, staged paths and modes), core tests open BatteryPage and check the runner's charge entry.
… keyboard The Display page gets 30 s, 1, 2, 3, 5 min and Never, plus an on/off for staying unlocked while a keyboard is connected. The text says that lock and screen off are the same timer and that Never also keeps the phone awake. 0.1.3 clashes with open derekross#629, derekross#630 and derekross#860; renumber at merge.
The strength of the tick feedbackd plays for key and button presses, in three levels (0.015, 0.035 and 0.07 for 15 ms, nothing above 0.125 or 60 ms is ever written), or Off, which switches feedbackd's profile to silent for the whole phone. It edits the two key entries of the user's custom feedbackd theme (a .bak-haptics copy is kept once), restarts feedbackd by exact name and plays one tick. A phone without that theme gets a plain message on the page. Stacked on the Display page (the ActionRunner and the catalog are from there). The theme and the udev rule that tags the motor are not in a package yet; the page needs them. Signed-off-by: Lef <me@lefteros.com>
…tons without the theme Off is gone: feedbackd's silent profile drops sound as well as vibration, so a keyboard page must not set it, and nothing in the backend touches feedbackd's profile now (the profile helpers and the watch verb are removed). Where the theme is missing the page reads the error and leaves the three level buttons off, and set refuses before anything changes (test). The header points to the keyboard haptics notes in derekross#538 instead of dated notes, the README says that a level change restarts feedbackd, and a core test goes to the page and back.
…ne rule for get and set The three buttons are not drawn until the theme has been read, a theme that does not have exactly the two key entries is refused by get and probe as well as by set, a missing theme is named as missing, and every failure path of set prints one JSON line. The catalog row and the PKGBUILD no longer mention the silent profile, the header says which environment is read, and the test also covers get and probe on a one-entry, a broken and a missing theme and that nothing is created without a theme.
Signed-off-by: Lef <me@lefteros.com>
5dda1cc to
97399d1
Compare

@derekross, @marselnenaj, this is the second page for the Settings app, stacked on the Display page in #628: the first commit here is that one, so only the second commit is new. I'll rebase once #628 is in.
It sets the strength of the tick feedbackd plays for key and button presses: Low, Medium or High (0.015, 0.035 and 0.07 for 15 ms), or Off, which switches feedbackd's profile to silent for the whole phone. It edits the two key entries of the user's custom feedbackd theme and nothing else in it. Nothing above 0.125 or longer than 60 ms is ever written, the first version of the theme is kept once as custom.json.bak-haptics, and a theme that doesn't have exactly those two entries is refused before anything changes. The page opens with
org.omamobile.Settings.Open("haptics").The page only works where that theme exists, and the theme and the udev rule that tags the motor for feedbackd aren't in any package yet (I wrote about how I set them up on #538). On a phone without the theme the page says so and changes nothing. If you'd rather this wait until the theme ships in the device package, I can leave it as a draft.
Review fixes already in: the script runs python isolated, nothing in the environment changes what runs (the test uses a copy of the script), the theme is replaced atomically with its mode kept and any symlink followed, and a failed write doesn't leave the profile flipped. A level after Off puts the profile back to full, whatever it was before.
Tested on a Pixel 8 Pro: test/all passes on the phone with the new backend test (levels, Off and back, the cap, a theme with a missing entry, mode kept, no theme). I ran the backend live from a session: it read the current level, set another, and I put it back. I didn't check by hand that the tick feels different at each level on this build. Not tested on any other phone, and the Off behaviour for calls and alarms is still the open question from #538.