Refresh the charge icon immediately on charger plug/unplug

This commit is contained in:
Luxferre committed 2026-11-10 13:00:41 +02:00
1 parent 6a6222c198
commit eaf08abcd4
9 files changed
+159 -6

No files matched your search

+4
View File
@@ -13,6 +13,10 @@ Release versions follow the `<year-letter><MM><DD>` format (where `2026` is `a`,
Work since `a1108` has focused on reliable 2720 Flip hardware support and a reproducible boot/flash path. Earlier incremental and superseded diagnostic entries are consolidated here.
### Charger plug/unplug battery icon
- **Charge icon stayed unchanged on VBUS transitions**: `85-bananarchy-battery.rules` treated every PM8916 event as a capacity change, but `sxmo_hook_battery.sh` caches `state:percentage` and the charger `online` / battery `status` sysfs attributes can still hold the old value while the uevent is delivered. The cache therefore swallowed exactly the plug/unplug event the user wanted to see. Charger events now run `/usr/bin/bananarchy-battery-charge-event.sh`, which forces an immediate `sxmo_hook_battery.sh force` republish (the forced path removes the icon file so `sxmo_status.sh` cannot skip an unchanged value), then re-reads sysfs after two seconds; `flock` coalesces the uevent burst. A generic `ENV{POWER_SUPPLY_ONLINE}` rule covers firmware revisions that publish VBUS on a separate USB/Mains supply. `scripts/test-battery-charge-event.py` validates the immediate + delayed refresh with a stubbed hook, and `check-rebuild.sh` guards the rules, helper and overlay installation. `nokia-argon` keeps the same capacity-change path.
### Bluetooth scanning
- **Scan found no devices**: the Bluetooth tab ran `bluetoothctl --timeout 15 scan on` with stdout discarded and then queried `bluetoothctl devices` from a second process. BlueZ discovery belongs to the D-Bus client that started it: when the scanning client exits, discovery stops and unpaired devices may be removed before the follow-up query, so a fresh scan legitimately produced an empty list on the 2720 Flip's WCNSS controller. `networks.so` now captures the discovery stream, parses ANSI-coloured `[NEW]`/`[CHG]` device and name/alias lines (`parseBtScanDevices()`), merges them with the persistent `bluetoothctl devices` list, powers the controller on when `bluetoothctl show` reports `Powered: no`, and falls back to a plain `scan on` if `--timeout` is unsupported. `isBtEnabledFast()` no longer depends solely on `/run/bluetoothd.pid`. `scripts/test-bluetooth-scan.py` validates the parser on the host and `check-rebuild.sh` guards the rebuilt `networks.so`. The `nokia-argon` path keeps the same paired-device and OBEX behaviour.