Repository navigation
Axion SPSM v3.0.2 (RMX3430)
The screen, read the way this phone reports it
Two things here were previously decided by assumption, and your device settled both. Each fix is pinned by a test.
Download: Axion-SPSM-v3.0.2-RMX3430.zip, also committed at release/ in this tag. Flash in KernelSU/Magisk, then reboot.
Screen detection now uses the node that actually works
/sys/class/leds/lcd-backlight/brightness is 0 while the screen is off and 1..4095 while it is on — verified on this device. That node is now the primary source, and a lit panel is accepted outright whatever else disagrees. A dark panel is weaker evidence (it can be dark under an overlay or the always-on display), so it only reads as "off" when the app is not saying "on" at that moment. Believing a stale "off" is the expensive mistake — it drops the phone into its deep phase while it is in use.
The daemon no longer needs the app at all. It reads the node through a redirection — a syscall, not a spawned process — once a second while awake and once every three seconds while asleep. Measured in the suite: caps engage 500 ms after the panel goes dark with no app, no marker and no signal, and release just as fast on wake. That is the smoothness half of the goal, without depending on any app process staying alive.
The app's instant signal had never worked. SCREEN_ON/SCREEN_OFF are delivered only to receivers registered at runtime, so the manifest-declared receiver was dead code and every transition went unnoticed. It is registered properly now and republishes the current state when it starts. It is an optimisation; the one-second poll is the guarantee.
The dim cap, and the emergency lift, in this panel's units
- The node here is 0..4095, not 0..255, so the old raw
160meant 4% — and would have meant something else on any other phone.brightness_capis now a fraction of the panel's own maximum (8% = 327 here, read frommax_brightness), also accepts4%, and treats anything above 100 as a raw value. A config carried over from a 0..255 phone is used as written instead of silently doing nothing. It still only ever lowers. - The emergency lift fired below a raw 40 and lifted to a raw 128 — calibrated for a 0..255 node, so on this panel the "lift" was barely brighter than the cap it was lifting. It now acts below 10% of the panel and lifts to 40%, whatever the range: 409 → 1638 here.
Tests
tests/run.sh: 33 cases / 138 assertions, passing, plus run-install.sh 21/21. New cases pin the panel as the deciding source (including a lit panel beating a stale "off" in the marker), the daemon reacting to the panel with no app and no signal at all, and the cap in device units.
Note on this repository
The working tree and the published history had drifted apart, so until this release the tags did not contain everything the ship zips did. This merge brings them back together: every file the zip ships is now in the tagged tree, and ./build.sh rebuilds the same APK from the sources in it. The v3.0 and v3.0.1 zips were always built from the complete tree, so nothing flashed from them is affected.