Fix 2720 closed-flip call wakeups/preservation, live timezone sync, and Power menu
- Default CPU_RPM_SLEEP=0, CPU_L2_SLEEP=0, and MODEM_DRX_MODE=0 across bananarchy-power-policy.conf, bananarchy-power-policy.sh, bananarchy-display-power-sync, and kernel patch 0010 so closed-flip incoming calls wake APSS promptly via smd-edge without AT port contention. - Serialize sxmo_modem.sh incoming/finished call checks, expire stale /tmp/sxmo_hangup_requested flags, re-verify live ModemManager call state before ringing/raising callscreen, guard idle/flip-open HANGUP_CLOSE paths in locker.so, callscreen.so, bananarchy-idle-lock.sh, and bananarchy-lid, preserve calls on flip-open (UNGRAB/RAISE), and add closed-flip cover call controls (bananarchy-cover-idle, bananarchy-cover-event.sh, bananarchy-volume-keys). - Propagate live network/manual timezone updates across statusbar, locker.so, bananarchy-cover-idle, bananarchy-dsds, callscreen.so, and bananarchy-run-aligned without reboot (scripts/test-time-timezone-sync.py), remove non-functional Logout from the Power menu, ignore post-call sxmo_calls markers, add scripts/build-dwm-plugins.sh, and update a1114 (carbonara) hashes and docs.
This commit is contained in:
1 parent
786480a08f
commit
8b466ef8ae
110 files changed
+2681
-238
No files matched your search
@@ -23,10 +23,11 @@ Keep this file short. Full details live in `README.md`, `MANUAL.md`, `SDK.md`, `
|
|||||||
- Run `./scripts/check-rebuild.sh`, relevant `scripts/test-*.py` tests, `./scripts/sync-prebuilt-overlay.sh --check`,
|
- Run `./scripts/check-rebuild.sh`, relevant `scripts/test-*.py` tests, `./scripts/sync-prebuilt-overlay.sh --check`,
|
||||||
and `git diff --check` before claiming a source, artifact, docs, or release change is complete.
|
and `git diff --check` before claiming a source, artifact, docs, or release change is complete.
|
||||||
- Cross-compile inside rootless Docker. Main builders are `scripts/build-sxmo-x11.sh`, `build-dmenu.sh`,
|
- Cross-compile inside rootless Docker. Main builders are `scripts/build-sxmo-x11.sh`, `build-dmenu.sh`,
|
||||||
`build-bananarchy-daemons.sh`, `build-kernel-audio.sh`, `build-lk2nd-beatles.sh`, `build-games.sh`,
|
`build-dwm-plugins.sh`, `build-bananarchy-daemons.sh`, `build-kernel-audio.sh`, `build-lk2nd-beatles.sh`, `build-games.sh`,
|
||||||
`build-fcitx5-t9.sh`, and `build-xlibre.sh`.
|
`build-fcitx5-t9.sh`, and `build-xlibre.sh`.
|
||||||
- Use `scripts/build-dmenu.sh` for dmenu-only changes. Do not run a full `build-sxmo-x11.sh` casually: the shipped `dwm`
|
- Use `scripts/build-dmenu.sh` for dmenu-only changes and `scripts/build-dwm-plugins.sh` for NeoUI/plugin rebuilds. Do
|
||||||
binary contains cover IPC strings absent from source, so a full rebuild drifts `dwm`; restore or reconcile it.
|
not run a full `build-sxmo-x11.sh` casually: the shipped `dwm` binary contains cover IPC strings absent from source,
|
||||||
|
so a full rebuild drifts `dwm`; restore or reconcile it.
|
||||||
- Rootfs/image tools are `scripts/bootstrap-rootfs.sh`, `scripts/apply-bananarchy-overlay.sh`,
|
- Rootfs/image tools are `scripts/bootstrap-rootfs.sh`, `scripts/apply-bananarchy-overlay.sh`,
|
||||||
`scripts/compile-gsettings-schemas.sh`, `rebuild-image.sh`, `scripts/sync-beatles-bootfs.py --check`,
|
`scripts/compile-gsettings-schemas.sh`, `rebuild-image.sh`, `scripts/sync-beatles-bootfs.py --check`,
|
||||||
`prepare-release.sh`, and `flash-edl.sh`.
|
`prepare-release.sh`, and `flash-edl.sh`.
|
||||||
@@ -102,13 +103,16 @@ Keep this file short. Full details live in `README.md`, `MANUAL.md`, `SDK.md`, `
|
|||||||
- The shipping cover backend is `backend = kernel`: keep `bananarchy-cover-dpms.sh reinit`, the gpio13 mux claim,
|
- The shipping cover backend is `backend = kernel`: keep `bananarchy-cover-dpms.sh reinit`, the gpio13 mux claim,
|
||||||
the centered 240x240 X11/`/dev/fb0` cover frame, the 1 s repaint against Xorg, `kernel_backlight_invert = 0`,
|
the centered 240x240 X11/`/dev/fb0` cover frame, the 1 s repaint against Xorg, `kernel_backlight_invert = 0`,
|
||||||
`kernel_internal_sleep = 0`, `kernel_backlight_level = 14`, shared **Config -> Screen blank** timeout reload,
|
`kernel_internal_sleep = 0`, `kernel_backlight_level = 14`, shared **Config -> Screen blank** timeout reload,
|
||||||
`scripts/test-cover-kernel.py`, and the `spidev`/`fb`/`none` rollback backends.
|
closed-flip `CALL` cover UI (`cover_hold_awake`, `BUTTON VOLUP`/`VOLDOWN` -> `mute-ring`, `BUTTON POWER` -> `hangup-call`,
|
||||||
|
delayed `CALL muted` guard), clean `SIGTERM` cover blanking, live timezone refresh (`ba_refresh_tz` / `REFRESH`),
|
||||||
|
`scripts/test-cover-kernel.py`, `scripts/test-time-timezone-sync.py`, and the `spidev`/`fb`/`none` rollback backends.
|
||||||
The daemon must restore the internal panel on `LID OPEN` even after a stale high gpio13 survives a restart.
|
The daemon must restore the internal panel on `LID OPEN` even after a stale high gpio13 survives a restart.
|
||||||
- Keep the 2720 Flip lid handling event-driven and instant: sticky hall state, immediate hall re-read on `EV_SW`
|
- Keep the 2720 Flip lid handling event-driven and instant: sticky hall state, immediate hall re-read on `EV_SW`
|
||||||
edges, 20 ms debounce, `SW_LID` mirroring (`sync_sw_lid`) so `dwm` tracks the hall sensor, and synchronous
|
edges, 20 ms debounce, `SW_LID` mirroring (`sync_sw_lid`) so `dwm` tracks the hall sensor, and synchronous
|
||||||
lid-state/lock/backlight/DPMS writes in `bananarchy-lid.c`. Closing locks
|
lid-state/lock/backlight/DPMS writes in `bananarchy-lid.c`. Closing locks
|
||||||
the desktop; opening must keep the lock flag and wake to the passcode lockscreen, never auto-unlock. Every
|
the desktop; opening must keep the lock flag and wake to the passcode lockscreen (never auto-unlock) while sending
|
||||||
main-panel wake path must call `bananarchy-lid-gate.sh`; a closed flip may only light the cover.
|
`RAISE` to `callscreen` and keeping `sxmo_hook_lock.sh` / `locker.so` from hanging up incoming/active calls (`UNGRAB`).
|
||||||
|
Every main-panel wake path must call `bananarchy-lid-gate.sh`; a closed flip may only light the cover.
|
||||||
`sxmo_state.sh set unlock` is gated too because `dwm` calls it directly. `apply-bananarchy-overlay.sh` writes
|
`sxmo_state.sh set unlock` is gated too because `dwm` calls it directly. `apply-bananarchy-overlay.sh` writes
|
||||||
`/usr/share/bananarchy/lid-profile` per target (`slider` on `nokia-argon`, `flip` on `nokia-beatles`, `none`
|
`/usr/share/bananarchy/lid-profile` per target (`slider` on `nokia-argon`, `flip` on `nokia-beatles`, `none`
|
||||||
elsewhere) and disables `bananarchy-{lid,cover-display,volume-keys}`, cover udev/config, and mux modprobes on
|
elsewhere) and disables `bananarchy-{lid,cover-display,volume-keys}`, cover udev/config, and mux modprobes on
|
||||||
@@ -121,8 +125,8 @@ Keep this file short. Full details live in `README.md`, `MANUAL.md`, `SDK.md`, `
|
|||||||
recovery-mode 2720 boots need Volume Up. Keep the signed per-device Firehose programmers and do not mix them.
|
recovery-mode 2720 boots need Volume Up. Keep the signed per-device Firehose programmers and do not mix them.
|
||||||
- Keep first-boot access intact: `keys/phone_id_ed25519.pub` for `user`/`root`, PAM/sshd configs, USB-only SSH fallback,
|
- Keep first-boot access intact: `keys/phone_id_ed25519.pub` for `user`/`root`, PAM/sshd configs, USB-only SSH fallback,
|
||||||
keypad udev/Xorg rules, BusyBox applet lists, and `scripts/set-bananarchy-hostname.sh`.
|
keypad udev/Xorg rules, BusyBox applet lists, and `scripts/set-bananarchy-hostname.sh`.
|
||||||
- The Power menu label is **Reboot to loader** and still calls `sxmo_power.sh bootloader`. Keep the compact label in
|
- The Power menu label is **Reboot to loader** and still calls `sxmo_power.sh bootloader`; `Logout` is removed from
|
||||||
`dmenu.c`, `dmenu.so`, `sxmo_appmenu.sh`, and the context-menu hook.
|
`dmenu.c`, `dmenu.so`, `sxmo_appmenu.sh`, and `sxmo_hook_contextmenu.sh`. Keep the compact Power menu layout synchronized.
|
||||||
- Bluetooth HOGP config and plugin load are verified, but full hardware sign-off still needs a wake-up paired keyboard
|
- Bluetooth HOGP config and plugin load are verified, but full hardware sign-off still needs a wake-up paired keyboard
|
||||||
and **Connect Device** to confirm real HID key events.
|
and **Connect Device** to confirm real HID key events.
|
||||||
|
|
||||||
|
|||||||
@@ -1287,17 +1287,20 @@ display controller active continuously without `CONFIG_SUSPEND`:
|
|||||||
`ci_ulpi_resume()`'s `ULPI_SYNC_STATE` viewport poll when
|
`ci_ulpi_resume()`'s `ULPI_SYNC_STATE` viewport poll when
|
||||||
`CI_HDRC_OVERRIDE_PHY_CONTROL` is set so cable hotplug resumes cleanly before
|
`CI_HDRC_OVERRIDE_PHY_CONTROL` is set so cable hotplug resumes cleanly before
|
||||||
`CI_HDRC_CONTROLLER_RESET_EVENT` powers the ULPI PHY.
|
`CI_HDRC_CONTROLLER_RESET_EVENT` powers the ULPI PHY.
|
||||||
4. **Default dual-port `MODEM_DRX_MODE=6` and dark-screen `dsds-daemon` sleep**:
|
4. **Dual-port `AT$QCDRX` infrastructure and dark-screen `dsds-daemon` sleep
|
||||||
`bananarchy-power-policy.conf` defaults to `MODEM_DRX_MODE=6` while keeping
|
(`MODEM_DRX_MODE=0` safe shipping default)**:
|
||||||
`DSDS_SECONDARY_MODE=active` so both SIMs stay reachable;
|
`bananarchy-power-policy.conf` defaults to `MODEM_DRX_MODE=0` while keeping
|
||||||
`msm-modem-uim-selection` adds `at all` multi-port support and `screen_is_idle()`
|
`DSDS_SECONDARY_MODE=active` so both SIMs stay reachable via MPSS's native
|
||||||
in `dsds-daemon` (`poll_timeout = None` whenever locked, cover-lit, or
|
DSDS paging scheduler (`Slot 2` UMTS + `Slot 1` GSM) without competing with
|
||||||
backlight off); and `bananarchy-power-policy.sh` serializes AT port access
|
`ModemManager` (which holds both `/dev/wwan0at0` and `/dev/wwan0at1` open);
|
||||||
with `flock`, waits past `ModemManager`'s startup port probe at boot, and
|
`6-9` remain opt-in. `msm-modem-uim-selection` adds `at all` multi-port
|
||||||
re-applies `AT$QCDRX=6` across all `/dev/wwan0at*` ports on `modem-ready`
|
support and `screen_is_idle()` in `dsds-daemon` (`poll_timeout = None`
|
||||||
|
whenever locked, cover-lit, or backlight off); and
|
||||||
|
`bananarchy-power-policy.sh` serializes AT port access with `flock` and
|
||||||
|
applies `AT$QCDRX` across `/dev/wwan0at*` ports on `modem-ready`
|
||||||
(`sxmo_hook_modem.sh` `registered`/`connected` and post-PIN/switch
|
(`sxmo_hook_modem.sh` `registered`/`connected` and post-PIN/switch
|
||||||
registration) with per-port devtmpfs inode caching in
|
registration) when `MODEM_DRX_MODE != 0`, with per-port devtmpfs inode
|
||||||
`/run/bananarchy-power-policy/drx.<port>`.
|
caching in `/run/bananarchy-power-policy/drx.<port>`.
|
||||||
5. **MIPI DCS `DISPOFF` + `SLPIN` on `panel-mipi-dbi` DPMS off**:
|
5. **MIPI DCS `DISPOFF` + `SLPIN` on `panel-mipi-dbi` DPMS off**:
|
||||||
`panel_mipi_dbi_disable()` sends `0x28` (`msleep(20)`) and `0x10`
|
`panel_mipi_dbi_disable()` sends `0x28` (`msleep(20)`) and `0x10`
|
||||||
(`msleep(50)`) under `drm_dev_enter()` after `backlight_disable()`, halting
|
(`msleep(50)`) under `drm_dev_enter()` after `backlight_disable()`, halting
|
||||||
@@ -1438,12 +1441,12 @@ vMPM timer programming or last-man L2 SAW2 shutdown.
|
|||||||
fixes SAW2 v3.0 `0x3B` / `PC_MODE` / `SLP_CMD_MODE` indexing and XPU-locked
|
fixes SAW2 v3.0 `0x3B` / `PC_MODE` / `SLP_CMD_MODE` indexing and XPU-locked
|
||||||
L2 readback guards, guards `qcom_mpm_handler()` against `NULL` `irq_desc`
|
L2 readback guards, guards `qcom_mpm_handler()` against `NULL` `irq_desc`
|
||||||
mappings for pre-enabled MPM pins (`49`, `58`, `62`), keeps per-CPU SPM in
|
mappings for pre-enabled MPM pins (`49`, `58`, `62`), keeps per-CPU SPM in
|
||||||
`PM_SLEEP_MODE_SPC` even when `l2_sleep=0`, and teaches
|
`PM_SLEEP_MODE_SPC` even when `l2_sleep=0`, and supports opt-in
|
||||||
`cpuidle-qcom-spm` to enter APSS RPM/vMPM sleep (`rpm_sleep=1`,
|
`cpuidle-qcom-spm` APSS RPM/vMPM sleep (`rpm_sleep`, `rpm_min_residency_us=3000`)
|
||||||
`rpm_min_residency_us=3000`) and L2 SAW2 collapse (`l2_sleep=1`,
|
and L2 SAW2 collapse (`l2_sleep`, `QCOM_SCM_CPU_PWR_DOWN_L2_OFF`) when the last
|
||||||
`QCOM_SCM_CPU_PWR_DOWN_L2_OFF`) when the last online CPU enters idle, gated on
|
online CPU enters idle, gated on
|
||||||
`/sys/module/cpuidle_qcom_spm/parameters/screen_off` (toggled by
|
`/sys/module/cpuidle_qcom_spm/parameters/screen_off` (toggled by
|
||||||
`bananarchy-display-power-sync` and `bananarchy-power-policy.sh`) plus
|
`bananarchy-display-power-sync` only when `rpm_sleep=Y`) plus
|
||||||
`qcom_msm8909_gdsc_is_active()` in `gcc-msm8909.c` so RPM/L2 collapse never
|
`qcom_msm8909_gdsc_is_active()` in `gcc-msm8909.c` so RPM/L2 collapse never
|
||||||
fires while `oxili_gdsc`/`mdss_gdsc`/`venus_gdsc`/`vfe_gdsc` or the panel
|
fires while `oxili_gdsc`/`mdss_gdsc`/`venus_gdsc`/`vfe_gdsc` or the panel
|
||||||
are active, uses `ktime_sub(tick_nohz_get_next_hrtimer(), ktime_get())` to
|
are active, uses `ktime_sub(tick_nohz_get_next_hrtimer(), ktime_get())` to
|
||||||
@@ -1478,13 +1481,28 @@ vMPM timer programming or last-man L2 SAW2 shutdown.
|
|||||||
and `50-device-*.conf` fragments so `blsp1_uart1_apps_clk` no longer holds
|
and `50-device-*.conf` fragments so `blsp1_uart1_apps_clk` no longer holds
|
||||||
`gpll0` (`enable_count = 0`).
|
`gpll0` (`enable_count = 0`).
|
||||||
4. **Runtime policy & telemetry additions (`bananarchy-power-policy.conf` /
|
4. **Runtime policy & telemetry additions (`bananarchy-power-policy.conf` /
|
||||||
`.sh`)**: added `CPU_RPM_SLEEP=1`, `CPU_L2_SLEEP=1`,
|
`.sh`)**: added `CPU_RPM_SLEEP=0`, `CPU_L2_SLEEP=0`, and `MODEM_DRX_MODE=0`
|
||||||
`WIFI_SCREEN_OFF_IPV6_MUTE=1` (mutes unsolicited IPv6 RAs on `wlan0` during
|
safe shipping defaults alongside `WIFI_SCREEN_OFF_IPV6_MUTE=1` (mutes
|
||||||
screen-off whenever `wlan0` already holds an IPv4 address, restored on wake),
|
unsolicited IPv6 RAs on `wlan0` during screen-off whenever `wlan0` already
|
||||||
and opt-in `WIFI_STANDBY_RAT=keep|gsm` (parks QMI NAS mode preference to GSM
|
holds an IPv4 address, restored on wake), opt-in `WIFI_STANDBY_RAT=keep|gsm`
|
||||||
after 30 s dark while `wlan0` is `up`, restored on wake), plus `status`
|
(parks QMI NAS mode preference to GSM after 30 s dark while `wlan0` is `up`,
|
||||||
readouts for `cpuidle_qcom_spm`, `/sys/kernel/debug/qcom_stats/*`, and
|
restored on wake), plus `status` readouts for `cpuidle_qcom_spm`,
|
||||||
`/sys/kernel/debug/qcom_rpm_master_stats/*`.
|
`/sys/kernel/debug/qcom_stats/*`, and `/sys/kernel/debug/qcom_rpm_master_stats/*`.
|
||||||
|
Live telemetry on a dual-SIM `nokia-beatles` (`2720 Flip`) showed that
|
||||||
|
with `# CONFIG_SUSPEND is not set`, `QCOM_SCM_CPU_PWR_DOWN_L2_OFF` collapsed
|
||||||
|
L2, SCU, and the APSS GIC while `apss_master_stats` stayed at `Count: 0`;
|
||||||
|
because `vMPM` does not route internal SoC GIC SPIs (`GIC-0 57 smd-edge`,
|
||||||
|
`GIC-0 166 ci_hdrc_msm`, `GIC-0 178 wcn36xx_rx`), `L2_OFF` black-holed
|
||||||
|
closed-flip incoming call interrupts until the flip opened (`gpio36` -> `mpm`)
|
||||||
|
and delayed USB/Wi-Fi traffic until minute-aligned timers. Meanwhile,
|
||||||
|
`ModemManager` holds both `/dev/wwan0at0` and `/dev/wwan0at1` open, so
|
||||||
|
`AT$QCDRX` writes from `bananarchy-power-policy.sh` contended with
|
||||||
|
`ModemManager`'s AT parser. Keeping `CPU_RPM_SLEEP=0`, `CPU_L2_SLEEP=0`, and
|
||||||
|
`MODEM_DRX_MODE=0` default preserves `< 0.2 ms` per-core `SPC` (`L2_ON`)
|
||||||
|
wakeup on every GIC SPI and MPSS native DSDS paging while keeping
|
||||||
|
`wcn36xx` `screen_off_offload`, IPv6 RA mute, Adreno `0 KB/s` BIMC/GDSC
|
||||||
|
idle, `wcd-digital` runtime autosuspend, unclaimed PM8909 LDO cleanup, and
|
||||||
|
`ttyMSM0` disable active.
|
||||||
5. **Compiled C11 autostart daemons (`bananarchy-dsds`, monitors, session)**:
|
5. **Compiled C11 autostart daemons (`bananarchy-dsds`, monitors, session)**:
|
||||||
replaced `python3 - dsds-daemon`, `sxmo_modemmonitor.sh`,
|
replaced `python3 - dsds-daemon`, `sxmo_modemmonitor.sh`,
|
||||||
`sxmo_soundmonitor.sh` (`evtest`), `sxmo_notifs.sh monitor` (`inotifywait`),
|
`sxmo_soundmonitor.sh` (`evtest`), `sxmo_notifs.sh monitor` (`inotifywait`),
|
||||||
|
|||||||
+5
-4
@@ -20,16 +20,16 @@ Upcoming release build (`a1114` / `carbonara` via `scripts/version.sh`) targetin
|
|||||||
- **MSM8909 ICC `-ENXIO`, CPU OPP `schedutil` latency, USB PHY `l13`, and Q6ASM/`VoiceMMode1` fixes (`0011`)**: marked XPU-protected MSM8909 PCNOC nodes (`mas_spdm`, `mas_dehr`, `slv_spdm`, `slv_dehr_cfg`, `slv_qdss_cfg`, `slv_imem_cfg`, `slv_bimc_cfg`) `.qos.ap_owned = true` with `NOC_QOS_MODE_INVALID` in `drivers/interconnect/qcom/msm8909.c` so `qcom_icc_set()` commits bus clocks instead of aborting on `-6`; moved `clock-latency-ns = <100000>` (`<0x186a0>` on `nokia-beatles`) from parent `cpu-opp-table` into all eight `opp-*` child nodes across `qcom-msm8909.dtsi` and all six standalone `devices/` DTS files so `cpuinfo_transition_latency` reports `100 us` instead of `CPUFREQ_ETERNAL` (`6.44 s` `schedutil` rate limit) and converted `qcom-cpufreq-nvmem.c`'s `Failed to set OPP config` log to `dev_err_probe()`; guarded fixed-voltage `pm8909_l13` (`3.075 V`) in `drivers/phy/qualcomm/phy-qcom-usb-hs.c` with `regulator_is_supported_voltage(uphy->v3p3, 3300000, 3300000) > 0`; handled asynchronous `ASM_DATA_CMD_WRITE_V2`/`READ_V2` (`0x10dab`/`0x10dac`) responses in `q6asm.c` without clobbering `ac->result` while routing `ASM_DATA_CMD_EOS` with `ASM_DATA_CMD_REMOVE_TRAILING_SILENCE`; and disabled unrouted `dai-link-multimedia3` in DTS while updating both `/usr/share/q6voiced/q6voiced.conf` and `/etc/conf.d/q6voiced` to `q6voice_device=3` (`hw:0,3`) to match the shifted `VoiceMMode1` PCM index.
|
- **MSM8909 ICC `-ENXIO`, CPU OPP `schedutil` latency, USB PHY `l13`, and Q6ASM/`VoiceMMode1` fixes (`0011`)**: marked XPU-protected MSM8909 PCNOC nodes (`mas_spdm`, `mas_dehr`, `slv_spdm`, `slv_dehr_cfg`, `slv_qdss_cfg`, `slv_imem_cfg`, `slv_bimc_cfg`) `.qos.ap_owned = true` with `NOC_QOS_MODE_INVALID` in `drivers/interconnect/qcom/msm8909.c` so `qcom_icc_set()` commits bus clocks instead of aborting on `-6`; moved `clock-latency-ns = <100000>` (`<0x186a0>` on `nokia-beatles`) from parent `cpu-opp-table` into all eight `opp-*` child nodes across `qcom-msm8909.dtsi` and all six standalone `devices/` DTS files so `cpuinfo_transition_latency` reports `100 us` instead of `CPUFREQ_ETERNAL` (`6.44 s` `schedutil` rate limit) and converted `qcom-cpufreq-nvmem.c`'s `Failed to set OPP config` log to `dev_err_probe()`; guarded fixed-voltage `pm8909_l13` (`3.075 V`) in `drivers/phy/qualcomm/phy-qcom-usb-hs.c` with `regulator_is_supported_voltage(uphy->v3p3, 3300000, 3300000) > 0`; handled asynchronous `ASM_DATA_CMD_WRITE_V2`/`READ_V2` (`0x10dab`/`0x10dac`) responses in `q6asm.c` without clobbering `ac->result` while routing `ASM_DATA_CMD_EOS` with `ASM_DATA_CMD_REMOVE_TRAILING_SILENCE`; and disabled unrouted `dai-link-multimedia3` in DTS while updating both `/usr/share/q6voiced/q6voiced.conf` and `/etc/conf.d/q6voiced` to `q6voice_device=3` (`hw:0,3`) to match the shifted `VoiceMMode1` PCM index.
|
||||||
- **BusyBox applet symlinks, ZRAM swap activation, NetworkManager dispatcher guard, and session cleanup**: added `scripts/busybox-usr-bin-applets.txt` (`53` applets, excluding `pkill`) and `scripts/busybox-usr-sbin-applets.txt` (`23` applets) plus `/bin` additions (`cttyhack`, `kbd_mode`, `vmstat`) in `scripts/busybox-applets.txt` and `scripts/apply-bananarchy-overlay.sh`, updated `/usr/bin/zramstart` to read `MemTotal` from `/proc/meminfo` (with `free -m` fallback) so `/dev/zram0` swap (`580 MB`) activates reliably on boot, guarded `PrimaryConnection`/`Ip{4,6}Config == "/"` in `/usr/lib/NetworkManager/dispatcher.d/50-dns-filter.sh`, synchronized `schedutil/rate_limit_us = 40000` across both non-flip and flip branches of `bananarchy-display-power-sync`, removed remaining `pkill`/`pgrep -f` uses across `bananarchy-x11-session.sh`, `sxmo_hook_start.sh`, and `sxmo_modemaudio.sh`, cleaned `/tmp/at_resp_*.txt` via `trap` in `msm-modem-uim-selection`, and verified zero occurrences across all six error signatures live after reboot on `nokia-argon`.
|
- **BusyBox applet symlinks, ZRAM swap activation, NetworkManager dispatcher guard, and session cleanup**: added `scripts/busybox-usr-bin-applets.txt` (`53` applets, excluding `pkill`) and `scripts/busybox-usr-sbin-applets.txt` (`23` applets) plus `/bin` additions (`cttyhack`, `kbd_mode`, `vmstat`) in `scripts/busybox-applets.txt` and `scripts/apply-bananarchy-overlay.sh`, updated `/usr/bin/zramstart` to read `MemTotal` from `/proc/meminfo` (with `free -m` fallback) so `/dev/zram0` swap (`580 MB`) activates reliably on boot, guarded `PrimaryConnection`/`Ip{4,6}Config == "/"` in `/usr/lib/NetworkManager/dispatcher.d/50-dns-filter.sh`, synchronized `schedutil/rate_limit_us = 40000` across both non-flip and flip branches of `bananarchy-display-power-sync`, removed remaining `pkill`/`pgrep -f` uses across `bananarchy-x11-session.sh`, `sxmo_hook_start.sh`, and `sxmo_modemaudio.sh`, cleaned `/tmp/at_resp_*.txt` via `trap` in `msm-modem-uim-selection`, and verified zero occurrences across all six error signatures live after reboot on `nokia-argon`.
|
||||||
- **Pass 1 + Pass 2 RPM sleep (`vMPM` + L2 SAW2), BIMC PLL / WCD-digital / LDO cleanup, Adreno 304 active-display guard, and UART disable (`0010`)**:
|
- **Pass 1 + Pass 2 RPM sleep (`vMPM` + L2 SAW2), BIMC PLL / WCD-digital / LDO cleanup, Adreno 304 active-display guard, and UART disable (`0010`)**:
|
||||||
- **Last-man APSS RPM (`vMPM`) and L2 SAW2 standby collapse (`0010`)**: enabled `CONFIG_QCOM_RPM_MASTER_STATS=y`, wired `qcom,mpm` (`sram@60000` sub-slices `0x150`/`0x1d0`/`0x1150`/`0x2150`, TLMM `wakeup-parent`, `qcom,msm8916-rpm-stats`, `rpm-master-stats`) and L2 SAW2 (`power-manager@b012000`, `qcom,msm8909-saw2-v3.0-scu` linked via `l2-cache` `qcom,saw`) across kernel and all six device DTS files; fixed SAW2 v3.0 `0x3B` / `PC_MODE` / `SLP_CMD_MODE` indexing and XPU-locked L2 readback guards; guarded `qcom_mpm_handler()` against `NULL` `irq_desc` mappings on pre-enabled MPM pins (`49`, `58`, `62`); gated `cpuidle-qcom-spm` last-man APSS RPM (`rpm_sleep=1`, `rpm_min_residency_us=3000`) and L2 collapse (`l2_sleep=1`, `QCOM_SCM_CPU_PWR_DOWN_L2_OFF`) on both `qcom_msm8909_gdsc_is_active()` (`oxili_gdsc`/`mdss_gdsc`/`venus_gdsc`/`vfe_gdsc`) and `cpuidle_qcom_spm/parameters/screen_off` (toggled by `bananarchy-display-power-sync` and `bananarchy-power-policy.sh`) so active displays/GPUs never suffer L2/shared-clock collapse; and switched the next-timer check to `ktime_sub(tick_nohz_get_next_hrtimer(), ktime_get())` (`tick_nohz` warning fixed) with `# CONFIG_SUSPEND is not set` and module `vermagic` unchanged.
|
- **Opt-in APSS RPM (`vMPM`) and L2 SAW2 standby collapse (`0010`), BIMC PLL / WCD-digital / LDO cleanup, Adreno 304 active-display guard, and UART disable (`0010`)**: enabled `CONFIG_QCOM_RPM_MASTER_STATS=y`, wired `qcom,mpm` (`sram@60000` sub-slices `0x150`/`0x1d0`/`0x1150`/`0x2150`, TLMM `wakeup-parent`, `qcom,msm8916-rpm-stats`, `rpm-master-stats`) and L2 SAW2 (`power-manager@b012000`, `qcom,msm8909-saw2-v3.0-scu` linked via `l2-cache` `qcom,saw`) across kernel and all six device DTS files; fixed SAW2 v3.0 `0x3B` / `PC_MODE` / `SLP_CMD_MODE` indexing and XPU-locked L2 readback guards; guarded `qcom_mpm_handler()` against `NULL` `irq_desc` mappings on pre-enabled MPM pins (`49`, `58`, `62`); gated `cpuidle-qcom-spm` opt-in APSS RPM (`rpm_sleep=0`, `rpm_min_residency_us=3000`) and L2 collapse (`l2_sleep=0`, `QCOM_SCM_CPU_PWR_DOWN_L2_OFF`) on both `qcom_msm8909_gdsc_is_active()` (`oxili_gdsc`/`mdss_gdsc`/`venus_gdsc`/`vfe_gdsc`) and `cpuidle_qcom_spm/parameters/screen_off` (toggled by `bananarchy-display-power-sync` only when `rpm_sleep=Y`) while keeping per-core SPC (`L2_ON`) active by default so `APSS GIC` never drops internal `smd-edge` modem call wakeups during closed-flip idle; and switched the next-timer check to `ktime_sub(tick_nohz_get_next_hrtimer(), ktime_get())` (`tick_nohz` warning fixed) with `# CONFIG_SUSPEND is not set` and module `vermagic` unchanged.
|
||||||
- **Adreno 304 `gfx-mem` interconnect scaling, `qcom_iommu` non-genpd resume/TLB fix, GDSC recovery cycle, WCD-digital runtime PM, and PM8909 LDO seeding (`0010`)**: wired `bimc`/`pcnoc`/`snoc` nodes and Adreno 304 `gfx-mem` interconnect (`MAS_OXILI -> SLV_EBI`) in `qcom-msm8909.dtsi` and all six device DTS files, moved `a3xx_gpu_init()`'s static `icc_set_bw()` into `msm_gpu_pm_resume()` / `msm_gpu_pm_suspend()` (`Bps_to_icc(gpu->fast_rate) * 8` while active, `0` when runtime-suspended so BIMC still drops to `19.2 MHz` XO when idle without starving Adreno 304 during `powersave`/DPMS transitions), guarded blocking `qcom_iommu_map()` calls with runtime PM, saved/restored non-secure context bank registers + `ARM_SMMU_CB_S1_TLBIASID` in `qcom_iommu_resume()` for non-genpd `VDD_CX` SMMUs (`1f08000.iommu`), exposed `qcom_msm8909_gdsc_is_active()` in `gcc-msm8909.c`, added `dev_pm_genpd_synced_poweroff()` + `pm_runtime_put_sync()`/`pm_runtime_get_sync()` in `adreno_recover()` so `oxili_gdsc` resets cleanly on ringbuffer lockups, added `.idle_bias_on = 0` + `REGCACHE_FLAT` + `200 ms` runtime autosuspend (`RUNTIME_PM_OPS`) in `msm8916-wcd-digital.c`, and seeded `vreg->is_enabled = 1` for PM8909 `l14`, `l15`, and `l18` in `qcom_smd-regulator.c`.
|
- **Adreno 304 `gfx-mem` interconnect scaling, `qcom_iommu` non-genpd resume/TLB fix, GDSC recovery cycle, WCD-digital runtime PM, and PM8909 LDO seeding (`0010`)**: wired `bimc`/`pcnoc`/`snoc` nodes and Adreno 304 `gfx-mem` interconnect (`MAS_OXILI -> SLV_EBI`) in `qcom-msm8909.dtsi` and all six device DTS files, moved `a3xx_gpu_init()`'s static `icc_set_bw()` into `msm_gpu_pm_resume()` / `msm_gpu_pm_suspend()` (`Bps_to_icc(gpu->fast_rate) * 8` while active, `0` when runtime-suspended so BIMC still drops to `19.2 MHz` XO when idle without starving Adreno 304 during `powersave`/DPMS transitions), guarded blocking `qcom_iommu_map()` calls with runtime PM, saved/restored non-secure context bank registers + `ARM_SMMU_CB_S1_TLBIASID` in `qcom_iommu_resume()` for non-genpd `VDD_CX` SMMUs (`1f08000.iommu`), exposed `qcom_msm8909_gdsc_is_active()` in `gcc-msm8909.c`, added `dev_pm_genpd_synced_poweroff()` + `pm_runtime_put_sync()`/`pm_runtime_get_sync()` in `adreno_recover()` so `oxili_gdsc` resets cleanly on ringbuffer lockups, added `.idle_bias_on = 0` + `REGCACHE_FLAT` + `200 ms` runtime autosuspend (`RUNTIME_PM_OPS`) in `msm8916-wcd-digital.c`, and seeded `vreg->is_enabled = 1` for PM8909 `l14`, `l15`, and `l18` in `qcom_smd-regulator.c`.
|
||||||
- **Disable `ttyMSM0` (`serial@78af000`) and extend runtime power policy**: disabled `serial@78af000` + cleared `chosen/stdout-path` in all DTS files and removed `console=ttyMSM0,115200` from all `kernel-cmdline.conf` and `50-device-*.conf` fragments; added `CPU_RPM_SLEEP=1`, `CPU_L2_SLEEP=1`, `WIFI_SCREEN_OFF_IPV6_MUTE=1` (mutes unsolicited `wlan0` IPv6 RAs while dark on IPv4 networks, restored on wake), opt-in `WIFI_STANDBY_RAT=keep|gsm`, and `cpuidle_qcom_spm` / `qcom_stats` / `qcom_rpm_master_stats` telemetry to `bananarchy-power-policy.conf` and `bananarchy-power-policy.sh`.
|
- **Disable `ttyMSM0` (`serial@78af000`) and extend runtime power policy**: disabled `serial@78af000` + cleared `chosen/stdout-path` in all DTS files and removed `console=ttyMSM0,115200` from all `kernel-cmdline.conf` and `50-device-*.conf` fragments; added `CPU_RPM_SLEEP=0`, `CPU_L2_SLEEP=0`, `MODEM_DRX_MODE=0` (opt-in `rpm_sleep`/`l2_sleep`/`AT$QCDRX` while preserving per-core `SPC` `< 0.2 ms` wakeup on `smd-edge` and avoiding `ModemManager` AT port contention), `WIFI_SCREEN_OFF_IPV6_MUTE=1` (mutes unsolicited `wlan0` IPv6 RAs while dark on IPv4 networks, restored on wake), opt-in `WIFI_STANDBY_RAT=keep|gsm`, and `cpuidle_qcom_spm` / `qcom_stats` / `qcom_rpm_master_stats` telemetry to `bananarchy-power-policy.conf` and `bananarchy-power-policy.sh`.
|
||||||
- **Compiled C11 autostart daemons (`bananarchy-dsds` and monitors)**: replaced `python3 - dsds-daemon`, `sxmo_modemmonitor.sh`, `sxmo_soundmonitor.sh` (`evtest`), `sxmo_notifs.sh monitor` (`inotifywait`), `sxmo_run_aligned.sh` (`sxmo_aligned_sleep`), and the `bananarchy-x11-session.sh` tail loop with 0%-CPU compiled C11 ARM ELF binaries (`bananarchy-dsds`, `bananarchy-modemmonitor`, `bananarchy-soundmonitor`, `bananarchy-notifmonitor`, `bananarchy-run-aligned`, `bananarchy-session-loop`) plus thin `exec` compatibility shims, `doas` rule, and `superd` service units, leaving zero Python or `/bin/sh` daemons on autostart; guarded by `scripts/test-dsds-daemon.py` and `scripts/check-rebuild.sh`.
|
- **Compiled C11 autostart daemons (`bananarchy-dsds` and monitors)**: replaced `python3 - dsds-daemon`, `sxmo_modemmonitor.sh`, `sxmo_soundmonitor.sh` (`evtest`), `sxmo_notifs.sh monitor` (`inotifywait`), `sxmo_run_aligned.sh` (`sxmo_aligned_sleep`), and the `bananarchy-x11-session.sh` tail loop with 0%-CPU compiled C11 ARM ELF binaries (`bananarchy-dsds`, `bananarchy-modemmonitor`, `bananarchy-soundmonitor`, `bananarchy-notifmonitor`, `bananarchy-run-aligned`, `bananarchy-session-loop`) plus thin `exec` compatibility shims, `doas` rule, and `superd` service units, leaving zero Python or `/bin/sh` daemons on autostart; guarded by `scripts/test-dsds-daemon.py` and `scripts/check-rebuild.sh`.
|
||||||
|
|
||||||
- **MSM8909 RPM interconnect bus scaling (`CONFIG_INTERCONNECT_QCOM_MSM8909=y`)**: enabled `CONFIG_INTERCONNECT_QCOM=y`, `CONFIG_INTERCONNECT_QCOM_MSM8909=y`, and `CONFIG_INTERCONNECT_QCOM_SMD_RPM=y`, marked `msm8909_bimc`, `msm8909_pcnoc`, and `msm8909_snoc` `.keep_alive = true` (`19.2 MHz` active floor, `0` in `QCOM_SMD_RPM_SLEEP_STATE`), initialized `qp->bus_clk_rate[*]` to `U32_MAX` in `qnoc_probe()` so `icc_sync_state` clears `clk_smd_rpm_handoff()`'s `INT_MAX` sleep-set vote in RPM, wired `interconnect@400000`, `interconnect@500000`, `interconnect@580000`, `cpus` `interconnects`, and `cpu-opp-table` `opp-peak-kBps` across all six MSM8905/MSM8909 DTS files, and lowered the `199999951 Hz` idle CPU OPP `opp-peak-kBps` floor from `<0xc3500>` (`100 MHz` BIMC) to `<0x25800>` (`153,600 kBps` = `19.2 MHz` XO floor) (`0009`) while preserving `vermagic` across all 580 `.ko.zst` modules.
|
- **MSM8909 RPM interconnect bus scaling (`CONFIG_INTERCONNECT_QCOM_MSM8909=y`)**: enabled `CONFIG_INTERCONNECT_QCOM=y`, `CONFIG_INTERCONNECT_QCOM_MSM8909=y`, and `CONFIG_INTERCONNECT_QCOM_SMD_RPM=y`, marked `msm8909_bimc`, `msm8909_pcnoc`, and `msm8909_snoc` `.keep_alive = true` (`19.2 MHz` active floor, `0` in `QCOM_SMD_RPM_SLEEP_STATE`), initialized `qp->bus_clk_rate[*]` to `U32_MAX` in `qnoc_probe()` so `icc_sync_state` clears `clk_smd_rpm_handoff()`'s `INT_MAX` sleep-set vote in RPM, wired `interconnect@400000`, `interconnect@500000`, `interconnect@580000`, `cpus` `interconnects`, and `cpu-opp-table` `opp-peak-kBps` across all six MSM8905/MSM8909 DTS files, and lowered the `199999951 Hz` idle CPU OPP `opp-peak-kBps` floor from `<0xc3500>` (`100 MHz` BIMC) to `<0x25800>` (`153,600 kBps` = `19.2 MHz` XO floor) (`0009`) while preserving `vermagic` across all 580 `.ko.zst` modules.
|
||||||
- **Unblock `fw_devlink` `sync_state` (`CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT=y`) and release unclaimed `clk-smd-rpm` votes (`0009`)**: enabled `CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT=y` with `fw_devlink` post-init relaxation in `drivers/base/core.c` so driverless `/cpus/cpu@0..3` no longer deadlock `rpmpd_sync_state()` (`VDD_CX`/`VDD_MX` stuck at `SUPER_TURBO`) or `icc_sync_state()`, and added `late_initcall_sync(rpm_smd_clk_late_cleanup)` in `drivers/clk/qcom/clk-smd-rpm.c` to drop active votes on unclaimed `QDSS`/`QPIC` clocks and clear RPM `SLEEP_STATE` boot-handoff votes on all unclaimed clocks without altering `BB_CLK1`/`RF_CLK1` active votes.
|
- **Unblock `fw_devlink` `sync_state` (`CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT=y`) and release unclaimed `clk-smd-rpm` votes (`0009`)**: enabled `CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT=y` with `fw_devlink` post-init relaxation in `drivers/base/core.c` so driverless `/cpus/cpu@0..3` no longer deadlock `rpmpd_sync_state()` (`VDD_CX`/`VDD_MX` stuck at `SUPER_TURBO`) or `icc_sync_state()`, and added `late_initcall_sync(rpm_smd_clk_late_cleanup)` in `drivers/clk/qcom/clk-smd-rpm.c` to drop active votes on unclaimed `QDSS`/`QPIC` clocks and clear RPM `SLEEP_STATE` boot-handoff votes on all unclaimed clocks without altering `BB_CLK1`/`RF_CLK1` active votes.
|
||||||
- **Live WCN3620 screen-off firmware offloads, BET, and `HOST_SUSPEND_IND` (`0008` + `0009`)**: `wcn36xx` now assigns both `hw->max_listen_interval` and `hw->conf.listen_interval` from `listen_interval` (clamped `1..10`, default `5`) before `ieee80211_register_hw()`, and exposes `/sys/module/wcn36xx/parameters/screen_off_offload` (toggled by `bananarchy-display-power-sync`). When screen-off offload is active, `wcn36xx` enables firmware ARP offload (when a single IPv4 address is assigned, preserving DHCP), IPv6 NS offload, GTK rekey offload, `ignore_dtim = true`, `dynamic_ps_timeout = 40 ms`, Beacon Early Termination (`enable_bet = 1`, `bet_interval = listen_interval`), aligned `dtim_period = listen_interval`, `bcast_mcast_filter = 3`, and `WCN36XX_HAL_HOST_SUSPEND_IND` / `HOST_RESUME_REQ` while keeping `rx_irq`/`tx_irq` armed for immediate inbound unicast delivery.
|
- **Live WCN3620 screen-off firmware offloads, BET, and `HOST_SUSPEND_IND` (`0008` + `0009`)**: `wcn36xx` now assigns both `hw->max_listen_interval` and `hw->conf.listen_interval` from `listen_interval` (clamped `1..10`, default `5`) before `ieee80211_register_hw()`, and exposes `/sys/module/wcn36xx/parameters/screen_off_offload` (toggled by `bananarchy-display-power-sync`). When screen-off offload is active, `wcn36xx` enables firmware ARP offload (when a single IPv4 address is assigned, preserving DHCP), IPv6 NS offload, GTK rekey offload, `ignore_dtim = true`, `dynamic_ps_timeout = 40 ms`, Beacon Early Termination (`enable_bet = 1`, `bet_interval = listen_interval`), aligned `dtim_period = listen_interval`, `bcast_mcast_filter = 3`, and `WCN36XX_HAL_HOST_SUSPEND_IND` / `HOST_RESUME_REQ` while keeping `rx_irq`/`tx_irq` armed for immediate inbound unicast delivery.
|
||||||
- **ChipIdea USB runtime PM and unplugged HS PHY shutdown (`ci_hdrc_msm`)**: enabled `CI_HDRC_SUPPORTS_RUNTIME_PM`, wrapped `ci_hdrc_msm_por_reset()` in `pm_runtime_resume_and_get()`/`pm_runtime_put()`, gated `iface_clk` (`100 MHz`) and `core_clk` (`80 MHz`) via `RUNTIME_PM_OPS` whenever `vbus_extcon` is disconnected, skipped `ULPI_SYNC_STATE` viewport polling in `ci_ulpi_resume()` when `CI_HDRC_OVERRIDE_PHY_CONTROL` is set, and in `0009` added `200 ms` runtime autosuspend on both `ci_hdrc_msm` and `ci_hdrc`, held parent runtime PM across `ci_hdrc_add_device()`, and called `usb_phy_shutdown()`/`usb_phy_init()` across unplugged suspend/resume so `pm8909_l13` (`3.075 V`), `pm8909_l7` (`1.8 V`), and `xo` drop cleanly while preserving USB RNDIS (`172.16.42.1`) hotplug.
|
- **ChipIdea USB runtime PM and unplugged HS PHY shutdown (`ci_hdrc_msm`)**: enabled `CI_HDRC_SUPPORTS_RUNTIME_PM`, wrapped `ci_hdrc_msm_por_reset()` in `pm_runtime_resume_and_get()`/`pm_runtime_put()`, gated `iface_clk` (`100 MHz`) and `core_clk` (`80 MHz`) via `RUNTIME_PM_OPS` whenever `vbus_extcon` is disconnected, skipped `ULPI_SYNC_STATE` viewport polling in `ci_ulpi_resume()` when `CI_HDRC_OVERRIDE_PHY_CONTROL` is set, and in `0009` added `200 ms` runtime autosuspend on both `ci_hdrc_msm` and `ci_hdrc`, held parent runtime PM across `ci_hdrc_add_device()`, and called `usb_phy_shutdown()`/`usb_phy_init()` across unplugged suspend/resume so `pm8909_l13` (`3.075 V`), `pm8909_l7` (`1.8 V`), and `xo` drop cleanly while preserving USB RNDIS (`172.16.42.1`) hotplug.
|
||||||
- **Default dual-port DSDS `MODEM_DRX_MODE=6` and dark-screen `dsds-daemon` sleep**: `bananarchy-power-policy.conf` now defaults to `MODEM_DRX_MODE=6` while keeping `DSDS_SECONDARY_MODE=active` so both SIMs remain reachable; `msm-modem-uim-selection` adds `at all` multi-port queries and `screen_is_idle()` in `dsds-daemon` (`poll_timeout = None` whenever locked, cover-lit, or backlight off); and `bananarchy-power-policy.sh` serializes AT access via `flock`, waits past `ModemManager`'s startup AT port probe, and re-applies `AT$QCDRX=6` across every `/dev/wwan0at*` port on `modem-ready` (`sxmo_hook_modem.sh` `registered`/`connected` and post-PIN/switch registration) with per-port inode caching in `/run/bananarchy-power-policy/drx.<port>`.
|
- **Dual-port DSDS infrastructure and dark-screen `dsds-daemon` sleep (`MODEM_DRX_MODE=0` safe shipping default)**: `bananarchy-power-policy.conf` defaults to `MODEM_DRX_MODE=0` and `DSDS_SECONDARY_MODE=active` so both SIMs stay reachable on MPSS's native DSDS scheduler without contending on `ModemManager`'s open `/dev/wwan0at*` ports (opt-in `6-9` supported); `msm-modem-uim-selection` adds `at all` multi-port queries and `screen_is_idle()` in `dsds-daemon` (`poll_timeout = None` whenever locked, cover-lit, or backlight off); and `bananarchy-power-policy.sh` serializes AT access via `flock` and applies `AT$QCDRX` across `/dev/wwan0at*` ports on `modem-ready` (`sxmo_hook_modem.sh` `registered`/`connected` and post-PIN/switch registration) when opted in, with per-port inode caching in `/run/bananarchy-power-policy/drx.<port>`.
|
||||||
- **MIPI DCS `DISPOFF` + `SLPIN` on `panel-mipi-dbi` DPMS off and `drm_mipi_dbi.ko.zst` rebuild (`0008` + `0009`)**: rebuilt both `panel-mipi-dbi.ko.zst` (`panel_mipi_dbi_disable()` issuing `0x28` (`msleep(20)`) + `0x10` (`msleep(50)`) under `drm_dev_enter()` after `backlight_disable()` and before `mipi_dbi_pipe_disable()`) and `drm_mipi_dbi.ko.zst` (previously unbuilt in `scripts/build-kernel-audio.sh` and omitted from `rebuild-image.sh` / `apply-bananarchy-overlay.sh`), halting the GC9305/ST7789V boost converter and 60 Hz GRAM scan during DPMS off while preserving the 2720 Flip closed-only `backend = kernel` cover path.
|
- **MIPI DCS `DISPOFF` + `SLPIN` on `panel-mipi-dbi` DPMS off and `drm_mipi_dbi.ko.zst` rebuild (`0008` + `0009`)**: rebuilt both `panel-mipi-dbi.ko.zst` (`panel_mipi_dbi_disable()` issuing `0x28` (`msleep(20)`) + `0x10` (`msleep(50)`) under `drm_dev_enter()` after `backlight_disable()` and before `mipi_dbi_pipe_disable()`) and `drm_mipi_dbi.ko.zst` (previously unbuilt in `scripts/build-kernel-audio.sh` and omitted from `rebuild-image.sh` / `apply-bananarchy-overlay.sh`), halting the GC9305/ST7789V boost converter and 60 Hz GRAM scan during DPMS off while preserving the 2720 Flip closed-only `backend = kernel` cover path.
|
||||||
- **Unconditional `net/wwan0` BAM-DMUX registration for `ModemManager` and primary-SIM QMI VOICE USSD fallback**: fixed `error: couldn't find modem` when running USSD or `mmcli` operations on Wi-Fi-only setups without a saved `type=gsm` NetworkManager profile. Because `MMPluginQcomSoc` sets `base-modem-data-net-supported = TRUE` and `base-modem-data-tty-supported = FALSE`, `ModemManager` drops `/org/freedesktop/ModemManager1/Modem/0` whenever `net/wwan0` is absent, while `bam-dmux.c` already runtime-suspends after `1000 ms` of inactivity (`pc_state=0`, DMA channels released) at zero standby cost. `etc/init.d/msm8909-modem-wwan-port` and `msm-modem-uim-selection` (`provision_slot()` / `bananarchy-dpm.sh open`) now open `--dpm-open-port=hw-data-ep-type=bam-dmux,...` unconditionally and wait for `/sys/class/net/wwan0` (running `mmcli -S` if opened after `ModemManager` startup), `10-bananarchy-dpm.sh` no longer closes the DPM port on interface `down`, and `msm-modem-uim-selection ussd` resolves `mm_modem` via `mmcli -L` and falls back to direct `AF_QIPCRTR` QMI VOICE USSD (`QMI_SERVICE_VOICE = 9`, `sub = 0`) on the primary SIM alongside `sub = 1` on the secondary SIM.
|
- **Unconditional `net/wwan0` BAM-DMUX registration for `ModemManager` and primary-SIM QMI VOICE USSD fallback**: fixed `error: couldn't find modem` when running USSD or `mmcli` operations on Wi-Fi-only setups without a saved `type=gsm` NetworkManager profile. Because `MMPluginQcomSoc` sets `base-modem-data-net-supported = TRUE` and `base-modem-data-tty-supported = FALSE`, `ModemManager` drops `/org/freedesktop/ModemManager1/Modem/0` whenever `net/wwan0` is absent, while `bam-dmux.c` already runtime-suspends after `1000 ms` of inactivity (`pc_state=0`, DMA channels released) at zero standby cost. `etc/init.d/msm8909-modem-wwan-port` and `msm-modem-uim-selection` (`provision_slot()` / `bananarchy-dpm.sh open`) now open `--dpm-open-port=hw-data-ep-type=bam-dmux,...` unconditionally and wait for `/sys/class/net/wwan0` (running `mmcli -S` if opened after `ModemManager` startup), `10-bananarchy-dpm.sh` no longer closes the DPM port on interface `down`, and `msm-modem-uim-selection ussd` resolves `mm_modem` via `mmcli -L` and falls back to direct `AF_QIPCRTR` QMI VOICE USSD (`QMI_SERVICE_VOICE = 9`, `sub = 0`) on the primary SIM alongside `sub = 1` on the secondary SIM.
|
||||||
|
|
||||||
@@ -37,7 +37,8 @@ Upcoming release build (`a1114` / `carbonara` via `scripts/version.sh`) targetin
|
|||||||
|
|
||||||
- **2720 Flip event-driven idle daemons and dynamic TLMM `gpiochip` resolution (`nokia-beatles`)**: replaced `bananarchy-lid`'s continuous `20 ms` (`50 Hz`) `poll()` loop, `10 Hz` `/sys/kernel/debug/gpio` full SoC GPIO register dump, and `2 s` `/dev/input` `glob` + `/run/bananarchy/cover.sock` broadcast with `/dev/input` `inotify` watching plus hardware `EV_SW` IRQ sleep (`poll(..., -1)` at `0` steady-state wakeups/s after the `20 ms` edge debounce and one `+2 s` post-transition confirmation check), and synchronized CPU `scaling_governor`, `schedutil/rate_limit_us` (`40000`), and Adreno 304 `governor` directly in `on_transition()`. Replaced `bananarchy-volume-keys`'s `1 s` `poll()` + `2 s` `/dev/input` `glob` loop with `/dev/input` `inotify` + `poll(..., -1)`. Updated `bananarchy-cover-idle` (`gpiochip_device = auto` via `BA_GPIO_GET_CHIPINFO` / `hw_ensure_gpiochip()`) and `bananarchy-cover-diagnose.sh` to resolve MSM8909 TLMM (`1000000.pinctrl`, e.g. `/dev/gpiochip2`) dynamically across `/dev/gpiochip*` so PMIC/TLMM probe-order shifts from strict `fw_devlink` + `qcom,mpm` no longer leave external cover button wakes in `backend=none`.
|
- **2720 Flip event-driven idle daemons and dynamic TLMM `gpiochip` resolution (`nokia-beatles`)**: replaced `bananarchy-lid`'s continuous `20 ms` (`50 Hz`) `poll()` loop, `10 Hz` `/sys/kernel/debug/gpio` full SoC GPIO register dump, and `2 s` `/dev/input` `glob` + `/run/bananarchy/cover.sock` broadcast with `/dev/input` `inotify` watching plus hardware `EV_SW` IRQ sleep (`poll(..., -1)` at `0` steady-state wakeups/s after the `20 ms` edge debounce and one `+2 s` post-transition confirmation check), and synchronized CPU `scaling_governor`, `schedutil/rate_limit_us` (`40000`), and Adreno 304 `governor` directly in `on_transition()`. Replaced `bananarchy-volume-keys`'s `1 s` `poll()` + `2 s` `/dev/input` `glob` loop with `/dev/input` `inotify` + `poll(..., -1)`. Updated `bananarchy-cover-idle` (`gpiochip_device = auto` via `BA_GPIO_GET_CHIPINFO` / `hw_ensure_gpiochip()`) and `bananarchy-cover-diagnose.sh` to resolve MSM8909 TLMM (`1000000.pinctrl`, e.g. `/dev/gpiochip2`) dynamically across `/dev/gpiochip*` so PMIC/TLMM probe-order shifts from strict `fw_devlink` + `qcom,mpm` no longer leave external cover button wakes in `backend=none`.
|
||||||
- **Shared GPU `devfreq`, `schedutil`, statusbar, eMMC, and Bluetooth idle fixes (`nokia-argon` and `nokia-beatles`)**: granted `video`-group `0664` permissions to `/sys/class/devfreq/1c00000.gpu/governor` in `10-power-save.start`, synced `1c00000.gpu/governor` (`powersave` while dark or cover-lit, `simple_ondemand` when the main panel wakes) in `bananarchy-display-power-sync` and `locker.so`, and restored `schedutil/rate_limit_us = 40000` on `FORCE=1` transitions as well as normal udev events. `sxmo_hook_statusbar.sh` skips `sxmo_hook_icons.sh` on `time` ticks and updates `099-time` directly in-shell without spawning `sxmo_status.sh` and duplicate `mkdir -p` forks every minute; `sxmo_wm.sh display off` skips rewriting `~/.config/sxmo/brightness` on ext4 when unchanged; `sxmo_hook_screenoff.sh` skips spawning `sxmo_autosuspend.sh` when `/etc/bananarchy-no-deep-standby` is present; and `bananarchy-bt-obex` replaces its `1.0 s` D-Bus/RFCOMM poll and `1.5-2.0 s` `/dev/input` gamepad scan with a signal self-pipe, `ctypes` `inotify`, and blocking `select.select(..., None)` (`0` idle wakeups/s when Bluetooth is enabled, `<5 ms` gamepad hotplug).
|
- **Shared GPU `devfreq`, `schedutil`, statusbar, eMMC, and Bluetooth idle fixes (`nokia-argon` and `nokia-beatles`)**: granted `video`-group `0664` permissions to `/sys/class/devfreq/1c00000.gpu/governor` in `10-power-save.start`, synced `1c00000.gpu/governor` (`powersave` while dark or cover-lit, `simple_ondemand` when the main panel wakes) in `bananarchy-display-power-sync` and `locker.so`, and restored `schedutil/rate_limit_us = 40000` on `FORCE=1` transitions as well as normal udev events. `sxmo_hook_statusbar.sh` skips `sxmo_hook_icons.sh` on `time` ticks and updates `099-time` directly in-shell without spawning `sxmo_status.sh` and duplicate `mkdir -p` forks every minute; `sxmo_wm.sh display off` skips rewriting `~/.config/sxmo/brightness` on ext4 when unchanged; `sxmo_hook_screenoff.sh` skips spawning `sxmo_autosuspend.sh` when `/etc/bananarchy-no-deep-standby` is present; and `bananarchy-bt-obex` replaces its `1.0 s` D-Bus/RFCOMM poll and `1.5-2.0 s` `/dev/input` gamepad scan with a signal self-pipe, `ctypes` `inotify`, and blocking `select.select(..., None)` (`0` idle wakeups/s when Bluetooth is enabled, `<5 ms` gamepad hotplug).
|
||||||
- **Image persistence and upcoming release archives**: rebuilt both `images/bananarchy-nokia-argon.img` (SHA-256 `d913b7fe328b3d8c0be242e5d2666d6f03453c565ddc1120ef59698f4445e079`) and `images/bananarchy-nokia-beatles.img` (SHA-256 `d290476ba796abc4eb36eeacb0f6312fe3e33623f7a38b2c607a609808fe4f5e`, with standalone `images/boot-bananarchy-nokia-beatles.img` SHA-256 `7920fae28fa3389602be16a02ad7311b50e61c9c205be48f160307d594f65eb6` and unchanged display lk2nd `b5549698c20f4de7603fc746d32bb5baa96ec377e41e74407823c98506fc185d`) stamped as `a1114` / `carbonara` with `--mkinitfs`, pinned in `scripts/check-rebuild.sh`, and packaged into `bananarchy-nokia-argon-a1114-carbonara.zip` (`8408ec4d99cb7685c7e7bd03051883885b72d710cc2d59a939634367516de812`) and `bananarchy-nokia-beatles-a1114-carbonara.zip` (`deec84db35b9bebd8215546c9393b306581f5c02dc1d756e21e0c9fe33aedbfe`).
|
- **2720 Flip closed-flip call wakeups, call preservation, closed-flip cover call controls, live timezone sync, and Power menu cleanup**: disabled runtime `CPU_RPM_SLEEP`/`CPU_L2_SLEEP` (`QCOM_SCM_CPU_PWR_DOWN_L2_OFF`) by default (keeping per-core `SPC` active so closed-flip incoming calls wake APSS via `smd-edge` in `< 0.2 ms` instead of stalling until flip-open), gated `bananarchy-display-power-sync`'s `spm/screen_off` write on `rpm_sleep=Y`, serialized `sxmo_modem.sh` `checkforincomingcalls`/`checkforfinishedcalls` under `sxmo_modem.voicecalls.lock` with a live `ringing-in|waiting` check before ringing + 8 s `sxmo_hangup_requested` expiry + `incoming_call_menu` dedup when `xcallscreen` is active, suppressed `bananarchy-idle-lock.sh` while the flip is closed or a call is ringing/active (and cancelled pending idle-lock timers in `bananarchy-lid` on flip transitions), prevented `locker.so` idle/already-closed-blanked `HANGUP_CLOSE` side effects and idle `HANGUP_CLOSE` `/tmp/sxmo_hangup_requested` / fallback `cid=1` QMI hangups in `callscreen.so` (along with duplicate `INCOMING` `ringMuted` reset and `RAISE` stale-call verification); opening the 2720 Flip during a live call keeps `/tmp/bananarchy_screen_locked` set while bypassing `locker.so` activation (`UNGRAB`) and `sxmo_hook_lock.sh` hangup (`! HANGUP_CLOSE`) and raising `callscreen.so` (`RAISE`) cleanly on top; closed-flip incoming calls wake and hold `bananarchy-cover-idle` lit (`cover_hold_awake`), display contact/number and `[SIM n]` tag via `bananarchy-cover-event.sh`, mute the ringer on `BUTTON VOLUP`/`VOLDOWN` (`mute-ring`), hang up on external `BUTTON POWER` (`hangup-call`) with a late async `CALL muted` guard, and blank cleanly on `SIGTERM`; `bananarchy-time-sync.sh` waits for `chronyd` sync completion on `boot`/`network-up`/`force`/`sync`, and `setup-timezone` / `sxmo_timezonechange.sh` / `dmenu` immediately propagate timezone changes across `099-time`, `locker.so` (`REFRESH_TIME`), `bananarchy-cover-idle` (`ba_refresh_tz` / `REFRESH`), `bananarchy-dsds`, `callscreen.so`, and `bananarchy-run-aligned` (`SIGUSR1`) without rebooting (`scripts/test-time-timezone-sync.py`); the non-functional `Logout` entry is removed from the Power menu (`dmenu.c`, `dmenu.so`, `sxmo_appmenu.sh`, `sxmo_hook_contextmenu.sh`) while keeping **Reboot to loader** (`sxmo_power.sh bootloader`); and all `sxmo_calls` live-call readers (`phone_data.h`, `callscreen.so`, `dmenu.so`, `libneoui.so`, `xdrawer.so`, `bananarchy-dsds`, `sxmo_appmenu.sh`) ignore post-call markers (`discardedcall`, `hangedupcall`, `terminated`, `blockedcall`, standalone `mutedring`) while `sxmo_modemcall.sh` reaps orphan markers when `/Call/<id>` is absent (`scripts/test-dsds-daemon.py`) so `XF86PowerOff` always opens the Power menu when no call is live.
|
||||||
|
- **Image persistence and upcoming release archives**: rebuilt both `images/bananarchy-nokia-argon.img` (SHA-256 `7b39e0ef4cbfc169a4fa0eeda5641ed59df7644b5e5265f8f3f5b25e7f3a8e41`) and `images/bananarchy-nokia-beatles.img` (SHA-256 `19f605dbb5a80ca073895a7ed41149a1a7692c79f12f399bff1e61d497daf069`, with standalone `images/boot-bananarchy-nokia-beatles.img` SHA-256 `7920fae28fa3389602be16a02ad7311b50e61c9c205be48f160307d594f65eb6` and unchanged display lk2nd `b5549698c20f4de7603fc746d32bb5baa96ec377e41e74407823c98506fc185d`) stamped as `a1114` / `carbonara` with `--mkinitfs`, pinned in `scripts/check-rebuild.sh`, and packaged into `bananarchy-nokia-argon-a1114-carbonara.zip` (`0e45d5c892bdfdb33a696235a86993ce48bc92d0dac8f8a9a853661410a47297`) and `bananarchy-nokia-beatles-a1114-carbonara.zip` (`59810d8af4982c4bf43908d76303aa88f701721c909c7bf8207f585bcae71bd0`).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -110,11 +110,11 @@ sudo dd if=./images/bananarchy-<device>.img of=/dev/sdX bs=4M status=progress co
|
|||||||
| **2720 Flip outer side keys (closed)** | `KEY_VOLUMEUP` / `KEY_VOLUMEDOWN` / `KEY_POWER` | While the flip is closed, wake the external `240x240` cover display (centered clock, date, battery, and network indicators) for the configured **Screen blank** duration while keeping the internal panel dark |
|
| **2720 Flip outer side keys (closed)** | `KEY_VOLUMEUP` / `KEY_VOLUMEDOWN` / `KEY_POWER` | While the flip is closed, wake the external `240x240` cover display (centered clock, date, battery, and network indicators) for the configured **Screen blank** duration while keeping the internal panel dark |
|
||||||
|
|
||||||
> **Screen blanking, idle blanking, RPM idle standby, passcode locking (`xlocker`), waking, and brightness persistence**:
|
> **Screen blanking, idle blanking, RPM idle standby, passcode locking (`xlocker`), waking, and brightness persistence**:
|
||||||
> While unlocked (and with the lid open), the display blanks automatically after the configured **Screen blank** timeout — **5 minutes by default** — via `dwm`'s own evdev input timer and `bananarchy-idle-blank.sh`. Change it in **Config -> Screen blank** (`Off`, 30 s, 1/5/10/30 min), which writes `~/.config/sxmo/idle_blank_timeout`; `bananarchy-idle-timeout.sh get|label|set <seconds>` does the same from the shell, and `SXMO_UNLOCK_IDLE_TIME` or `~/.cache/sxmo/sxmo.noidle` still override/disable it. Closing the slider/lid or locking from the **Power** menu blanks the panel **immediately** (both `Lock` and `Lock (Screen off)` now use `xlocker screenoff`), and an incoming call or SMS/notification turns it back on **immediately** via `bananarchy-screen-wake.sh`, which also resets `dwm`'s idle timer so it cannot blank again right away. Any keypad, lid or power key also restores the display; if it arrives before the idle-lock delay elapses, the desktop stays unlocked. Blanking now arms the screenlock daemon: `bananarchy-idle-blank.sh` calls `bananarchy-idle-lock.sh arm`, which starts the trusted `sxmo_state.sh set screenoff` transition (`xlocker screenoff` -> `LOCK_BLANK` on `locker.so`) after **30 seconds** of dark panel by default. Set `~/.config/sxmo/idle_lock_delay` with `bananarchy-idle-lock.sh set 0` to lock immediately on blank, any other number of seconds to change the grace period, or `set off` to keep the old blank-without-passcode behaviour. `bananarchy-idle-lock.sh get|label|cancel` reports and cancels the pending lock; `bananarchy-screen-wake.sh`, `bananarchy-idle-blank.sh on` and `sxmo_hook_unlock.sh` cancel it on every wake, and the transition only fires while the panel is still dark. X11 screensaver timeouts stay at `0 0 0`; DPMS is driven by the backlight state. Traditional Linux **`mem` suspend (`/sys/power/state`)** stays disabled (`# CONFIG_SUSPEND is not set` + `/etc/bananarchy-no-deep-standby`) to keep the pmaports module ABI and instant hardware wakeups (stock firmware lacks PSCI `SYSTEM_SUSPEND`); instead, `cpuidle_qcom_spm` enters hardware XO/RPM sleep (`vMPM`) and L2 SAW2 retention/collapse (`CPU_RPM_SLEEP=1`, `CPU_L2_SLEEP=1`) directly from deep idle while `serial@78af000` (`console=ttyMSM0`) is disabled so UART clocks never pin XO or `gpll0`. Locking the phone (`Power -> Lock`, `Power -> Lock (Screen off)`, `2x End / Power`, or closing the physical slider) activates the fullscreen `240x320` **Passcode Locker (`xlocker` / `locker.so`)**, which verifies your numeric system password (`147147` by default, checked against `/etc/shadow` via `/usr/bin/bananarchy-verify-passcode`). While locked, there is no keypad, softkey, slider, or power-button bypass (`dmenu`, `xdrawer`, terminal spawning, and desktop shortcuts are blocked, and only incoming calls can temporarily overlay `xcallscreen`). Screen and keypad brightness levels configured in **XDrawer** or **Config -> Brightness** are persisted in `~/.config/sxmo/brightness` and `/tmp/sxmo_saved_brightness` and restored on every wake.
|
> While unlocked (and with the lid open), the display blanks automatically after the configured **Screen blank** timeout — **5 minutes by default** — via `dwm`'s own evdev input timer and `bananarchy-idle-blank.sh`. Change it in **Config -> Screen blank** (`Off`, 30 s, 1/5/10/30 min), which writes `~/.config/sxmo/idle_blank_timeout`; `bananarchy-idle-timeout.sh get|label|set <seconds>` does the same from the shell, and `SXMO_UNLOCK_IDLE_TIME` or `~/.cache/sxmo/sxmo.noidle` still override/disable it. Closing the slider/lid or locking from the **Power** menu blanks the panel **immediately** (both `Lock` and `Lock (Screen off)` now use `xlocker screenoff`), and an incoming call or SMS/notification turns it back on **immediately** via `bananarchy-screen-wake.sh`, which also resets `dwm`'s idle timer so it cannot blank again right away. Any keypad, lid or power key also restores the display; if it arrives before the idle-lock delay elapses, the desktop stays unlocked. Blanking now arms the screenlock daemon: `bananarchy-idle-blank.sh` calls `bananarchy-idle-lock.sh arm`, which starts the trusted `sxmo_state.sh set screenoff` transition (`xlocker screenoff` -> `LOCK_BLANK` on `locker.so`) after **30 seconds** of dark panel by default. Set `~/.config/sxmo/idle_lock_delay` with `bananarchy-idle-lock.sh set 0` to lock immediately on blank, any other number of seconds to change the grace period, or `set off` to keep the old blank-without-passcode behaviour. `bananarchy-idle-lock.sh get|label|cancel` reports and cancels the pending lock; `bananarchy-screen-wake.sh`, `bananarchy-idle-blank.sh on` and `sxmo_hook_unlock.sh` cancel it on every wake, and the transition only fires while the panel is still dark. X11 screensaver timeouts stay at `0 0 0`; DPMS is driven by the backlight state. Traditional Linux **`mem` suspend (`/sys/power/state`)** stays disabled (`# CONFIG_SUSPEND is not set` + `/etc/bananarchy-no-deep-standby`) to keep the pmaports module ABI and instant hardware wakeups (stock firmware lacks PSCI `SYSTEM_SUSPEND`); instead, per-core `cpuidle_qcom_spm` Standalone Power Collapse (`L2_ON`) stays active with `< 0.2 ms` wakeup on all GIC SPIs while `serial@78af000` (`console=ttyMSM0`) is disabled so UART clocks never pin XO or `gpll0`. Locking the phone (`Power -> Lock`, `Power -> Lock (Screen off)`, `2x End / Power`, or closing the physical slider) activates the fullscreen `240x320` **Passcode Locker (`xlocker` / `locker.so`)**, which verifies your numeric system password (`147147` by default, checked against `/etc/shadow` via `/usr/bin/bananarchy-verify-passcode`). While locked, there is no keypad, softkey, slider, or power-button bypass (`dmenu`, `xdrawer`, terminal spawning, and desktop shortcuts are blocked, and only incoming calls can temporarily overlay `xcallscreen`). Screen and keypad brightness levels configured in **XDrawer** or **Config -> Brightness** are persisted in `~/.config/sxmo/brightness` and `/tmp/sxmo_saved_brightness` and restored on every wake.
|
||||||
|
|
||||||
|
|
||||||
> **Runtime power policy (`/etc/bananarchy-power-policy.conf`)**:
|
> **Runtime power policy (`/etc/bananarchy-power-policy.conf`)**:
|
||||||
> `WIFI_LISTEN_INTERVAL` (1-10, default 5) sets the `wcn36xx` beacon listen interval (`max_listen_interval` and `conf.listen_interval`) via `/etc/modprobe.d/10-bananarchy-power.conf`, while `bananarchy-display-power-sync` toggles `/sys/module/wcn36xx/parameters/screen_off_offload` to enable WCN3620 ARP/IPv6-NS/GTK, BET, and DTIM offloads (`HOST_SUSPEND_IND`) while the main panel is dark without suspending host RX. `WIFI_SCREEN_OFF_IPV6_MUTE=1` (default) mutes unsolicited IPv6 router advertisements (`accept_ra=0`) on `wlan0` while dark if `wlan0` already holds an IPv4 address and restores the previous value on wake. `WIFI_STANDBY_RAT=keep` (default; set `gsm` to opt in) optionally parks QMI NAS mode preference to GSM after 30 s of darkness while `wlan0` is `up`, restoring the saved RAT preference on wake. `CPU_RPM_SLEEP=1` and `CPU_L2_SLEEP=1` (both default `1`) control runtime `/sys/module/cpuidle_qcom_spm/parameters/{rpm_sleep,l2_sleep}` cluster RPM (`vMPM`) and L2 SAW2 sleep handoff when all online CPUs go idle. `MODEM_DRX_MODE` (default `6`) applies the Qualcomm `AT$QCDRX` DRX mode across all `/dev/wwan0at*` channels at boot and on screen transitions (cached per AT port inode); `6` enables the standard ~1.28 s low-power paging cycle across active SIMs, `7-9` are progressively longer undocumented paging cycles, and `0` leaves the firmware default untouched. The standard `AT+CPSMS` / `AT+CEDRXS` PSM/eDRX commands are not supported by this modem firmware. `DSDS_SECONDARY_MODE=eco` (default `active`) deactivates the secondary SIM's GW provisioning session after `DSDS_PARK_DELAY` seconds (default 300) of a dark panel and restores it on wake; **SIM2 is unreachable while parked**. This uses QMI provisioning sessions, not SIM power-off, so a PIN-locked SIM stays locked. Edit the file as root and run `doas /usr/bin/bananarchy-power-policy.sh apply`, or reboot; `doas /usr/bin/bananarchy-power-policy.sh status` reports the effective values across AT ports, `wcn36xx`, `cpuidle_qcom_spm`, `/sys/kernel/debug/qcom_stats`, and `/sys/kernel/debug/qcom_rpm_master_stats`. See `BATTERY-OPTIMIZATION-ANALYSIS.md` §§15, 20-22.
|
> `WIFI_LISTEN_INTERVAL` (1-10, default 5) sets the `wcn36xx` beacon listen interval (`max_listen_interval` and `conf.listen_interval`) via `/etc/modprobe.d/10-bananarchy-power.conf`, while `bananarchy-display-power-sync` toggles `/sys/module/wcn36xx/parameters/screen_off_offload` to enable WCN3620 ARP/IPv6-NS/GTK, BET, and DTIM offloads (`HOST_SUSPEND_IND`) while the main panel is dark without suspending host RX. `WIFI_SCREEN_OFF_IPV6_MUTE=1` (default) mutes unsolicited IPv6 router advertisements (`accept_ra=0`) on `wlan0` while dark if `wlan0` already holds an IPv4 address and restores the previous value on wake. `WIFI_STANDBY_RAT=keep` (default; set `gsm` to opt in) optionally parks QMI NAS mode preference to GSM after 30 s of darkness while `wlan0` is `up`, restoring the saved RAT preference on wake. `CPU_RPM_SLEEP=0` and `CPU_L2_SLEEP=0` (both default `0`) control opt-in runtime `/sys/module/cpuidle_qcom_spm/parameters/{rpm_sleep,l2_sleep}` cluster RPM (`vMPM`) and L2 SAW2 sleep handoff; keep `0` by default because per-core SPC with L2 retention already wakes in `< 0.2 ms` on every GIC SPI without collapsing APSS GIC and dropping `smd-edge` modem wakeups during closed-flip standby. `MODEM_DRX_MODE` (default `0`) leaves the firmware's native DSDS paging scheduler untouched without contending with `ModemManager` on open `/dev/wwan0at*` ports; values `6-9` remain opt-in to apply Qualcomm `AT$QCDRX` across all `/dev/wwan0at*` channels (`6` enables ~1.28 s DRX, and `7-9` are progressively longer undocumented paging cycles). The standard `AT+CPSMS` / `AT+CEDRXS` PSM/eDRX commands are not supported by this modem firmware. `DSDS_SECONDARY_MODE=eco` (default `active`) deactivates the secondary SIM's GW provisioning session after `DSDS_PARK_DELAY` seconds (default 300) of a dark panel and restores it on wake; **SIM2 is unreachable while parked**. This uses QMI provisioning sessions, not SIM power-off, so a PIN-locked SIM stays locked. Edit the file as root and run `doas /usr/bin/bananarchy-power-policy.sh apply`, or reboot; `doas /usr/bin/bananarchy-power-policy.sh status` reports the effective values across AT ports, `wcn36xx`, `cpuidle_qcom_spm`, `/sys/kernel/debug/qcom_stats`, and `/sys/kernel/debug/qcom_rpm_master_stats`. See `BATTERY-OPTIMIZATION-ANALYSIS.md` §§15, 20-22.
|
||||||
|
|
||||||
#### 3.1.1 Window tiling modes and switching combos
|
#### 3.1.1 Window tiling modes and switching combos
|
||||||
By default, `dwm` uses the **vertical bottom-stack (`bstack`, `TTT`)** layout so multiple `st` terminals stack **vertically (one under another)** to preserve full line width on the `240x320` portrait screen.
|
By default, `dwm` uses the **vertical bottom-stack (`bstack`, `TTT`)** layout so multiple `st` terminals stack **vertically (one under another)** to preserve full line width on the `240x320` portrait screen.
|
||||||
@@ -139,7 +139,7 @@ All twenty-five phone applications are compiled as shared-object plugins (`/usr/
|
|||||||
|
|
||||||
1. **System and context menus (`dmenu.so` / `dmenu` / `xdmenu`)**:
|
1. **System and context menus (`dmenu.so` / `dmenu` / `xdmenu`)**:
|
||||||
- **Open / close**: press **Left softkey (`Menu`)** for the **System menu** or **Right softkey (`Back`)** inside an application for its **Context menu**; press the same softkey or `Escape` to close.
|
- **Open / close**: press **Left softkey (`Menu`)** for the **System menu** or **Right softkey (`Back`)** inside an application for its **Context menu**; press the same softkey or `Escape` to close.
|
||||||
- **Built-in submenus and instant toggles**: renders `sys`, `applications`, `scripts`, `modem`, `config`, `sdcard`, `power` (including **Lock**, **Lock (Screen off)**, **Logout**, **Reboot**, **Reboot to loader**, and **Poweroff**; use the lk2nd Fastboot menu for **EDL**), `audio` (with linear volume steps and **Output: Speaker**, **Output: Earpiece**, and **Output: Headphones** routing), `notifications`, `wm`, `timezone`, `games`, `st`, and `nano` menus in place in `< 0.5 ms` without spawning external processes.
|
- **Built-in submenus and instant toggles**: renders `sys`, `applications`, `scripts`, `modem`, `config`, `sdcard`, `power` (including **Lock**, **Lock (Screen off)**, **Reboot**, **Reboot to loader**, and **Poweroff**; use the lk2nd Fastboot menu for **EDL**), `audio` (with linear volume steps and **Output: Speaker**, **Output: Earpiece**, and **Output: Headphones** routing), `notifications`, `wm`, `timezone`, `games`, `st`, and `nano` menus in place in `< 0.5 ms` without spawning external processes.
|
||||||
- **Script compatibility**: any script piping items into `/usr/bin/dmenu` or `sxmo_dmenu.sh` communicates with the resident daemon over `/tmp/dwm_plugin_dmenu.sock`.
|
- **Script compatibility**: any script piping items into `/usr/bin/dmenu` or `sxmo_dmenu.sh` communicates with the resident daemon over `/tmp/dwm_plugin_dmenu.sock`.
|
||||||
|
|
||||||
2. **Global phone controls (`xdrawer.so` / `xdrawer`)**:
|
2. **Global phone controls (`xdrawer.so` / `xdrawer`)**:
|
||||||
@@ -458,8 +458,8 @@ Three native X11 games (`/usr/bin/snake`, `/usr/bin/tetris`, and `/usr/bin/scoun
|
|||||||
- **Wi-Fi and Bluetooth missing**: both radios depend on the shared WCNSS remote processor. `msm-firmware-loader` must start in sysinit before udev and mount the stock `modem` and `persist` partitions under `/run/msm-firmware-loader/mnt`; it then exposes `wcnss.mdt` and the factory `WCNSS_qcom_wlan_nv.bin` through the kernel firmware path. Check `rc-service msm-firmware-loader status`, `cat /sys/class/remoteproc/remoteproc1/state`, and `dmesg | grep -Ei 'wcnss|remoteproc|firmware'`. A `Direct firmware load for wcnss.mdt failed` message means the loader package or its sysinit link is missing, not that the Wi-Fi and Bluetooth drivers are absent. After a successful boot, `wlan0` and `hci0` enumerate automatically; Bluetooth userspace still starts on demand from the Networks/Bluetooth UI to save power.
|
- **Wi-Fi and Bluetooth missing**: both radios depend on the shared WCNSS remote processor. `msm-firmware-loader` must start in sysinit before udev and mount the stock `modem` and `persist` partitions under `/run/msm-firmware-loader/mnt`; it then exposes `wcnss.mdt` and the factory `WCNSS_qcom_wlan_nv.bin` through the kernel firmware path. Check `rc-service msm-firmware-loader status`, `cat /sys/class/remoteproc/remoteproc1/state`, and `dmesg | grep -Ei 'wcnss|remoteproc|firmware'`. A `Direct firmware load for wcnss.mdt failed` message means the loader package or its sysinit link is missing, not that the Wi-Fi and Bluetooth drivers are absent. After a successful boot, `wlan0` and `hci0` enumerate automatically; Bluetooth userspace still starts on demand from the Networks/Bluetooth UI to save power.
|
||||||
- **X startup and keypad**: OpenRC starts independent services in parallel; `etc/init.d/local` replaces its stock `after *` dependency, which deadlocked with parallel startup on this image. `udev_settle_timeout=2` stops missing modem firmware from holding the display manager behind a long `udevadm settle`, and `bananarchy-sshd-debug` starts independently of `local.d`. A boot-open flip reads `/run/bananarchy/lid-state` and starts in `state=unlock` with no passcode screen, so the keypad is live as soon as `dwm` starts. If the keypad is dead, check `rc-service bananarchy-lid status`, `cat /run/bananarchy/lid-state`, `sxmo_state.sh get`, `/tmp/bananarchy_screen_locked`, `DISPLAY=:0 xwininfo -id 0xa00001` and `DISPLAY=:0 xinput list`.
|
- **X startup and keypad**: OpenRC starts independent services in parallel; `etc/init.d/local` replaces its stock `after *` dependency, which deadlocked with parallel startup on this image. `udev_settle_timeout=2` stops missing modem firmware from holding the display manager behind a long `udevadm settle`, and `bananarchy-sshd-debug` starts independently of `local.d`. A boot-open flip reads `/run/bananarchy/lid-state` and starts in `state=unlock` with no passcode screen, so the keypad is live as soon as `dwm` starts. If the keypad is dead, check `rc-service bananarchy-lid status`, `cat /run/bananarchy/lid-state`, `sxmo_state.sh get`, `/tmp/bananarchy_screen_locked`, `DISPLAY=:0 xwininfo -id 0xa00001` and `DISPLAY=:0 xinput list`.
|
||||||
- **Display distortion above 71% brightness**: the internal panel uses 25 MHz SPI on `nokia-beatles`, rather than the 50 MHz timing used by the other targets. This keeps the link stable when the MPP2 backlight PWM duty rises above the level-10/14 operating point. The brightness range remains 1–14 with no artificial cap, and panel offsets/init registers are unchanged. The timing can be checked with `dtc -I dtb -O dts /boot/qcom-msm8905-nokia-beatles.dtb | grep -A8 'display@0'`.
|
- **Display distortion above 71% brightness**: the internal panel uses 25 MHz SPI on `nokia-beatles`, rather than the 50 MHz timing used by the other targets. This keeps the link stable when the MPP2 backlight PWM duty rises above the level-10/14 operating point. The brightness range remains 1–14 with no artificial cap, and panel offsets/init registers are unchanged. The timing can be checked with `dtc -I dtb -O dts /boot/qcom-msm8905-nokia-beatles.dtb | grep -A8 'display@0'`.
|
||||||
- **Closing the flip**: `bananarchy-lid` keeps a sticky hall reading, re-reads gpio36/gpio92 immediately on every `EV_SW` edge, and uses a 20 ms debounce/loop. On close it writes `/run/bananarchy/lid-state`, `/tmp/bananarchy_screen_locked`, `sxmo.state`, both backlights and DPMS synchronously before spawning any hook, then runs `sxmo_state.sh set screenoff` through a generation-guarded wrapper. On open it releases the cover's shared SPI bus, restores the main panel and **keeps the desktop locked**: it writes state `lock`, sends `LOCK` to `locker.so` and runs `sxmo_state.sh set lock`, so the passcode lockscreen appears instead of an auto-unlocked desktop. A close is ~45-90 ms and an open ~10-130 ms. `bananarchy-lid-state.sh` drops stale hook spawns by lid state and generation. Check `rc-service bananarchy-lid status`, `sxmo_state.sh get`, `/tmp/bananarchy_screen_locked` and `grep -E " gpio(36|92) " /sys/kernel/debug/gpio`. If the hall polarity is inverted, set `BANANARCHY_LID_GPIO_FILE` to a different debugfs GPIO file.
|
- **Closing the flip**: `bananarchy-lid` keeps a sticky hall reading, re-reads gpio36/gpio92 immediately on every `EV_SW` edge, and uses a 20 ms debounce/loop. On close it writes `/run/bananarchy/lid-state`, `/tmp/bananarchy_screen_locked`, `sxmo.state`, both backlights and DPMS synchronously before spawning any hook, then runs `sxmo_state.sh set screenoff` through a generation-guarded wrapper. On open it releases the cover's shared SPI bus, restores the main panel and **keeps the desktop locked**: it writes state `lock`, sends `LOCK` to `locker.so`, runs `sxmo_state.sh set lock`, and sends `RAISE` to `callscreen.so` when `/tmp/sxmo_call_ringing` or `/tmp/sxmo_active_call` is present. `sxmo_hook_lock.sh` and `locker.so` preserve active calls without triggering `HANGUP_CLOSE` when activating on lock or flip open, so opening the flip during an incoming or active call brings up `callscreen` above the locked desktop without hanging up. A close is ~45-90 ms and an open ~10-130 ms. `bananarchy-lid-state.sh` drops stale hook spawns by lid state and generation. Check `rc-service bananarchy-lid status`, `sxmo_state.sh get`, `/tmp/bananarchy_screen_locked` and `grep -E " gpio(36|92) " /sys/kernel/debug/gpio`. If the hall polarity is inverted, set `BANANARCHY_LID_GPIO_FILE` to a different debugfs GPIO file.
|
||||||
- **Cover display status and behaviour**: `bananarchy-cover-idle` is the compiled 0%-CPU default daemon and answers `bananarchy-coverctl` (`PING`, `STATUS`, `LID CLOSED|OPEN`, `BUTTON`, `NETWORK`, `BATTERY`, `NOTIFY`, `BLANK`/`UNBLANK`, `TEST`, `SET`, `PROBE`); the native `bananarchy-coverd` is retained only for diagnostics. With the flip open the daemon does not touch the shared QUP5 SPI bus; initial closed-flip activation requires `card0-SPI-1/dpms = Off`. The shipping single-panel DTB uses `backend = kernel`: the KaiOS 3.10 DTS and kernel driver show that the two GC9305s share CS0, gpio110 D/C and one active-high PMIC MPP2 PWM backlight (`kernel_backlight_invert = 0`, `kernel_backlight_level = 14`), while gpio13 selects the panel (high = cover, low = internal), gpio23 is the external reset and gpio21 is TE. Because the internal 240x320 TN panel is normally-white while the external 240x240 panel is normally-black, a closed-flip button event wakes DRM with gpio13 low, paints an X11 `override_redirect` cover window and `/dev/fb0` solid black while leaving the internal GC9305 scanning black GRAM (`kernel_internal_sleep = 0`) so it blocks the shared backlight, switches gpio13 high, pulses gpio23, replays the exact vendor 240x240 init through `/sys/kernel/debug/dri/0/command`, and presents a centered 240x240 clock/date/status frame once per second. `/run/bananarchy/cover-backlight` contains `0` during dark GRAM preparation, `1` while the cover is lit, and is unlinked when dark; `bananarchy-display-power-sync` holds the matching brightness, `bl_power` and DPMS state (honouring `/run/bananarchy/cover-runtime.conf` for runtime `SET` overrides). `STATUS` reports `backend=kernel`, `mux=cover`; `BLANK` turns the shared backlight off, sleeps both controllers, parks gpio13 low and forces DPMS Off; `LID OPEN` sleeps the external panel, restores gpio13 low, brightness 14, `bl_power=0`, DPMS On and re-initialises the internal panel to the passcode lockscreen. The outer panel stays off until a trusted side-key `BUTTON` / `WAKE` arrives, and blanks dynamically after the same **Config -> Screen blank** timeout (`blank_timeout = auto`, reading `~/.config/sxmo/idle_blank_timeout` and `sxmo.noidle`). The legacy `spidev`, 8/9-bit, `PROBE`, `SET mux_closed_level 0|1`, `SET kernel_backlight_invert 0|1`, `SET kernel_internal_sleep 0|1` and `SET backend none` paths remain for rollback. `bananarchy-cover-diagnose.sh` reports the debugfs hook, backlight marker, GPIO lines, DPMS, firmware and daemon state. `scripts/test-cover-idle.py`, `scripts/test-cover-spidev.py`, `scripts/test-cover-kernel.py`, `scripts/test-cover-dt.py` and `scripts/test-lid-gate.py` guard the state machine, both backends, DT layouts and lid gate on the host. The opt-in two-panel `spi-mux` DT remains experimental because its separate gpio21 D/C wiring contradicts the vendor DTS and a live test darkened the main panel; `scripts/build-beatles-no-cover-dtb.py` builds the shipping rollback DTB.
|
- **Cover display status and behaviour**: `bananarchy-cover-idle` is the compiled 0%-CPU default daemon and answers `bananarchy-coverctl` (`PING`, `STATUS`, `LID CLOSED|OPEN`, `BUTTON`, `NETWORK`, `BATTERY`, `NOTIFY`, `CALL`, `REFRESH`, `BLANK`/`UNBLANK`, `TEST`, `SET`, `PROBE`); the native `bananarchy-coverd` is retained only for diagnostics. With the flip open the daemon does not touch the shared QUP5 SPI bus; initial closed-flip activation requires `card0-SPI-1/dpms = Off`. When a call arrives while closed (`CALL incoming|...|...|...`), the cover wakes automatically and stays lit past the normal blank timeout showing caller name/number, SIM tag, and side-key hints; pressing external **Volume Up/Down** (`BUTTON VOLUP`/`VOLDOWN` -> `bananarchy-cover-event.sh mute-ring`) mutes the ringer while keeping call state visible, and pressing external **Power**/camera (`BUTTON POWER` -> `bananarchy-cover-event.sh hangup-call`) hangs up without opening the flip. The shipping single-panel DTB uses `backend = kernel`: the KaiOS 3.10 DTS and kernel driver show that the two GC9305s share CS0, gpio110 D/C and one active-high PMIC MPP2 PWM backlight (`kernel_backlight_invert = 0`, `kernel_backlight_level = 14`), while gpio13 selects the panel (high = cover, low = internal), gpio23 is the external reset and gpio21 is TE. Because the internal 240x320 TN panel is normally-white while the external 240x240 panel is normally-black, a closed-flip button event wakes DRM with gpio13 low, paints an X11 `override_redirect` cover window and `/dev/fb0` solid black while leaving the internal GC9305 scanning black GRAM (`kernel_internal_sleep = 0`) so it blocks the shared backlight, switches gpio13 high, pulses gpio23, replays the exact vendor 240x240 init through `/sys/kernel/debug/dri/0/command`, and presents a centered 240x240 clock/date/status or call frame once per second (with live timezone reloads via `ba_refresh_tz()`). `/run/bananarchy/cover-backlight` contains `0` during dark GRAM preparation, `1` while the cover is lit, and is unlinked when dark; `bananarchy-display-power-sync` holds the matching brightness, `bl_power` and DPMS state (honouring `/run/bananarchy/cover-runtime.conf` for runtime `SET` overrides). `STATUS` reports `backend=kernel`, `mux=cover`; `BLANK` (and clean `SIGTERM` shutdown) turns the shared backlight off, sleeps both controllers, parks gpio13 low and forces DPMS Off; `LID OPEN` sleeps the external panel, restores gpio13 low, brightness 14, `bl_power=0`, DPMS On and re-initialises the internal panel to the passcode lockscreen (raising `callscreen` above it if a call is active or ringing). The outer panel stays off until a trusted side-key `BUTTON` / `WAKE` or incoming `CALL` arrives, and blanks dynamically after the same **Config -> Screen blank** timeout (`blank_timeout = auto`, reading `~/.config/sxmo/idle_blank_timeout` and `sxmo.noidle`). The legacy `spidev`, 8/9-bit, `PROBE`, `SET mux_closed_level 0|1`, `SET kernel_backlight_invert 0|1`, `SET kernel_internal_sleep 0|1` and `SET backend none` paths remain for rollback. `bananarchy-cover-diagnose.sh` reports the debugfs hook, backlight marker, GPIO lines, DPMS, firmware and daemon state. `scripts/test-cover-idle.py`, `scripts/test-cover-spidev.py`, `scripts/test-cover-kernel.py`, `scripts/test-cover-dt.py`, `scripts/test-lid-gate.py` and `scripts/test-time-timezone-sync.py` guard the state machine, both backends, DT layouts, lid gate and live timezone/network sync on the host. The opt-in two-panel `spi-mux` DT remains experimental because its separate gpio21 D/C wiring contradicts the vendor DTS and a live test darkened the main panel; `scripts/build-beatles-no-cover-dtb.py` builds the shipping rollback DTB.
|
||||||
|
|
||||||
- **Camera app frozen / UI unresponsive**: check `top` for `bananarchy-volume-keys`. The daemon must be a single instance at 0% CPU; stale evdev fds are pruned by `prune_devices()`/`drop_device()` and guarded by `flock`. `rc-service bananarchy-volume-keys status` and `bananarchy-keypad-diagnose.sh` report its state. `xcamera` should return immediately and `bananarchy-photo <file>` should write a 600x800 JPEG.
|
- **Camera app frozen / UI unresponsive**: check `top` for `bananarchy-volume-keys`. The daemon must be a single instance at 0% CPU; stale evdev fds are pruned by `prune_devices()`/`drop_device()` and guarded by `flock`. `rc-service bananarchy-volume-keys status` and `bananarchy-keypad-diagnose.sh` report its state. `xcamera` should return immediately and `bananarchy-photo <file>` should write a 600x800 JPEG.
|
||||||
- **Camera**: `/dev/video0` is provided by the out-of-tree `msm8905-cam` module, loaded at boot by `/etc/modules-load.d/bananarchy-hardware.conf` and `etc/local.d/10-bananarchy-hardware.start`. Check with `v4l2-ctl --list-devices`; a missing node means the module did not load (previously caused by a missing `/bin/sed` breaking the `modules` service).
|
- **Camera**: `/dev/video0` is provided by the out-of-tree `msm8905-cam` module, loaded at boot by `/etc/modules-load.d/bananarchy-hardware.conf` and `etc/local.d/10-bananarchy-hardware.start`. Check with `v4l2-ctl --list-devices`; a missing node means the module did not load (previously caused by a missing `/bin/sed` breaking the `modules` service).
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ Instead of spawning slow shell scripts for everyday phone tasks, Bananarchy runs
|
|||||||
- **Tox / Trifa P2P messenger and audio call client (`xtox` / `tox.so`)**: encrypted P2P messenger (`Friends`, `Chat`, `My Tox ID`) built on `c-toxcore` (`libtoxcore.so.2`) with DHT + TCP relay bootstrap, friend requests, persistent message history, and `ToxAV` 48 kHz Opus voice calls integrated with `xcallscreen`.
|
- **Tox / Trifa P2P messenger and audio call client (`xtox` / `tox.so`)**: encrypted P2P messenger (`Friends`, `Chat`, `My Tox ID`) built on `c-toxcore` (`libtoxcore.so.2`) with DHT + TCP relay bootstrap, friend requests, persistent message history, and `ToxAV` 48 kHz Opus voice calls integrated with `xcallscreen`.
|
||||||
- **Kopher SmallWeb browser (`xkopher` / `kopher` / `xsmallweb` / `smallweb.so`)**: multi-protocol SmallWeb client for **Gopher** (`gopher://`) with optional TLS (`gophers://`), **Gemini** (`gemini://`), **Spartan** (`spartan://`), and **Nex** (`nex://`), featuring WAP-style default keypad controls from [Kopher](https://code.luxferre.top/luxferre/kopher.git), user-adjustable keybindings (`~/.config/sxmo/smallweb_controls.tsv`), 10 bookmarks, custom homepage support, and link focus that always scrolls the viewport to the focused link in both wrapped and unwrapped modes.
|
- **Kopher SmallWeb browser (`xkopher` / `kopher` / `xsmallweb` / `smallweb.so`)**: multi-protocol SmallWeb client for **Gopher** (`gopher://`) with optional TLS (`gophers://`), **Gemini** (`gemini://`), **Spartan** (`spartan://`), and **Nex** (`nex://`), featuring WAP-style default keypad controls from [Kopher](https://code.luxferre.top/luxferre/kopher.git), user-adjustable keybindings (`~/.config/sxmo/smallweb_controls.tsv`), 10 bookmarks, custom homepage support, and link focus that always scrolls the viewport to the focused link in both wrapped and unwrapped modes.
|
||||||
- **Webarchy Web browser (`webarchy` / `xwebarchy` / `webarchy.so`)**: full-featured HTML5/CSS3/JS web browser built on WPE / WebKit (`webkit2gtk-4.1` + `libwpe-1.0`) with Adreno 304 hardware acceleration (`WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS`, WebGL, accelerated 2D canvas, and 512 MB RAM pressure tuning), default KaiOS 4.0 User-Agent (`Mozilla/5.0 (Mobile; rv:123.0) Gecko/123.0 Firefox/123.0 KAIOS/4.0`) with preset and custom User-Agent override (`~/.config/sxmo/webarchy_ua.txt`), `UTF-8` default encoding fallback, `Noto Sans` / `Noto Serif` (`font-noto` + `font-noto-emoji`) as the default non-monospace browser fonts and `Fira Code` with OpenType ligatures as the monospace font, full GStreamer multimedia (`MediaSource` / MSE, WebAudio, inline HTML5 `<video>`/`<audio>` autoplay without user gesture requirements), unobtrusive bookmarking (`*HTTPS`/`*HTTP` header badge, `*`+`0-9` save / `#`+`0-9` load chords, and bookmark manager), and dual navigation modes (keypad link-stepping mode with NeoUI multi-tap form input by default, plus an optional `*#` accelerated mouse cursor emulation mode), and a device-aware renderer profile: the 2720 Flip uses the WebKit CPU renderer (with automatic software fallback after a WebProcess crash) while the 8110 4G keeps Adreno 304 acceleration; `~/.config/sxmo/webarchy_software_renderer` forces the CPU profile on any target. The image build also compiles the installed GSettings schema XML into `usr/share/glib-2.0/schemas/gschemas.compiled`; without that database WebKit's network process aborts with an internal error before any renderer policy can help.
|
- **Webarchy Web browser (`webarchy` / `xwebarchy` / `webarchy.so`)**: full-featured HTML5/CSS3/JS web browser built on WPE / WebKit (`webkit2gtk-4.1` + `libwpe-1.0`) with Adreno 304 hardware acceleration (`WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS`, WebGL, accelerated 2D canvas, and 512 MB RAM pressure tuning), default KaiOS 4.0 User-Agent (`Mozilla/5.0 (Mobile; rv:123.0) Gecko/123.0 Firefox/123.0 KAIOS/4.0`) with preset and custom User-Agent override (`~/.config/sxmo/webarchy_ua.txt`), `UTF-8` default encoding fallback, `Noto Sans` / `Noto Serif` (`font-noto` + `font-noto-emoji`) as the default non-monospace browser fonts and `Fira Code` with OpenType ligatures as the monospace font, full GStreamer multimedia (`MediaSource` / MSE, WebAudio, inline HTML5 `<video>`/`<audio>` autoplay without user gesture requirements), unobtrusive bookmarking (`*HTTPS`/`*HTTP` header badge, `*`+`0-9` save / `#`+`0-9` load chords, and bookmark manager), and dual navigation modes (keypad link-stepping mode with NeoUI multi-tap form input by default, plus an optional `*#` accelerated mouse cursor emulation mode), and a device-aware renderer profile: the 2720 Flip uses the WebKit CPU renderer (with automatic software fallback after a WebProcess crash) while the 8110 4G keeps Adreno 304 acceleration; `~/.config/sxmo/webarchy_software_renderer` forces the CPU profile on any target. The image build also compiles the installed GSettings schema XML into `usr/share/glib-2.0/schemas/gschemas.compiled`; without that database WebKit's network process aborts with an internal error before any renderer policy can help.
|
||||||
- **GPS-only system time**: **Config -> Time source** switches from NTP to GNSS only (stopping `chronyd` and disabling every network-up NTP burst) and **Config -> Sync GPS time** steps the clock from a ModemManager GPS UTC value or a valid RMC fix, writes the RTC and refreshes the status bar. All GPS queries now resolve the GNSS-capable modem through `bananarchy-gps-modem.sh` instead of the ambiguous `mmcli -m any`, which fixes empty GPS data on the dual-SIM 2720 Flip. See `MANUAL.md` sections 5.6 and 5.8.
|
- **GPS-only system time and live timezone sync**: **Config -> Time source** switches from NTP to GNSS only (stopping `chronyd` and disabling every network-up NTP burst) and **Config -> Sync GPS time** steps the clock from a ModemManager GPS UTC value or a valid RMC fix, writes the RTC and refreshes the status bar. All GPS queries now resolve the GNSS-capable modem through `bananarchy-gps-modem.sh` instead of the ambiguous `mmcli -m any`, which fixes empty GPS data on the dual-SIM 2720 Flip. Network-up `chronyd` bursts wait for sync completion (`bananarchy-time-sync.sh`) and live timezone changes (`setup-timezone` / `dmenu`) immediately refresh `099-time`, `bananarchy-run-aligned` (`SIGUSR1`), `locker.so` (`REFRESH_TIME`), and `bananarchy-cover-idle` (`ba_refresh_tz`) without rebooting. See `MANUAL.md` sections 5.6 and 5.8.
|
||||||
- **2720 Flip cover display behaviour**: the compiled `bananarchy-cover-idle` renderer keeps the external panel fully off while the flip is open, waits for a side-button `BUTTON` event when closed, then shows the centered `240x240` clock, date, battery and compact network indicators until the same **Config -> Screen blank** timeout (`~/.config/sxmo/idle_blank_timeout` and `sxmo.noidle`, reloaded live) expires. `bananarchy-volume-keys` turns the outer keys into trusted cover wake events; `bananarchy-lid` mirrors the hall sensor onto `SW_LID` so `dwm` tracks the closed state accurately; `bananarchy-cover-status.sh` publishes modem/Wi-Fi indicators; and the daemon blocks in `poll()` with no timer while off. The shipping single-panel DTB drives the cover through the **kernel** `panel-mipi-dbi-spi` driver (`backend = kernel`). The KaiOS 3.10 DTS and kernel driver show that both GC9305s share CS0, gpio110 D/C and one active-high PMIC MPP2 PWM backlight (`kernel_backlight_invert = 0`, `kernel_backlight_level = 14`), while gpio13 selects the panel (high = cover, low = internal), gpio23 is the external reset and gpio21 is TE. Because the internal `240x320` TN panel is normally-white while the external `240x240` panel is normally-black, waking the cover first paints Xorg's `override_redirect` cover window and `/dev/fb0` solid black while gpio13 is low and leaves the internal GC9305 scanning black GRAM (`kernel_internal_sleep = 0`) so it stays completely dark when the shared backlight turns on; the daemon then switches gpio13 high, pulses gpio23, replays the stock 240x240 init through `/sys/kernel/debug/dri/0/command`, and presents the centered `240x240` UI once per second. `/run/bananarchy/cover-backlight` contains `0` during dark GRAM preparation, `1` while the cover is lit, and is removed when blanked so DPMS Off powers down the panel rails; `bananarchy-display-power-sync` keeps brightness, `bl_power` and DPMS synchronized while the keypad stays dark. Opening the flip sleeps the external panel, restores gpio13 low, brightness 14, `bl_power=0`, DPMS On and wakes to the passcode lockscreen. `bananarchy-lid-gate.sh` blocks every main-panel wake while closed and forwards it as a cover `WAKE`. The legacy `spidev`, 8/9-bit, `PROBE` and `SET backend none` rollback paths remain, along with `SET kernel_backlight_invert 0|1` and `SET kernel_internal_sleep 0|1`. `bananarchy-cover-diagnose.sh` reports the debugfs hook, backlight marker, GPIO lines and daemon state; `scripts/test-cover-idle.py`, `scripts/test-cover-spidev.py`, `scripts/test-cover-kernel.py`, `scripts/test-cover-dt.py` and `scripts/test-lid-gate.py` validate the renderer, both backends, DT layouts and lid gate on the host. The opt-in two-panel `spi-mux` DT remains experimental because its separate gpio21 D/C wiring contradicts the vendor DTS and a live test darkened the main panel.
|
- **2720 Flip cover display behaviour**: the compiled `bananarchy-cover-idle` renderer keeps the external panel fully off while the flip is open, waits for a side-button `BUTTON`, `WAKE`, or incoming `CALL` event when closed, then shows the centered `240x240` clock, date, battery and compact network indicators until the same **Config -> Screen blank** timeout (`~/.config/sxmo/idle_blank_timeout` and `sxmo.noidle`, reloaded live) expires. During an incoming call while closed, the cover wakes automatically and stays lit past the blank timeout displaying the caller's number/contact and SIM tag; pressing outer **Volume Up/Down** mutes the ringer (`mute-ring`) and pressing the external **Power**/camera button hangs up without opening the flip (`hangup-call`), while opening the flip keeps the lock flag set and raises `callscreen` on top of the locked desktop without hanging up the call (`sxmo_hook_lock.sh` / `locker.so`). `bananarchy-volume-keys` turns the outer keys into trusted cover wake and call-control events; `bananarchy-lid` mirrors the hall sensor onto `SW_LID` so `dwm` tracks the closed state accurately and raises active/incoming `callscreen` windows on open; `bananarchy-cover-status.sh` publishes modem/Wi-Fi indicators; and the daemon blocks in `poll()` with no timer while off. The shipping single-panel DTB drives the cover through the **kernel** `panel-mipi-dbi-spi` driver (`backend = kernel`). The KaiOS 3.10 DTS and kernel driver show that both GC9305s share CS0, gpio110 D/C and one active-high PMIC MPP2 PWM backlight (`kernel_backlight_invert = 0`, `kernel_backlight_level = 14`), while gpio13 selects the panel (high = cover, low = internal), gpio23 is the external reset and gpio21 is TE. Because the internal `240x320` TN panel is normally-white while the external `240x240` panel is normally-black, waking the cover first paints Xorg's `override_redirect` cover window and `/dev/fb0` solid black while gpio13 is low and leaves the internal GC9305 scanning black GRAM (`kernel_internal_sleep = 0`) so it stays completely dark when the shared backlight turns on; the daemon then switches gpio13 high, pulses gpio23, replays the stock 240x240 init through `/sys/kernel/debug/dri/0/command`, and presents the centered `240x240` UI once per second. `/run/bananarchy/cover-backlight` contains `0` during dark GRAM preparation, `1` while the cover is lit, and is removed when blanked (`BLANK` or `SIGTERM`) so DPMS Off powers down the panel rails; `bananarchy-display-power-sync` keeps brightness, `bl_power` and DPMS synchronized while the keypad stays dark. Opening the flip sleeps the external panel, restores gpio13 low, brightness 14, `bl_power=0`, DPMS On and wakes to the passcode lockscreen (or `callscreen` over the lockscreen during an incoming/active call). `bananarchy-lid-gate.sh` blocks every main-panel wake while closed and forwards it as a cover `WAKE`. The legacy `spidev`, 8/9-bit, `PROBE` and `SET backend none` rollback paths remain, along with `SET kernel_backlight_invert 0|1` and `SET kernel_internal_sleep 0|1`. `bananarchy-cover-diagnose.sh` reports the debugfs hook, backlight marker, GPIO lines and daemon state; `scripts/test-cover-idle.py`, `scripts/test-cover-spidev.py`, `scripts/test-cover-kernel.py`, `scripts/test-cover-dt.py`, `scripts/test-lid-gate.py` and `scripts/test-time-timezone-sync.py` validate the renderer, both backends, DT layouts, lid gate and time/timezone sync on the host. The opt-in two-panel `spi-mux` DT remains experimental because its separate gpio21 D/C wiring contradicts the vendor DTS and a live test darkened the main panel.
|
||||||
|
|
||||||
- **GPS reception test utility (`bananarchy-gps`) and OpenStreetMap navigator (`xgps` / `xmaps` / `xnav` / `gps.so`)**: CLI GNSS/GPS diagnostic tool (`bananarchy-gps status|enable|disable|nmea|watch`) and 3-tab NeoUI GPS navigator (`1:GPS Status`, `2:OSM Map`, `3:Nav/Search`) with live NMEA/QMI PDS satellite and 3GPP cell telemetry, interactive `240x212` OpenStreetMap slippy-map tile viewer with offline PNG tile cache (`~/.cache/sxmo/osm_tiles/`), Nominatim place search, saved waypoints, and OSRM turn-by-turn route geometry and step navigation.
|
- **GPS reception test utility (`bananarchy-gps`) and OpenStreetMap navigator (`xgps` / `xmaps` / `xnav` / `gps.so`)**: CLI GNSS/GPS diagnostic tool (`bananarchy-gps status|enable|disable|nmea|watch`) and 3-tab NeoUI GPS navigator (`1:GPS Status`, `2:OSM Map`, `3:Nav/Search`) with live NMEA/QMI PDS satellite and 3GPP cell telemetry, interactive `240x212` OpenStreetMap slippy-map tile viewer with offline PNG tile cache (`~/.cache/sxmo/osm_tiles/`), Nominatim place search, saved waypoints, and OSRM turn-by-turn route geometry and step navigation.
|
||||||
- **Themes (`xthemes`), wallpapers (`xwallpapers`), and ringtones (`xringtones`)**: installable `.Xresources` color and font themes (`~/.xthemes/*.xth`, 21 preinstalled schemes including `LynxLair.xth`) with live zero-restart reload across the entire UI, `dunst` notification popups (`bananarchy-sync-dunst-theme`), and terminal, alongside dedicated managers for desktop wallpapers and 3-tab call ringtones & notification/SMS alerts (`1:Ringtone`, `2:Notif/SMS`, `3:Settings`, supporting standard audio, tracker modules, and Nokia RTTTL `.nrt`/`.rtttl`/`.rtx`, Ericsson eMelody `.emy`, and IrDA iMelody `.imy` monophonic ringtones via `/usr/bin/bananarchy-melody`, wired into `sxmo_notifs.sh` and `sxmo_hook_notification.sh`) with 3-level vibration control.
|
- **Themes (`xthemes`), wallpapers (`xwallpapers`), and ringtones (`xringtones`)**: installable `.Xresources` color and font themes (`~/.xthemes/*.xth`, 21 preinstalled schemes including `LynxLair.xth`) with live zero-restart reload across the entire UI, `dunst` notification popups (`bananarchy-sync-dunst-theme`), and terminal, alongside dedicated managers for desktop wallpapers and 3-tab call ringtones & notification/SMS alerts (`1:Ringtone`, `2:Notif/SMS`, `3:Settings`, supporting standard audio, tracker modules, and Nokia RTTTL `.nrt`/`.rtttl`/`.rtx`, Ericsson eMelody `.emy`, and IrDA iMelody `.imy` monophonic ringtones via `/usr/bin/bananarchy-melody`, wired into `sxmo_notifs.sh` and `sxmo_hook_notification.sh`) with 3-level vibration control.
|
||||||
|
|||||||
@@ -8,11 +8,11 @@
|
|||||||
# a wcn36xx module reload.
|
# a wcn36xx module reload.
|
||||||
WIFI_LISTEN_INTERVAL=5
|
WIFI_LISTEN_INTERVAL=5
|
||||||
|
|
||||||
# Qualcomm modem DRX mode via AT$QCDRX (0, 6-9). 0 = firmware default, no
|
# Qualcomm modem DRX mode via AT$QCDRX (0, 6-9). 0 = firmware DSDS paging
|
||||||
# policy. 6 = standard low-power paging cycle across active AT channels
|
# default (avoids competing with ModemManager on open /dev/wwan0at* ports).
|
||||||
# (~1.28 s DRX) while keeping both DSDS SIMs reachable. Values above 6 are
|
# 6-9 remain opt-in for manual testing; values above 6 are undocumented on this
|
||||||
# undocumented on this firmware; 9 made the AT channel briefly unresponsive.
|
# firmware and may make the AT channel unresponsive.
|
||||||
MODEM_DRX_MODE=6
|
MODEM_DRX_MODE=0
|
||||||
|
|
||||||
# Secondary SIM (DSDS) policy while the panel is dark:
|
# Secondary SIM (DSDS) policy while the panel is dark:
|
||||||
# active = keep both subscriptions provisioned (default)
|
# active = keep both subscriptions provisioned (default)
|
||||||
@@ -24,11 +24,14 @@ DSDS_SECONDARY_MODE=active
|
|||||||
DSDS_PARK_DELAY=300
|
DSDS_PARK_DELAY=300
|
||||||
|
|
||||||
# Last-man APSS RPM/vMPM sleep handoff in cpuidle_qcom_spm (1 = enable).
|
# Last-man APSS RPM/vMPM sleep handoff in cpuidle_qcom_spm (1 = enable).
|
||||||
# Lets the fourth/last idle CPU signal RPM so XO/DDR/MX/CX can enter sleep.
|
# Keep 0 by default: per-core SPC with L2 retention stays active (< 0.2 ms
|
||||||
CPU_RPM_SLEEP=1
|
# wakeup on all GIC SPIs), whereas runtime L2_OFF/vMPM without CONFIG_SUSPEND
|
||||||
|
# collapses APSS GIC and drops internal smd-edge modem wakeups.
|
||||||
|
CPU_RPM_SLEEP=0
|
||||||
|
|
||||||
# Last-man L2 SAW2 retention / HSFS_OPEN state in cpuidle_qcom_spm (1 = enable).
|
# Last-man L2 SAW2 retention / HSFS_OPEN state in cpuidle_qcom_spm (1 = enable).
|
||||||
CPU_L2_SLEEP=1
|
# Keep 0 by default alongside CPU_RPM_SLEEP=0 so APSS GIC stays awake.
|
||||||
|
CPU_L2_SLEEP=0
|
||||||
|
|
||||||
# Mute unsolicited IPv6 router advertisements on wlan0 while the screen is off
|
# Mute unsolicited IPv6 router advertisements on wlan0 while the screen is off
|
||||||
# when wlan0 already holds an IPv4 address (1 = enable, restored on wake).
|
# when wlan0 already holds an IPv4 address (1 = enable, restored on wake).
|
||||||
|
|||||||
@@ -1,31 +1,164 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Bridge Sxmo hooks to the cover display daemon. Safe no-op on non-flip
|
# Bridge Sxmo hooks and cover button call controls to bananarchy-cover-idle.
|
||||||
# devices and when the daemon is not running.
|
# Safe no-op on non-flip devices and when the daemon is not running.
|
||||||
set -u
|
set -u
|
||||||
EVENT="${1:-refresh}"
|
EVENT="${1:-refresh}"
|
||||||
shift 2>/dev/null || true
|
shift 2>/dev/null || true
|
||||||
[ "$(cat /usr/share/bananarchy/lid-profile 2>/dev/null)" = "flip" ] || exit 0
|
|
||||||
|
LID_PROFILE_FILE="${BANANARCHY_LID_PROFILE_FILE:-/usr/share/bananarchy/lid-profile}"
|
||||||
|
COVERCTL_BIN="${BANANARCHY_COVERCTL_BIN:-/usr/bin/bananarchy-coverctl}"
|
||||||
|
CALLSCREEN_FIFO="${BANANARCHY_CALLSCREEN_FIFO:-/tmp/dwm_plugin_callscreen.fifo}"
|
||||||
|
RING_FILE="${BANANARCHY_RINGING_FILE:-/tmp/sxmo_call_ringing}"
|
||||||
|
ACTIVE_CALL_FILE="${BANANARCHY_ACTIVE_CALL_FILE:-/tmp/sxmo_active_call}"
|
||||||
|
|
||||||
|
[ "$(cat "$LID_PROFILE_FILE" 2>/dev/null || true)" = "flip" ] || exit 0
|
||||||
|
|
||||||
|
coverctl() {
|
||||||
|
"$COVERCTL_BIN" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
clean_field() {
|
||||||
|
printf '%s' "${1:-}" | tr '|\r\n' ' ' | sed 's/^ *//; s/ *$//'
|
||||||
|
}
|
||||||
|
|
||||||
|
is_phone_number() {
|
||||||
|
[ -n "${1:-}" ] || return 1
|
||||||
|
printf '%s\n' "$1" | grep -q '^[+0-9*#(). -]*$' && \
|
||||||
|
printf '%s\n' "$1" | grep -q '[0-9]'
|
||||||
|
}
|
||||||
|
|
||||||
|
lookup_contact_name() {
|
||||||
|
raw="$(clean_field "${1:-}")"
|
||||||
|
digits="$(printf '%s' "$raw" | tr -cd '0-9')"
|
||||||
|
[ "${#digits}" -ge 7 ] || return 0
|
||||||
|
cfile="${SXMO_CONTACTFILE:-/home/user/.config/sxmo/contacts.tsv}"
|
||||||
|
[ -r "$cfile" ] || return 0
|
||||||
|
sfx="${digits#"${digits%???????}"}"
|
||||||
|
awk -F '\t' -v d="$digits" -v s="$sfx" '
|
||||||
|
NF >= 2 {
|
||||||
|
c1 = $1
|
||||||
|
gsub(/[^0-9]/, "", c1)
|
||||||
|
name = $2
|
||||||
|
sub(/\r$/, "", name)
|
||||||
|
if (length(c1) >= 7) {
|
||||||
|
c1_sfx = substr(c1, length(c1) - 6)
|
||||||
|
if (c1 == d || c1_sfx == s) {
|
||||||
|
print name
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
' "$cfile" 2>/dev/null || true
|
||||||
|
}
|
||||||
|
|
||||||
|
send_callscreen_fifo() {
|
||||||
|
cmd="${1:-}"
|
||||||
|
[ -n "$cmd" ] || return 0
|
||||||
|
if [ -p "$CALLSCREEN_FIFO" ]; then
|
||||||
|
timeout 1 sh -c 'printf "%s\n" "$1" > "$2"' _ "$cmd" "$CALLSCREEN_FIFO" >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
stop_ring_audio() {
|
||||||
|
killall -q -TERM bananarchy-melody sxmo_vibrate pw-play mpv 2>/dev/null || true
|
||||||
|
rpids="$(pgrep -f '[s]xmo_hook_ring\.sh|[p]w-play.*ring|[m]pv.*ring' 2>/dev/null || true)"
|
||||||
|
[ -n "$rpids" ] && kill -TERM $rpids 2>/dev/null || true
|
||||||
|
}
|
||||||
|
|
||||||
|
run_user_cmd() {
|
||||||
|
ucmd="$1"
|
||||||
|
if [ -n "${BANANARCHY_COVER_TEST_USER_SH:-}" ]; then
|
||||||
|
sh -c "$ucmd" >/dev/null 2>&1 || true
|
||||||
|
elif [ "$(id -u)" -eq 0 ]; then
|
||||||
|
su -s /bin/sh user -c "export HOME=/home/user XDG_RUNTIME_DIR=/run/user/10000 XDG_CONFIG_HOME=/home/user/.config DISPLAY=:0 SXMO_STATE=/run/user/10000/sxmo.state PATH=/home/user/.config/sxmo/hooks:/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin; $ucmd" </dev/null >/dev/null 2>&1 || true
|
||||||
|
else
|
||||||
|
sh -c "$ucmd" </dev/null >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
case "$EVENT" in
|
case "$EVENT" in
|
||||||
notification)
|
notification)
|
||||||
/usr/bin/bananarchy-coverctl NOTIFY "Notification" >/dev/null 2>&1 || true
|
coverctl NOTIFY "Notification" >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
ring)
|
ring)
|
||||||
/usr/bin/bananarchy-coverctl CALL incoming "${1:--}" "-" >/dev/null 2>&1 || true
|
arg1="$(clean_field "${1:-}")"
|
||||||
|
sim="$(clean_field "${2:-}")"
|
||||||
|
case "$arg1" in
|
||||||
|
"[SIM1] "*|"[SIM1]")
|
||||||
|
[ -z "$sim" ] && sim="SIM1"
|
||||||
|
arg1="$(clean_field "${arg1#"[SIM1]"}")"
|
||||||
|
;;
|
||||||
|
"[SIM2] "*|"[SIM2]")
|
||||||
|
[ -z "$sim" ] && sim="SIM2"
|
||||||
|
arg1="$(clean_field "${arg1#"[SIM2]"}")"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
num="-"
|
||||||
|
name="-"
|
||||||
|
if [ -n "$arg1" ] && [ "$arg1" != "-" ]; then
|
||||||
|
if is_phone_number "$arg1"; then
|
||||||
|
num="$arg1"
|
||||||
|
resolved="$(clean_field "$(lookup_contact_name "$num")")"
|
||||||
|
[ -n "$resolved" ] && name="$resolved"
|
||||||
|
else
|
||||||
|
name="$arg1"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
[ -n "$sim" ] || sim="-"
|
||||||
|
coverctl CALL "incoming|${num}|${name}|${sim}" >/dev/null 2>&1 || true
|
||||||
|
;;
|
||||||
|
muted)
|
||||||
|
num="$(clean_field "${1:--}")"
|
||||||
|
name="$(clean_field "${2:--}")"
|
||||||
|
sim="$(clean_field "${3:--}")"
|
||||||
|
[ -n "$num" ] || num="-"
|
||||||
|
[ -n "$name" ] || name="-"
|
||||||
|
[ -n "$sim" ] || sim="-"
|
||||||
|
coverctl CALL "muted|${num}|${name}|${sim}" >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
missed)
|
missed)
|
||||||
/usr/bin/bananarchy-coverctl CALL missed "${1:--}" "-" >/dev/null 2>&1 || true
|
who="$(clean_field "${1:--}")"
|
||||||
|
[ -n "$who" ] || who="-"
|
||||||
|
coverctl CALL "missed|${who}|-|-" >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
call|active)
|
call|active)
|
||||||
/usr/bin/bananarchy-coverctl CALL active "${1:--}" "-" >/dev/null 2>&1 || true
|
num="$(clean_field "${1:--}")"
|
||||||
|
name="$(clean_field "${2:--}")"
|
||||||
|
sim="$(clean_field "${3:--}")"
|
||||||
|
[ -n "$num" ] || num="-"
|
||||||
|
[ -n "$name" ] || name="-"
|
||||||
|
[ -n "$sim" ] || sim="-"
|
||||||
|
coverctl CALL "active|${num}|${name}|${sim}" >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
hangup|ended)
|
hangup|ended)
|
||||||
/usr/bin/bananarchy-coverctl CALL none "-" "-" >/dev/null 2>&1 || true
|
coverctl CALL "none|-|-|-" >/dev/null 2>&1 || true
|
||||||
|
;;
|
||||||
|
mute-ring)
|
||||||
|
stop_ring_audio
|
||||||
|
for f in /run/user/10000/sxmo_calls/*.monitoredcall /run/user/10000/sxmo_calls/*.ringing-in; do
|
||||||
|
[ -e "$f" ] || continue
|
||||||
|
touch "${f%.*}.mutedring" 2>/dev/null || true
|
||||||
|
done
|
||||||
|
send_callscreen_fifo "MUTE_RING"
|
||||||
|
run_user_cmd "sxmo_jobs.sh stop ringing >/dev/null 2>&1 || true; sxmo_hook_mute_ring.sh >/dev/null 2>&1 || true"
|
||||||
|
;;
|
||||||
|
hangup-call)
|
||||||
|
rm -f "$RING_FILE" "$ACTIVE_CALL_FILE" 2>/dev/null || true
|
||||||
|
stop_ring_audio
|
||||||
|
send_callscreen_fifo "HANGUP_CLOSE"
|
||||||
|
if [ -x /usr/libexec/msm-modem-uim-selection ]; then
|
||||||
|
timeout 2 /usr/libexec/msm-modem-uim-selection call-hangup all >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
if command -v mmcli >/dev/null 2>&1; then
|
||||||
|
timeout 2 mmcli -m any --voice-hangup-all >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
run_user_cmd "sxmo_modemcall.sh hangup all >/dev/null 2>&1 || true; sxmo_hook_discard.sh >/dev/null 2>&1 || true"
|
||||||
;;
|
;;
|
||||||
sms)
|
sms)
|
||||||
/usr/bin/bananarchy-coverctl SMS "${1:-1}" >/dev/null 2>&1 || true
|
coverctl SMS "${1:-1}" >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
screenoff)
|
screenoff)
|
||||||
/usr/bin/bananarchy-coverctl REFRESH >/dev/null 2>&1 || true
|
coverctl REFRESH >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
network)
|
network)
|
||||||
/usr/bin/bananarchy-cover-status.sh >/dev/null 2>&1 || true
|
/usr/bin/bananarchy-cover-status.sh >/dev/null 2>&1 || true
|
||||||
@@ -33,17 +166,17 @@ case "$EVENT" in
|
|||||||
button)
|
button)
|
||||||
# Trusted external side-button wake (also sent directly by
|
# Trusted external side-button wake (also sent directly by
|
||||||
# bananarchy-volume-keys when the flip is closed).
|
# bananarchy-volume-keys when the flip is closed).
|
||||||
/usr/bin/bananarchy-coverctl BUTTON >/dev/null 2>&1 || true
|
coverctl BUTTON >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
wake)
|
wake)
|
||||||
# Every blocked main-panel wake request is forwarded here by the lid gate.
|
# Every blocked main-panel wake request is forwarded here by the lid gate.
|
||||||
/usr/bin/bananarchy-coverctl WAKE >/dev/null 2>&1 || true
|
coverctl WAKE >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
refresh|theme)
|
refresh|theme)
|
||||||
/usr/bin/bananarchy-coverctl RELOAD_THEME >/dev/null 2>&1 || true
|
coverctl RELOAD_THEME >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
/usr/bin/bananarchy-coverctl REFRESH >/dev/null 2>&1 || true
|
coverctl REFRESH >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
exit 0
|
exit 0
|
||||||
Binary file not shown.
@@ -17,6 +17,7 @@ RL_PATH=/sys/devices/system/cpu/cpufreq/schedutil/rate_limit_us
|
|||||||
GPU_GOV_PATH=/sys/class/devfreq/1c00000.gpu/governor
|
GPU_GOV_PATH=/sys/class/devfreq/1c00000.gpu/governor
|
||||||
WIFI_OFFLOAD_PATH=/sys/module/wcn36xx/parameters/screen_off_offload
|
WIFI_OFFLOAD_PATH=/sys/module/wcn36xx/parameters/screen_off_offload
|
||||||
SPM_SCREEN_OFF_PATH=/sys/module/cpuidle_qcom_spm/parameters/screen_off
|
SPM_SCREEN_OFF_PATH=/sys/module/cpuidle_qcom_spm/parameters/screen_off
|
||||||
|
SPM_RPM_SLEEP_PATH=/sys/module/cpuidle_qcom_spm/parameters/rpm_sleep
|
||||||
COVER_MARKER=/run/bananarchy/cover-backlight
|
COVER_MARKER=/run/bananarchy/cover-backlight
|
||||||
FORCE_MARKER=/run/bananarchy/cover-bl-force
|
FORCE_MARKER=/run/bananarchy/cover-bl-force
|
||||||
STATE_CACHE=/run/bananarchy/cover-power-state
|
STATE_CACHE=/run/bananarchy/cover-power-state
|
||||||
@@ -49,6 +50,20 @@ for _dpms in /sys/class/drm/card*-*/dpms; do
|
|||||||
[ -r "$_dpms" ] && DPMS_PATH="$_dpms" && break
|
[ -r "$_dpms" ] && DPMS_PATH="$_dpms" && break
|
||||||
done
|
done
|
||||||
|
|
||||||
|
[ -n "${BANANARCHY_BR_PATH:-}" ] && BR_PATH="$BANANARCHY_BR_PATH"
|
||||||
|
[ -n "${BANANARCHY_BL_POWER_PATH:-}" ] && BL_POWER_PATH="$BANANARCHY_BL_POWER_PATH"
|
||||||
|
[ -n "${BANANARCHY_KBD_PATH:-}" ] && KBD_PATH="$BANANARCHY_KBD_PATH"
|
||||||
|
[ -n "${BANANARCHY_RL_PATH:-}" ] && RL_PATH="$BANANARCHY_RL_PATH"
|
||||||
|
[ -n "${BANANARCHY_GPU_GOV_PATH:-}" ] && GPU_GOV_PATH="$BANANARCHY_GPU_GOV_PATH"
|
||||||
|
[ -n "${BANANARCHY_WIFI_OFFLOAD_PATH:-}" ] && WIFI_OFFLOAD_PATH="$BANANARCHY_WIFI_OFFLOAD_PATH"
|
||||||
|
[ -n "${BANANARCHY_SPM_SCREEN_OFF_PATH:-}" ] && SPM_SCREEN_OFF_PATH="$BANANARCHY_SPM_SCREEN_OFF_PATH"
|
||||||
|
[ -n "${BANANARCHY_SPM_RPM_SLEEP_PATH:-}" ] && SPM_RPM_SLEEP_PATH="$BANANARCHY_SPM_RPM_SLEEP_PATH"
|
||||||
|
[ -n "${BANANARCHY_LID_STATE:-}" ] && LID_STATE="$BANANARCHY_LID_STATE"
|
||||||
|
[ -n "${BANANARCHY_COVER_MARKER:-}" ] && COVER_MARKER="$BANANARCHY_COVER_MARKER"
|
||||||
|
[ -n "${BANANARCHY_FORCE_MARKER:-}" ] && FORCE_MARKER="$BANANARCHY_FORCE_MARKER"
|
||||||
|
[ -n "${BANANARCHY_STATE_CACHE:-}" ] && STATE_CACHE="$BANANARCHY_STATE_CACHE"
|
||||||
|
[ -n "${BANANARCHY_DPMS_PATH:-}" ] && DPMS_PATH="$BANANARCHY_DPMS_PATH"
|
||||||
|
|
||||||
read_value() {
|
read_value() {
|
||||||
_path="$1"
|
_path="$1"
|
||||||
_value=""
|
_value=""
|
||||||
@@ -73,6 +88,16 @@ sync_schedutil_rate_limit() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sync_spm_screen_off() {
|
||||||
|
_want="$1"
|
||||||
|
[ -w "$SPM_SCREEN_OFF_PATH" ] || return 0
|
||||||
|
if [ "$_want" = "Y" ] && [ "$(read_value "$SPM_RPM_SLEEP_PATH")" = "Y" ]; then
|
||||||
|
set_if_changed "$SPM_SCREEN_OFF_PATH" "Y"
|
||||||
|
else
|
||||||
|
set_if_changed "$SPM_SCREEN_OFF_PATH" "N"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
cleanup_force() {
|
cleanup_force() {
|
||||||
rm -f "$FORCE_MARKER" 2>/dev/null || true
|
rm -f "$FORCE_MARKER" 2>/dev/null || true
|
||||||
}
|
}
|
||||||
@@ -95,9 +120,9 @@ if [ "$(read_value "$LID_PROFILE")" != "flip" ]; then
|
|||||||
[ -w "$GPU_GOV_PATH" ] && set_if_changed "$GPU_GOV_PATH" "powersave"
|
[ -w "$GPU_GOV_PATH" ] && set_if_changed "$GPU_GOV_PATH" "powersave"
|
||||||
[ -w "$WIFI_OFFLOAD_PATH" ] && set_if_changed "$WIFI_OFFLOAD_PATH" "Y"
|
[ -w "$WIFI_OFFLOAD_PATH" ] && set_if_changed "$WIFI_OFFLOAD_PATH" "Y"
|
||||||
force_dpms "Off"
|
force_dpms "Off"
|
||||||
[ -w "$SPM_SCREEN_OFF_PATH" ] && set_if_changed "$SPM_SCREEN_OFF_PATH" "Y"
|
sync_spm_screen_off "Y"
|
||||||
else
|
else
|
||||||
[ -w "$SPM_SCREEN_OFF_PATH" ] && set_if_changed "$SPM_SCREEN_OFF_PATH" "N"
|
sync_spm_screen_off "N"
|
||||||
[ -w "$GPU_GOV_PATH" ] && set_if_changed "$GPU_GOV_PATH" "simple_ondemand"
|
[ -w "$GPU_GOV_PATH" ] && set_if_changed "$GPU_GOV_PATH" "simple_ondemand"
|
||||||
[ -w "$WIFI_OFFLOAD_PATH" ] && set_if_changed "$WIFI_OFFLOAD_PATH" "N"
|
[ -w "$WIFI_OFFLOAD_PATH" ] && set_if_changed "$WIFI_OFFLOAD_PATH" "N"
|
||||||
force_dpms "On"
|
force_dpms "On"
|
||||||
@@ -202,11 +227,11 @@ else
|
|||||||
[ -w "$WIFI_OFFLOAD_PATH" ] && set_if_changed "$WIFI_OFFLOAD_PATH" "N"
|
[ -w "$WIFI_OFFLOAD_PATH" ] && set_if_changed "$WIFI_OFFLOAD_PATH" "N"
|
||||||
fi
|
fi
|
||||||
if [ "$DESIRED_DPMS" != "Off" ]; then
|
if [ "$DESIRED_DPMS" != "Off" ]; then
|
||||||
[ -w "$SPM_SCREEN_OFF_PATH" ] && set_if_changed "$SPM_SCREEN_OFF_PATH" "N"
|
sync_spm_screen_off "N"
|
||||||
fi
|
fi
|
||||||
force_dpms "$DESIRED_DPMS"
|
force_dpms "$DESIRED_DPMS"
|
||||||
if [ "$DESIRED_DPMS" = "Off" ]; then
|
if [ "$DESIRED_DPMS" = "Off" ]; then
|
||||||
[ -w "$SPM_SCREEN_OFF_PATH" ] && set_if_changed "$SPM_SCREEN_OFF_PATH" "Y"
|
sync_spm_screen_off "Y"
|
||||||
fi
|
fi
|
||||||
sync_schedutil_rate_limit "40000"
|
sync_schedutil_rate_limit "40000"
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -39,6 +39,13 @@ refresh_statusbar() {
|
|||||||
PATH=/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin \
|
PATH=/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin \
|
||||||
sxmo_hook_statusbar.sh refresh
|
sxmo_hook_statusbar.sh refresh
|
||||||
' >/dev/null 2>&1 || true
|
' >/dev/null 2>&1 || true
|
||||||
|
locker_fifo="${BANANARCHY_LOCKER_FIFO:-/tmp/dwm_plugin_locker.fifo}"
|
||||||
|
if [ -p "$locker_fifo" ] || [ -f "$locker_fifo" ]; then
|
||||||
|
timeout 1 sh -c 'printf "REFRESH_TIME\n" > "$1"' _ "$locker_fifo" >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
coverctl="${BANANARCHY_COVERCTL:-/usr/bin/bananarchy-coverctl}"
|
||||||
|
"$coverctl" REFRESH >/dev/null 2>&1 || true
|
||||||
|
killall -q -USR1 bananarchy-run-aligned >/dev/null 2>&1 || true
|
||||||
}
|
}
|
||||||
|
|
||||||
# Stop chronyd while GPS is the only time source; start it again for NTP.
|
# Stop chronyd while GPS is the only time source; start it again for NTP.
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ MAX_DELAY=3600
|
|||||||
LOCK_FLAG="${BANANARCHY_LOCK_FLAG:-/tmp/bananarchy_screen_locked}"
|
LOCK_FLAG="${BANANARCHY_LOCK_FLAG:-/tmp/bananarchy_screen_locked}"
|
||||||
STATE_CMD="${BANANARCHY_STATE_CMD:-/usr/bin/sxmo_state.sh}"
|
STATE_CMD="${BANANARCHY_STATE_CMD:-/usr/bin/sxmo_state.sh}"
|
||||||
WM_CMD="${BANANARCHY_WM_CMD:-/usr/bin/sxmo_wm.sh}"
|
WM_CMD="${BANANARCHY_WM_CMD:-/usr/bin/sxmo_wm.sh}"
|
||||||
|
LID_STATE="${BANANARCHY_LID_STATE:-/run/bananarchy/lid-state}"
|
||||||
|
RING_FLAG="${BANANARCHY_RING_FLAG:-/tmp/sxmo_call_ringing}"
|
||||||
|
ACTIVE_CALL_FLAG="${BANANARCHY_ACTIVE_CALL_FLAG:-/tmp/sxmo_active_call}"
|
||||||
|
|
||||||
get_delay() {
|
get_delay() {
|
||||||
v="$DEFAULT"
|
v="$DEFAULT"
|
||||||
@@ -70,6 +73,9 @@ cancel() {
|
|||||||
|
|
||||||
lock_panel() {
|
lock_panel() {
|
||||||
[ -f "$LOCK_FLAG" ] && return 0
|
[ -f "$LOCK_FLAG" ] && return 0
|
||||||
|
[ "$(cat "$LID_STATE" 2>/dev/null || true)" = "closed" ] && return 0
|
||||||
|
[ -e "$RING_FLAG" ] && return 0
|
||||||
|
[ -e "$ACTIVE_CALL_FLAG" ] && return 0
|
||||||
panel_is_dark || return 0
|
panel_is_dark || return 0
|
||||||
"$STATE_CMD" set screenoff >/dev/null 2>&1 || true
|
"$STATE_CMD" set screenoff >/dev/null 2>&1 || true
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -26,11 +26,11 @@ if [ "$(id -u)" != "0" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
WIFI_LISTEN_INTERVAL=5
|
WIFI_LISTEN_INTERVAL=5
|
||||||
MODEM_DRX_MODE=6
|
MODEM_DRX_MODE=0
|
||||||
DSDS_SECONDARY_MODE=active
|
DSDS_SECONDARY_MODE=active
|
||||||
DSDS_PARK_DELAY=300
|
DSDS_PARK_DELAY=300
|
||||||
CPU_RPM_SLEEP=1
|
CPU_RPM_SLEEP=0
|
||||||
CPU_L2_SLEEP=1
|
CPU_L2_SLEEP=0
|
||||||
WIFI_SCREEN_OFF_IPV6_MUTE=1
|
WIFI_SCREEN_OFF_IPV6_MUTE=1
|
||||||
WIFI_STANDBY_RAT=keep
|
WIFI_STANDBY_RAT=keep
|
||||||
[ -r "$CONF" ] && . "$CONF"
|
[ -r "$CONF" ] && . "$CONF"
|
||||||
@@ -178,6 +178,10 @@ set_spm_bool() {
|
|||||||
apply_cpu_lpm() {
|
apply_cpu_lpm() {
|
||||||
set_spm_bool "$SPM_PARAM_DIR/rpm_sleep" "$CPU_RPM_SLEEP"
|
set_spm_bool "$SPM_PARAM_DIR/rpm_sleep" "$CPU_RPM_SLEEP"
|
||||||
set_spm_bool "$SPM_PARAM_DIR/l2_sleep" "$CPU_L2_SLEEP"
|
set_spm_bool "$SPM_PARAM_DIR/l2_sleep" "$CPU_L2_SLEEP"
|
||||||
|
case "$CPU_RPM_SLEEP" in
|
||||||
|
1|Y|y) ;;
|
||||||
|
*) set_spm_bool "$SPM_PARAM_DIR/screen_off" 0 ;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
mute_wifi_ipv6_ra() {
|
mute_wifi_ipv6_ra() {
|
||||||
@@ -305,6 +309,7 @@ boot() {
|
|||||||
rm -f "$TOKEN" "$RAT_TOKEN" "$PARKED" "$AIDFILE" "$SLOTFILE" "$RAT_PARKED" "$RAT_SAVED" "$IPV6_RA_SAVED" "$READYSTAMP" "$RUNDIR"/drx.wwan* 2>/dev/null || true
|
rm -f "$TOKEN" "$RAT_TOKEN" "$PARKED" "$AIDFILE" "$SLOTFILE" "$RAT_PARKED" "$RAT_SAVED" "$IPV6_RA_SAVED" "$READYSTAMP" "$RUNDIR"/drx.wwan* 2>/dev/null || true
|
||||||
write_modprobe || true
|
write_modprobe || true
|
||||||
apply_cpu_lpm
|
apply_cpu_lpm
|
||||||
|
if [ "$MODEM_DRX_MODE" != "0" ]; then
|
||||||
btok="$$-$(cat /proc/uptime 2>/dev/null | awk '{print $1}' || echo 0)"
|
btok="$$-$(cat /proc/uptime 2>/dev/null | awk '{print $1}' || echo 0)"
|
||||||
printf '%s\n' "$btok" > "$BOOTTOKEN"
|
printf '%s\n' "$btok" > "$BOOTTOKEN"
|
||||||
(
|
(
|
||||||
@@ -326,6 +331,7 @@ boot() {
|
|||||||
i=$((i + 1))
|
i=$((i + 1))
|
||||||
done
|
done
|
||||||
) >/dev/null 2>&1 &
|
) >/dev/null 2>&1 &
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
debugfs_summary() {
|
debugfs_summary() {
|
||||||
|
|||||||
Binary file not shown.
@@ -36,7 +36,7 @@ BOOT_ATTEMPTS=30
|
|||||||
SYNC_WAIT=15
|
SYNC_WAIT=15
|
||||||
|
|
||||||
# Host tests (and callers that already have privileges) can skip the doas hop.
|
# Host tests (and callers that already have privileges) can skip the doas hop.
|
||||||
if [ "$(id -u)" != "0" ] && [ "${BANANARCHY_TIME_SYNC_NO_ESCALATION:-0}" != "1" ]; then
|
if [ "${1:-}" != "refresh-ui" ] && [ "$(id -u)" != "0" ] && [ "${BANANARCHY_TIME_SYNC_NO_ESCALATION:-0}" != "1" ]; then
|
||||||
exec doas -n "$0" "$@"
|
exec doas -n "$0" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -91,16 +91,54 @@ synced() {
|
|||||||
[ -n "$ref" ] && [ "$ref" != "00000000" ]
|
[ -n "$ref" ] && [ "$ref" != "00000000" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
burst_done() {
|
||||||
|
"$CHRONYC" -h "$SOCKET" activity 2>/dev/null | awk '
|
||||||
|
/^[0-9]+ sources doing burst/ { b = $1 }
|
||||||
|
END { exit !(b + 0 == 0) }
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_sync_complete() {
|
||||||
|
wait_s="${BANANARCHY_SYNC_WAIT:-$SYNC_WAIT}"
|
||||||
|
sleep_s="${BANANARCHY_TIME_SYNC_SLEEP:-1}"
|
||||||
|
i=0
|
||||||
|
while [ "$i" -lt "$wait_s" ]; do
|
||||||
|
if synced && burst_done; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
sleep "$sleep_s"
|
||||||
|
i=$((i + 1))
|
||||||
|
done
|
||||||
|
synced
|
||||||
|
}
|
||||||
|
|
||||||
refresh_statusbar() {
|
refresh_statusbar() {
|
||||||
# chronyd can step the clock by decades (e.g. from a 1970 RTC to network
|
# chronyd can step the clock by decades (e.g. from a 1970 RTC to network
|
||||||
# time). Republish the status bar clock and charge icon as the X session
|
# time) or the user can switch timezones live. Republish desktop statusbar,
|
||||||
# user so they do not stay stale until the next 300 s periodic tick.
|
# xlocker, 2720 cover display, and realign bananarchy-run-aligned immediately.
|
||||||
su user -s /bin/sh -c '
|
su_cmd="${BANANARCHY_STATUS_REFRESH_CMD:-su}"
|
||||||
|
if [ "$(id -u)" = "0" ]; then
|
||||||
|
"$su_cmd" user -s /bin/sh -c '
|
||||||
HOME=/home/user DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/10000 \
|
HOME=/home/user DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/10000 \
|
||||||
SXMO_WM=dwm SXMO_STATUS_NAME=default SXMO_STATE=/run/user/10000/sxmo.state \
|
SXMO_WM=dwm SXMO_STATUS_NAME=default SXMO_STATE=/run/user/10000/sxmo.state \
|
||||||
PATH=/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin \
|
PATH=/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin \
|
||||||
sxmo_hook_statusbar.sh refresh
|
sxmo_hook_statusbar.sh refresh
|
||||||
' >/dev/null 2>&1 || true
|
' >/dev/null 2>&1 || true
|
||||||
|
else
|
||||||
|
HOME="${HOME:-/home/user}" DISPLAY="${DISPLAY:-:0}" \
|
||||||
|
XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/10000}" \
|
||||||
|
SXMO_WM=dwm SXMO_STATUS_NAME=default \
|
||||||
|
SXMO_STATE="${SXMO_STATE:-/run/user/10000/sxmo.state}" \
|
||||||
|
PATH="/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/usr/sbin:$PATH" \
|
||||||
|
sxmo_hook_statusbar.sh refresh >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
locker_fifo="${BANANARCHY_LOCKER_FIFO:-/tmp/dwm_plugin_locker.fifo}"
|
||||||
|
if [ -p "$locker_fifo" ] || [ -f "$locker_fifo" ]; then
|
||||||
|
timeout 1 sh -c 'printf "REFRESH_TIME\n" > "$1"' _ "$locker_fifo" >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
coverctl="${BANANARCHY_COVERCTL:-/usr/bin/bananarchy-coverctl}"
|
||||||
|
"$coverctl" REFRESH >/dev/null 2>&1 || true
|
||||||
|
killall -q -USR1 bananarchy-run-aligned >/dev/null 2>&1 || true
|
||||||
}
|
}
|
||||||
|
|
||||||
# refresh re-resolves pool names asynchronously. Keep retrying while DNS is
|
# refresh re-resolves pool names asynchronously. Keep retrying while DNS is
|
||||||
@@ -170,16 +208,11 @@ sync_now() {
|
|||||||
echo "Network time unavailable: chronyd or DNS is not ready"
|
echo "Network time unavailable: chronyd or DNS is not ready"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
i=0
|
if wait_sync_complete; then
|
||||||
while [ "$i" -lt "$SYNC_WAIT" ]; do
|
|
||||||
if synced; then
|
|
||||||
refresh_statusbar
|
refresh_statusbar
|
||||||
printf 'Network time synced: %s\n' "$(date -u '+%Y-%m-%d %H:%M:%S UTC')"
|
printf 'Network time synced: %s\n' "$(date -u '+%Y-%m-%d %H:%M:%S UTC')"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
sleep 1
|
|
||||||
i=$((i + 1))
|
|
||||||
done
|
|
||||||
echo "Network time not confirmed yet; retry when the network is up"
|
echo "Network time not confirmed yet; retry when the network is up"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
@@ -190,19 +223,28 @@ case "${1:-status}" in
|
|||||||
[ "${1:-}" = "boot" ] && "$GPS_TIME_HELPER" boot >/dev/null 2>&1 || true
|
[ "${1:-}" = "boot" ] && "$GPS_TIME_HELPER" boot >/dev/null 2>&1 || true
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
trigger "$1" && refresh_statusbar
|
if trigger "$1"; then
|
||||||
|
wait_sync_complete || true
|
||||||
|
refresh_statusbar
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
force)
|
force)
|
||||||
if [ "$(time_source)" = "gps" ]; then
|
if [ "$(time_source)" = "gps" ]; then
|
||||||
"$GPS_TIME_HELPER" sync && refresh_statusbar
|
"$GPS_TIME_HELPER" sync && refresh_statusbar
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
trigger force && refresh_statusbar
|
if trigger force; then
|
||||||
|
wait_sync_complete || true
|
||||||
|
refresh_statusbar
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
sync)
|
sync)
|
||||||
sync_now
|
sync_now
|
||||||
exit $?
|
exit $?
|
||||||
;;
|
;;
|
||||||
|
refresh-ui)
|
||||||
|
refresh_statusbar
|
||||||
|
;;
|
||||||
status)
|
status)
|
||||||
if [ ! -S "$SOCKET" ]; then
|
if [ ! -S "$SOCKET" ]; then
|
||||||
echo "chronyd command socket absent"
|
echo "chronyd command socket absent"
|
||||||
|
|||||||
Binary file not shown.
@@ -84,7 +84,22 @@ EOF
|
|||||||
has_tracked_calls() {
|
has_tracked_calls() {
|
||||||
[ -d "$XDG_RUNTIME_DIR/sxmo_calls" ] || return 1
|
[ -d "$XDG_RUNTIME_DIR/sxmo_calls" ] || return 1
|
||||||
for f in "$XDG_RUNTIME_DIR/sxmo_calls"/*; do
|
for f in "$XDG_RUNTIME_DIR/sxmo_calls"/*; do
|
||||||
[ -e "$f" ] && return 0
|
[ -e "$f" ] || continue
|
||||||
|
base="${f%.*}"
|
||||||
|
ext="${f##*.}"
|
||||||
|
case "$ext" in
|
||||||
|
pickedupcall|initiatedcall|ringing-in|dialing|ringing-out|active|held|waiting)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
monitoredcall)
|
||||||
|
if [ ! -e "${base}.discardedcall" ] && \
|
||||||
|
[ ! -e "${base}.hangedupcall" ] && \
|
||||||
|
[ ! -e "${base}.terminated" ] && \
|
||||||
|
[ ! -e "${base}.blockedcall" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
@@ -208,7 +223,6 @@ getprogchoices() {
|
|||||||
WINNAME="Power"
|
WINNAME="Power"
|
||||||
CHOICES="$icon_lck Lock^0^sxmo_state.sh set lock
|
CHOICES="$icon_lck Lock^0^sxmo_state.sh set lock
|
||||||
$icon_lck Lock (Screen off)^0^sxmo_state.sh set screenoff
|
$icon_lck Lock (Screen off)^0^sxmo_state.sh set screenoff
|
||||||
$icon_out Logout^0^confirm Logout && sxmo_power.sh logout
|
|
||||||
$icon_rld Reboot^0^confirm Reboot && sxmo_power.sh reboot
|
$icon_rld Reboot^0^confirm Reboot && sxmo_power.sh reboot
|
||||||
$icon_rld Reboot to loader^0^confirm Bootloader && sxmo_power.sh bootloader
|
$icon_rld Reboot to loader^0^confirm Bootloader && sxmo_power.sh bootloader
|
||||||
$icon_pwr Poweroff^0^confirm Poweroff && sxmo_power.sh poweroff"
|
$icon_pwr Poweroff^0^confirm Poweroff && sxmo_power.sh poweroff"
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ fi
|
|||||||
|
|
||||||
# We use this directory to store states, so it must exist
|
# We use this directory to store states, so it must exist
|
||||||
mkdir -p "$XDG_RUNTIME_DIR/sxmo_calls"
|
mkdir -p "$XDG_RUNTIME_DIR/sxmo_calls"
|
||||||
|
HANGUP_FLAG="${SXMO_HANGUP_FLAG:-/tmp/sxmo_hangup_requested}"
|
||||||
|
|
||||||
stderr() {
|
stderr() {
|
||||||
sxmo_log "$*"
|
sxmo_log "$*"
|
||||||
@@ -37,8 +38,25 @@ cleanupnumber() {
|
|||||||
echo "$1"
|
echo "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_recent_hangup_requested() {
|
||||||
|
[ -f "$HANGUP_FLAG" ] || return 1
|
||||||
|
_now="$(date +%s 2>/dev/null || echo 0)"
|
||||||
|
_mt="$(stat -c %Y "$HANGUP_FLAG" 2>/dev/null || echo 0)"
|
||||||
|
case "$_now:$_mt" in
|
||||||
|
*[!0-9:]*)
|
||||||
|
rm -f "$HANGUP_FLAG" 2>/dev/null || true
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [ "$_now" -ge "$_mt" ] && [ "$((_now - _mt))" -le 8 ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
rm -f "$HANGUP_FLAG" 2>/dev/null || true
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
checkforfinishedcalls() {
|
checkforfinishedcalls() {
|
||||||
exec 3<> "$XDG_RUNTIME_DIR/sxmo_modem.checkforfinishedcalls.lock"
|
exec 3<> "$XDG_RUNTIME_DIR/sxmo_modem.voicecalls.lock"
|
||||||
flock -x 3
|
flock -x 3
|
||||||
#find all finished calls
|
#find all finished calls
|
||||||
for FINISHEDCALLID in $(
|
for FINISHEDCALLID in $(
|
||||||
@@ -67,7 +85,7 @@ checkforfinishedcalls() {
|
|||||||
STATE=pickedup
|
STATE=pickedup
|
||||||
stderr "Finished call from $FINISHEDNUMBER"
|
stderr "Finished call from $FINISHEDNUMBER"
|
||||||
printf %b "$TIME\tcall_finished\t$FINISHEDNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
|
printf %b "$TIME\tcall_finished\t$FINISHEDNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
|
||||||
elif [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}.hangedupcall" ] || [ -f /tmp/sxmo_hangup_requested ]; then
|
elif [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}.hangedupcall" ] || is_recent_hangup_requested; then
|
||||||
#this call was hung up by the user
|
#this call was hung up by the user
|
||||||
STATE=wehangedup
|
STATE=wehangedup
|
||||||
stderr "Finished call from $FINISHEDNUMBER"
|
stderr "Finished call from $FINISHEDNUMBER"
|
||||||
@@ -111,11 +129,10 @@ checkforfinishedcalls() {
|
|||||||
if ! sxmo_modemcall.sh list_active_calls | grep -q .; then
|
if ! sxmo_modemcall.sh list_active_calls | grep -q .; then
|
||||||
# Cleanup
|
# Cleanup
|
||||||
sxmo_jobs.sh stop ringing
|
sxmo_jobs.sh stop ringing
|
||||||
pkill -TERM -f sxmo_hook_ring.sh 2>/dev/null || true
|
killall -q -TERM bananarchy-melody sxmo_vibrate pw-play mpv 2>/dev/null || true
|
||||||
pkill -TERM -f "pw-play.*ring" 2>/dev/null || true
|
rpids="$(pgrep -f '[s]xmo_hook_ring\.sh|[p]w-play.*ring|[m]pv.*ring' 2>/dev/null || true)"
|
||||||
pkill -TERM -f "mpv.*ring" 2>/dev/null || true
|
[ -n "$rpids" ] && kill -TERM $rpids 2>/dev/null || true
|
||||||
pkill -TERM -x sxmo_vibrate 2>/dev/null || true
|
rm -f "$XDG_RUNTIME_DIR/sxmo_calls/"* "$HANGUP_FLAG" 2>/dev/null || true
|
||||||
rm -f "$XDG_RUNTIME_DIR/sxmo_calls/"* 2>/dev/null || true
|
|
||||||
if [ "$STATE" != muted ] && [ ! -f "$XDG_CONFIG_HOME/sxmo/.novibrate" ]; then
|
if [ "$STATE" != muted ] && [ ! -f "$XDG_CONFIG_HOME/sxmo/.novibrate" ]; then
|
||||||
sxmo_vibrate 600 &
|
sxmo_vibrate 600 &
|
||||||
fi
|
fi
|
||||||
@@ -135,10 +152,9 @@ checkforfinishedcalls() {
|
|||||||
# Or refresh the menu
|
# Or refresh the menu
|
||||||
if ! sxmo_modemcall.sh list_active_calls | grep -q "ringing-in"; then
|
if ! sxmo_modemcall.sh list_active_calls | grep -q "ringing-in"; then
|
||||||
sxmo_jobs.sh stop ringing
|
sxmo_jobs.sh stop ringing
|
||||||
pkill -TERM -f sxmo_hook_ring.sh 2>/dev/null || true
|
killall -q -TERM bananarchy-melody sxmo_vibrate pw-play mpv 2>/dev/null || true
|
||||||
pkill -TERM -f "pw-play.*ring" 2>/dev/null || true
|
rpids="$(pgrep -f '[s]xmo_hook_ring\.sh|[p]w-play.*ring|[m]pv.*ring' 2>/dev/null || true)"
|
||||||
pkill -TERM -f "mpv.*ring" 2>/dev/null || true
|
[ -n "$rpids" ] && kill -TERM $rpids 2>/dev/null || true
|
||||||
pkill -TERM -x sxmo_vibrate 2>/dev/null || true
|
|
||||||
fi
|
fi
|
||||||
sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incall_menu
|
sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incall_menu
|
||||||
fi
|
fi
|
||||||
@@ -146,6 +162,8 @@ checkforfinishedcalls() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkforincomingcalls() {
|
checkforincomingcalls() {
|
||||||
|
exec 3<> "$XDG_RUNTIME_DIR/sxmo_modem.voicecalls.lock"
|
||||||
|
flock -x 3
|
||||||
VOICECALLID="$(
|
VOICECALLID="$(
|
||||||
mmcli -m any --voice-list-calls -a |
|
mmcli -m any --voice-list-calls -a |
|
||||||
grep -Eo '[0-9]+ incoming \(ringing-in\)' |
|
grep -Eo '[0-9]+ incoming \(ringing-in\)' |
|
||||||
@@ -153,7 +171,12 @@ checkforincomingcalls() {
|
|||||||
)"
|
)"
|
||||||
[ -z "$VOICECALLID" ] && return
|
[ -z "$VOICECALLID" ] && return
|
||||||
|
|
||||||
[ -f "$XDG_RUNTIME_DIR/sxmo_calls/${VOICECALLID}.monitoredcall" ] && return # prevent multiple rings
|
if [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${VOICECALLID}.monitoredcall" ] || \
|
||||||
|
[ -f "$XDG_RUNTIME_DIR/sxmo_calls/${VOICECALLID}.discardedcall" ] || \
|
||||||
|
[ -f "$XDG_RUNTIME_DIR/sxmo_calls/${VOICECALLID}.hangedupcall" ] || \
|
||||||
|
[ -f "$XDG_RUNTIME_DIR/sxmo_calls/${VOICECALLID}.blockedcall" ]; then
|
||||||
|
return # prevent multiple rings or re-ringing a rejected call
|
||||||
|
fi
|
||||||
rm "$XDG_RUNTIME_DIR/sxmo_calls/$VOICECALLID."* 2>/dev/null # we cleanup all dangling event files
|
rm "$XDG_RUNTIME_DIR/sxmo_calls/$VOICECALLID."* 2>/dev/null # we cleanup all dangling event files
|
||||||
touch "$XDG_RUNTIME_DIR/sxmo_calls/${VOICECALLID}.monitoredcall" #this signals that we handled the call
|
touch "$XDG_RUNTIME_DIR/sxmo_calls/${VOICECALLID}.monitoredcall" #this signals that we handled the call
|
||||||
|
|
||||||
@@ -172,6 +195,11 @@ checkforincomingcalls() {
|
|||||||
else
|
else
|
||||||
stderr "Invoking ring hook (async)"
|
stderr "Invoking ring hook (async)"
|
||||||
CONTACTNAME=$(sxmo_contacts.sh --name-or-number "$INCOMINGNUMBER")
|
CONTACTNAME=$(sxmo_contacts.sh --name-or-number "$INCOMINGNUMBER")
|
||||||
|
if ! mmcli -m any -o "$VOICECALLID" -K 2>/dev/null | \
|
||||||
|
grep -qE 'call\.properties\.state[[:space:]]*:[[:space:]]*(ringing-in|waiting)'; then
|
||||||
|
rm -f "$XDG_RUNTIME_DIR/sxmo_calls/${VOICECALLID}."* 2>/dev/null || true
|
||||||
|
return
|
||||||
|
fi
|
||||||
sxmo_jobs.sh start --group ringing sxmo_hook_ring.sh "$CONTACTNAME"
|
sxmo_jobs.sh start --group ringing sxmo_hook_ring.sh "$CONTACTNAME"
|
||||||
|
|
||||||
mkdir -p "$SXMO_LOGDIR"
|
mkdir -p "$SXMO_LOGDIR"
|
||||||
@@ -194,7 +222,7 @@ checkforincomingcalls() {
|
|||||||
| grep -q .; then
|
| grep -q .; then
|
||||||
# Refresh the incall menu
|
# Refresh the incall menu
|
||||||
sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incall_menu
|
sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incall_menu
|
||||||
else
|
elif ! command -v xcallscreen >/dev/null 2>&1; then
|
||||||
# Or fire the incoming call menu
|
# Or fire the incoming call menu
|
||||||
sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incoming_call_menu "$VOICECALLID"
|
sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incoming_call_menu "$VOICECALLID"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -133,7 +133,8 @@ pickup() {
|
|||||||
hangup() {
|
hangup() {
|
||||||
CALLID="${1:-all}"
|
CALLID="${1:-all}"
|
||||||
touch /tmp/sxmo_hangup_requested 2>/dev/null || true
|
touch /tmp/sxmo_hangup_requested 2>/dev/null || true
|
||||||
pkill -TERM -f sxmo_modemdial.sh 2>/dev/null || true
|
dpids="$(pgrep -f '[s]xmo_modemdial\.sh' 2>/dev/null || true)"
|
||||||
|
[ -n "$dpids" ] && kill -TERM $dpids 2>/dev/null || true
|
||||||
|
|
||||||
case "$CALLID" in
|
case "$CALLID" in
|
||||||
""|"-"|"all")
|
""|"-"|"all")
|
||||||
@@ -143,6 +144,12 @@ hangup() {
|
|||||||
rm -f "$f" 2>/dev/null || true
|
rm -f "$f" 2>/dev/null || true
|
||||||
touch "${base}.hangedupcall" 2>/dev/null || true
|
touch "${base}.hangedupcall" 2>/dev/null || true
|
||||||
done
|
done
|
||||||
|
for f in "$XDG_RUNTIME_DIR"/sxmo_calls/*.monitoredcall; do
|
||||||
|
[ -e "$f" ] || continue
|
||||||
|
base="${f%.*}"
|
||||||
|
rm -f "$f" 2>/dev/null || true
|
||||||
|
touch "${base}.discardedcall" 2>/dev/null || true
|
||||||
|
done
|
||||||
rm -f "$XDG_RUNTIME_DIR"/sxmo_calls/sub1_* "$XDG_RUNTIME_DIR"/sxmo_calls/sub0_* /tmp/sxmo_call_ringing /tmp/sxmo_active_call 2>/dev/null || true
|
rm -f "$XDG_RUNTIME_DIR"/sxmo_calls/sub1_* "$XDG_RUNTIME_DIR"/sxmo_calls/sub0_* /tmp/sxmo_call_ringing /tmp/sxmo_active_call 2>/dev/null || true
|
||||||
doas -n /usr/libexec/msm-modem-uim-selection call-hangup all >/dev/null 2>&1 || \
|
doas -n /usr/libexec/msm-modem-uim-selection call-hangup all >/dev/null 2>&1 || \
|
||||||
/usr/libexec/msm-modem-uim-selection call-hangup all >/dev/null 2>&1 || true
|
/usr/libexec/msm-modem-uim-selection call-hangup all >/dev/null 2>&1 || true
|
||||||
@@ -151,6 +158,16 @@ hangup() {
|
|||||||
mmcli -m any -o "$cid" --hangup >/dev/null 2>&1 || true
|
mmcli -m any -o "$cid" --hangup >/dev/null 2>&1 || true
|
||||||
mmcli -m any --voice-delete-call="$cid" >/dev/null 2>&1 || true
|
mmcli -m any --voice-delete-call="$cid" >/dev/null 2>&1 || true
|
||||||
done
|
done
|
||||||
|
mm_calls="$(mmcli -m any --voice-list-calls 2>/dev/null || true)"
|
||||||
|
for f in "$XDG_RUNTIME_DIR"/sxmo_calls/*; do
|
||||||
|
[ -e "$f" ] || continue
|
||||||
|
bn="${f##*/}"
|
||||||
|
cid="${bn%%.*}"
|
||||||
|
case "$cid" in
|
||||||
|
''|*[!0-9]*) continue ;;
|
||||||
|
esac
|
||||||
|
printf '%s\n' "$mm_calls" | grep -qE "/Call/${cid}([[:space:]]|\$)" || rm -f "$f" 2>/dev/null || true
|
||||||
|
done
|
||||||
doas -n dbus-send --system --type=signal / org.ofono.VoiceCallManager.CallRemoved >/dev/null 2>&1 || true
|
doas -n dbus-send --system --type=signal / org.ofono.VoiceCallManager.CallRemoved >/dev/null 2>&1 || true
|
||||||
sxmo_hook_hangup.sh || true
|
sxmo_hook_hangup.sh || true
|
||||||
return 0
|
return 0
|
||||||
@@ -175,10 +192,12 @@ hangup() {
|
|||||||
[ -f "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.initiatedcall" ]; then
|
[ -f "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.initiatedcall" ]; then
|
||||||
WAS_PICKED_UP=1
|
WAS_PICKED_UP=1
|
||||||
rm -f "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.pickedupcall" \
|
rm -f "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.pickedupcall" \
|
||||||
"$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.initiatedcall"
|
"$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.initiatedcall" \
|
||||||
|
"$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.monitoredcall"
|
||||||
touch "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.hangedupcall" || true
|
touch "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.hangedupcall" || true
|
||||||
else
|
else
|
||||||
# this call was never picked up and hung up immediately, so it is a discarded call
|
# this call was never picked up and hung up immediately, so it is a discarded call
|
||||||
|
rm -f "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.monitoredcall"
|
||||||
touch "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.discardedcall" || true
|
touch "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.discardedcall" || true
|
||||||
fi
|
fi
|
||||||
rm -f /tmp/sxmo_call_ringing /tmp/sxmo_active_call 2>/dev/null || true
|
rm -f /tmp/sxmo_call_ringing /tmp/sxmo_active_call 2>/dev/null || true
|
||||||
@@ -205,6 +224,10 @@ hangup() {
|
|||||||
sxmo_hook_discard.sh || true
|
sxmo_hook_discard.sh || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! mmcli -m any --voice-list-calls 2>/dev/null | grep -qE "/Call/${CALLID}([[:space:]]|\$)"; then
|
||||||
|
rm -f "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}."* 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$HANGUP_FAILED" = "1" ]; then
|
if [ "$HANGUP_FAILED" = "1" ]; then
|
||||||
sxmo_notify_user.sh --urgency=critical "We failed to hangup the call"
|
sxmo_notify_user.sh --urgency=critical "We failed to hangup the call"
|
||||||
return 1
|
return 1
|
||||||
@@ -272,6 +295,15 @@ mute() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
incoming_call_menu() {
|
incoming_call_menu() {
|
||||||
|
case "$1" in
|
||||||
|
sub1_*|sub0_*)
|
||||||
|
[ -e "$XDG_RUNTIME_DIR/sxmo_calls/${1}.ringing-in" ] || return 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
mmcli -m any -o "$1" -K 2>/dev/null | \
|
||||||
|
grep -qE 'call\.properties\.state[[:space:]]*:[[:space:]]*(ringing-in|waiting)' || return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
NUMBER="$(vid_to_number "$1")"
|
NUMBER="$(vid_to_number "$1")"
|
||||||
NUMBER="$(sxmo_modem.sh cleanupnumber "$NUMBER")"
|
NUMBER="$(sxmo_modem.sh cleanupnumber "$NUMBER")"
|
||||||
if command -v xcallscreen >/dev/null 2>&1; then
|
if command -v xcallscreen >/dev/null 2>&1; then
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ case "$1" in
|
|||||||
"i3") i3-msg exit ;;
|
"i3") i3-msg exit ;;
|
||||||
"sway") swaymsg exit ;;
|
"sway") swaymsg exit ;;
|
||||||
"river") riverctl exit ;;
|
"river") riverctl exit ;;
|
||||||
"dwm") pkill -x dwm || pkill dwm ;;
|
"dwm") killall -q dwm ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
togglewm) sxmo_togglewm.sh ;;
|
togglewm) sxmo_togglewm.sh ;;
|
||||||
|
|||||||
@@ -10,7 +10,11 @@ change_alpine() {
|
|||||||
echo "Changing timezone to $1"
|
echo "Changing timezone to $1"
|
||||||
|
|
||||||
doas -n setup-timezone -z "$1" 2>/dev/null || doas setup-timezone -z "$1"
|
doas -n setup-timezone -z "$1" 2>/dev/null || doas setup-timezone -z "$1"
|
||||||
|
if [ -x /usr/bin/bananarchy-time-sync.sh ]; then
|
||||||
|
/usr/bin/bananarchy-time-sync.sh refresh-ui >/dev/null 2>&1 || true
|
||||||
|
else
|
||||||
sxmo_hook_statusbar.sh time
|
sxmo_hook_statusbar.sh time
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Timezone changed ok"
|
echo "Timezone changed ok"
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -59,7 +59,9 @@ setup_tz() {
|
|||||||
ln -s "$zonepath" "${ROOT}"etc/localtime
|
ln -s "$zonepath" "${ROOT}"etc/localtime
|
||||||
printf "%s\n" "$zone" > "${ROOT}"etc/timezone 2>/dev/null || true
|
printf "%s\n" "$zone" > "${ROOT}"etc/timezone 2>/dev/null || true
|
||||||
if [ -z "$ROOT" ] || [ "$ROOT" = "/" ]; then
|
if [ -z "$ROOT" ] || [ "$ROOT" = "/" ]; then
|
||||||
if pidof -s Xorg >/dev/null 2>&1; then
|
if [ -x /usr/bin/bananarchy-time-sync.sh ]; then
|
||||||
|
/usr/bin/bananarchy-time-sync.sh refresh-ui >/dev/null 2>&1 || true
|
||||||
|
elif pidof -s Xorg >/dev/null 2>&1; then
|
||||||
su -s /bin/sh user -c '
|
su -s /bin/sh user -c '
|
||||||
export PATH="/home/user/.config/sxmo/hooks:/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin"
|
export PATH="/home/user/.config/sxmo/hooks:/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin"
|
||||||
export DISPLAY=:0
|
export DISPLAY=:0
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ case "$WMCLASS" in
|
|||||||
CHOICES="
|
CHOICES="
|
||||||
$icon_lck Lock ^ 0 ^ sxmo_state.sh set lock
|
$icon_lck Lock ^ 0 ^ sxmo_state.sh set lock
|
||||||
$icon_lck Lock (Screen off) ^ 0 ^ sxmo_state.sh set screenoff
|
$icon_lck Lock (Screen off) ^ 0 ^ sxmo_state.sh set screenoff
|
||||||
$icon_out Logout ^ 0 ^ confirm Logout && sxmo_power.sh logout
|
|
||||||
$icon_rld Reboot ^ 0 ^ confirm Reboot && sxmo_power.sh reboot
|
$icon_rld Reboot ^ 0 ^ confirm Reboot && sxmo_power.sh reboot
|
||||||
$icon_rld Reboot to loader ^ 0 ^ confirm Bootloader && sxmo_power.sh bootloader
|
$icon_rld Reboot to loader ^ 0 ^ confirm Bootloader && sxmo_power.sh bootloader
|
||||||
$icon_pwr Poweroff ^ 0 ^ confirm Poweroff && sxmo_power.sh poweroff
|
$icon_pwr Poweroff ^ 0 ^ confirm Poweroff && sxmo_power.sh poweroff
|
||||||
|
|||||||
@@ -8,11 +8,11 @@
|
|||||||
# up the call).
|
# up the call).
|
||||||
|
|
||||||
# kill existing ring playback
|
# kill existing ring playback
|
||||||
|
/usr/bin/bananarchy-cover-event.sh ended >/dev/null 2>&1 || true
|
||||||
rm -f /tmp/sxmo_call_ringing 2>/dev/null || true
|
rm -f /tmp/sxmo_call_ringing 2>/dev/null || true
|
||||||
sxmo_jobs.sh stop ringing
|
sxmo_jobs.sh stop ringing
|
||||||
pkill -TERM -f sxmo_hook_ring.sh 2>/dev/null || true
|
killall -q -TERM bananarchy-melody sxmo_vibrate pw-play mpv 2>/dev/null || true
|
||||||
pkill -TERM -f "pw-play.*ring" 2>/dev/null || true
|
rpids="$(pgrep -f '[s]xmo_hook_ring\.sh|[p]w-play.*ring|[m]pv.*ring' 2>/dev/null || true)"
|
||||||
pkill -TERM -f "mpv.*ring" 2>/dev/null || true
|
[ -n "$rpids" ] && kill -TERM $rpids 2>/dev/null || true
|
||||||
pkill -TERM -x sxmo_vibrate 2>/dev/null || true
|
|
||||||
|
|
||||||
sxmo_playerctl.sh resume_all
|
sxmo_playerctl.sh resume_all
|
||||||
@@ -16,16 +16,6 @@ cur_state=""
|
|||||||
|
|
||||||
printf '1\n' > /tmp/bananarchy_screen_locked
|
printf '1\n' > /tmp/bananarchy_screen_locked
|
||||||
|
|
||||||
if ! sxmo_jobs.sh running proximity_lock -q; then
|
|
||||||
if [ -f /tmp/sxmo_call_ringing ] || [ -f /tmp/sxmo_active_call ] || [ -n "$(ls -A "$XDG_RUNTIME_DIR/sxmo_calls" 2>/dev/null)" ]; then
|
|
||||||
rm -f /tmp/sxmo_call_ringing /tmp/sxmo_active_call 2>/dev/null || true
|
|
||||||
if [ -p /tmp/dwm_plugin_callscreen.fifo ]; then
|
|
||||||
printf 'HANGUP_CLOSE\n' > /tmp/dwm_plugin_callscreen.fifo 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
sxmo_modemcall.sh hangup all >/dev/null 2>&1 &
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$SXMO_DISABLE_LEDS" ]; then
|
if [ -z "$SXMO_DISABLE_LEDS" ]; then
|
||||||
sxmo_led.sh blink blue &
|
sxmo_led.sh blink blue &
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -7,11 +7,11 @@
|
|||||||
# incoming call, i.e., ignore the call ringing in.
|
# incoming call, i.e., ignore the call ringing in.
|
||||||
|
|
||||||
# kill existing ring playback
|
# kill existing ring playback
|
||||||
|
/usr/bin/bananarchy-cover-event.sh muted >/dev/null 2>&1 || true
|
||||||
rm -f /tmp/sxmo_call_ringing 2>/dev/null || true
|
rm -f /tmp/sxmo_call_ringing 2>/dev/null || true
|
||||||
sxmo_jobs.sh stop ringing
|
sxmo_jobs.sh stop ringing
|
||||||
pkill -TERM -f sxmo_hook_ring.sh 2>/dev/null || true
|
killall -q -TERM bananarchy-melody sxmo_vibrate pw-play mpv 2>/dev/null || true
|
||||||
pkill -TERM -f "pw-play.*ring" 2>/dev/null || true
|
rpids="$(pgrep -f '[s]xmo_hook_ring\.sh|[p]w-play.*ring|[m]pv.*ring' 2>/dev/null || true)"
|
||||||
pkill -TERM -f "mpv.*ring" 2>/dev/null || true
|
[ -n "$rpids" ] && kill -TERM $rpids 2>/dev/null || true
|
||||||
pkill -TERM -x sxmo_vibrate 2>/dev/null || true
|
|
||||||
|
|
||||||
sxmo_playerctl.sh resume_all
|
sxmo_playerctl.sh resume_all
|
||||||
@@ -11,10 +11,9 @@
|
|||||||
/usr/bin/bananarchy-cover-event.sh active >/dev/null 2>&1 || true
|
/usr/bin/bananarchy-cover-event.sh active >/dev/null 2>&1 || true
|
||||||
rm -f /tmp/sxmo_call_ringing 2>/dev/null || true
|
rm -f /tmp/sxmo_call_ringing 2>/dev/null || true
|
||||||
sxmo_jobs.sh stop ringing
|
sxmo_jobs.sh stop ringing
|
||||||
pkill -TERM -f sxmo_hook_ring.sh 2>/dev/null || true
|
killall -q -TERM bananarchy-melody sxmo_vibrate pw-play mpv 2>/dev/null || true
|
||||||
pkill -TERM -f "pw-play.*ring" 2>/dev/null || true
|
rpids="$(pgrep -f '[s]xmo_hook_ring\.sh|[p]w-play.*ring|[m]pv.*ring' 2>/dev/null || true)"
|
||||||
pkill -TERM -f "mpv.*ring" 2>/dev/null || true
|
[ -n "$rpids" ] && kill -TERM $rpids 2>/dev/null || true
|
||||||
pkill -TERM -x sxmo_vibrate 2>/dev/null || true
|
|
||||||
|
|
||||||
# Pause all player automatically
|
# Pause all player automatically
|
||||||
sxmo_playerctl.sh pause_all
|
sxmo_playerctl.sh pause_all
|
||||||
@@ -15,7 +15,7 @@ export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
|
|||||||
# Incoming call: turn the panel on immediately and reset the idle timer.
|
# Incoming call: turn the panel on immediately and reset the idle timer.
|
||||||
/usr/bin/bananarchy-screen-wake.sh >/dev/null 2>&1 || true
|
/usr/bin/bananarchy-screen-wake.sh >/dev/null 2>&1 || true
|
||||||
# The lid gate turns that wake into a cover-only event; publish the call state.
|
# The lid gate turns that wake into a cover-only event; publish the call state.
|
||||||
/usr/bin/bananarchy-cover-event.sh ring >/dev/null 2>&1 || true
|
/usr/bin/bananarchy-cover-event.sh ring "${1:-}" >/dev/null 2>&1 || true
|
||||||
|
|
||||||
if [ -z "${SXMO_VIBRATE_DEV:-}" ] && [ ! -e /dev/input/by-path/platform-vibrator-event ]; then
|
if [ -z "${SXMO_VIBRATE_DEV:-}" ] && [ ! -e /dev/input/by-path/platform-vibrator-event ]; then
|
||||||
for vdev in /dev/input/by-path/*vibrator*-event; do
|
for vdev in /dev/input/by-path/*vibrator*-event; do
|
||||||
@@ -146,19 +146,19 @@ should_stop_ringing() {
|
|||||||
finish() {
|
finish() {
|
||||||
trap - INT TERM EXIT
|
trap - INT TERM EXIT
|
||||||
[ -n "$WAIT_PID" ] && kill -TERM "$WAIT_PID" 2>/dev/null || true
|
[ -n "$WAIT_PID" ] && kill -TERM "$WAIT_PID" 2>/dev/null || true
|
||||||
[ -n "$RING_PID" ] && pkill -TERM -P "$RING_PID" 2>/dev/null || true
|
if [ -n "$RING_PID" ]; then
|
||||||
[ -n "$VIB_PID" ] && pkill -TERM -P "$VIB_PID" 2>/dev/null || true
|
rpids="$(pgrep -P "$RING_PID" 2>/dev/null || true)"
|
||||||
[ -n "$RING_PID" ] && kill -TERM "$RING_PID" 2>/dev/null || true
|
[ -n "$rpids" ] && kill -TERM $rpids 2>/dev/null || true
|
||||||
[ -n "$VIB_PID" ] && kill -TERM "$VIB_PID" 2>/dev/null || true
|
kill -TERM "$RING_PID" 2>/dev/null || true
|
||||||
pkill -TERM -P "$$" 2>/dev/null || true
|
|
||||||
if [ -n "${SXMO_RINGTONE:-}" ]; then
|
|
||||||
pkill -TERM -f "pw-play.*$SXMO_RINGTONE" 2>/dev/null || true
|
|
||||||
pkill -TERM -f "mpv.*$SXMO_RINGTONE" 2>/dev/null || true
|
|
||||||
fi
|
fi
|
||||||
pkill -TERM -f "pw-play.*sxmo_monotone_ring.wav" 2>/dev/null || true
|
if [ -n "$VIB_PID" ]; then
|
||||||
pkill -TERM -f "mpv.*sxmo_monotone_ring.wav" 2>/dev/null || true
|
vpids="$(pgrep -P "$VIB_PID" 2>/dev/null || true)"
|
||||||
pkill -TERM -x bananarchy-melody 2>/dev/null || true
|
[ -n "$vpids" ] && kill -TERM $vpids 2>/dev/null || true
|
||||||
pkill -TERM -x sxmo_vibrate 2>/dev/null || true
|
kill -TERM "$VIB_PID" 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
cpids="$(pgrep -P "$$" 2>/dev/null || true)"
|
||||||
|
[ -n "$cpids" ] && kill -TERM $cpids 2>/dev/null || true
|
||||||
|
killall -q -TERM bananarchy-melody sxmo_vibrate pw-play mpv 2>/dev/null || true
|
||||||
if ! is_call_picked_up; then
|
if ! is_call_picked_up; then
|
||||||
sxmo_audio.sh device apply >/dev/null 2>&1 || true
|
sxmo_audio.sh device apply >/dev/null 2>&1 || true
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ fi
|
|||||||
# right and "variable" icons (that come and go) on the left.
|
# right and "variable" icons (that come and go) on the left.
|
||||||
|
|
||||||
set_time() {
|
set_time() {
|
||||||
|
unset TZ
|
||||||
_time_val=" $(date "+${SXMO_STATUS_DATE_FORMAT:-%H:%M}")"
|
_time_val=" $(date "+${SXMO_STATUS_DATE_FORMAT:-%H:%M}")"
|
||||||
_time_dir="${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo_status/${SXMO_STATUS_NAME:-default}"
|
_time_dir="${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo_status/${SXMO_STATUS_NAME:-default}"
|
||||||
if [ -d "$_time_dir" ]; then
|
if [ -d "$_time_dir" ]; then
|
||||||
|
|||||||
@@ -251,10 +251,10 @@ index 69aaa21..d97f0ce 100644
|
|||||||
+#define QCOM_MPM_TIMER_SIZE 0x1000
|
+#define QCOM_MPM_TIMER_SIZE 0x1000
|
||||||
+#define QCOM_MPM_MIN_DELTA_TICKS 19200ULL /* 1 ms @ 19.2 MHz */
|
+#define QCOM_MPM_MIN_DELTA_TICKS 19200ULL /* 1 ms @ 19.2 MHz */
|
||||||
+
|
+
|
||||||
+static bool rpm_sleep = true;
|
+static bool rpm_sleep;
|
||||||
+module_param(rpm_sleep, bool, 0644);
|
+module_param(rpm_sleep, bool, 0644);
|
||||||
+
|
+
|
||||||
+static bool l2_sleep = true;
|
+static bool l2_sleep;
|
||||||
+module_param(l2_sleep, bool, 0644);
|
+module_param(l2_sleep, bool, 0644);
|
||||||
+
|
+
|
||||||
+static bool screen_off;
|
+static bool screen_off;
|
||||||
|
|||||||
@@ -1,31 +1,164 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Bridge Sxmo hooks to the cover display daemon. Safe no-op on non-flip
|
# Bridge Sxmo hooks and cover button call controls to bananarchy-cover-idle.
|
||||||
# devices and when the daemon is not running.
|
# Safe no-op on non-flip devices and when the daemon is not running.
|
||||||
set -u
|
set -u
|
||||||
EVENT="${1:-refresh}"
|
EVENT="${1:-refresh}"
|
||||||
shift 2>/dev/null || true
|
shift 2>/dev/null || true
|
||||||
[ "$(cat /usr/share/bananarchy/lid-profile 2>/dev/null)" = "flip" ] || exit 0
|
|
||||||
|
LID_PROFILE_FILE="${BANANARCHY_LID_PROFILE_FILE:-/usr/share/bananarchy/lid-profile}"
|
||||||
|
COVERCTL_BIN="${BANANARCHY_COVERCTL_BIN:-/usr/bin/bananarchy-coverctl}"
|
||||||
|
CALLSCREEN_FIFO="${BANANARCHY_CALLSCREEN_FIFO:-/tmp/dwm_plugin_callscreen.fifo}"
|
||||||
|
RING_FILE="${BANANARCHY_RINGING_FILE:-/tmp/sxmo_call_ringing}"
|
||||||
|
ACTIVE_CALL_FILE="${BANANARCHY_ACTIVE_CALL_FILE:-/tmp/sxmo_active_call}"
|
||||||
|
|
||||||
|
[ "$(cat "$LID_PROFILE_FILE" 2>/dev/null || true)" = "flip" ] || exit 0
|
||||||
|
|
||||||
|
coverctl() {
|
||||||
|
"$COVERCTL_BIN" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
clean_field() {
|
||||||
|
printf '%s' "${1:-}" | tr '|\r\n' ' ' | sed 's/^ *//; s/ *$//'
|
||||||
|
}
|
||||||
|
|
||||||
|
is_phone_number() {
|
||||||
|
[ -n "${1:-}" ] || return 1
|
||||||
|
printf '%s\n' "$1" | grep -q '^[+0-9*#(). -]*$' && \
|
||||||
|
printf '%s\n' "$1" | grep -q '[0-9]'
|
||||||
|
}
|
||||||
|
|
||||||
|
lookup_contact_name() {
|
||||||
|
raw="$(clean_field "${1:-}")"
|
||||||
|
digits="$(printf '%s' "$raw" | tr -cd '0-9')"
|
||||||
|
[ "${#digits}" -ge 7 ] || return 0
|
||||||
|
cfile="${SXMO_CONTACTFILE:-/home/user/.config/sxmo/contacts.tsv}"
|
||||||
|
[ -r "$cfile" ] || return 0
|
||||||
|
sfx="${digits#"${digits%???????}"}"
|
||||||
|
awk -F '\t' -v d="$digits" -v s="$sfx" '
|
||||||
|
NF >= 2 {
|
||||||
|
c1 = $1
|
||||||
|
gsub(/[^0-9]/, "", c1)
|
||||||
|
name = $2
|
||||||
|
sub(/\r$/, "", name)
|
||||||
|
if (length(c1) >= 7) {
|
||||||
|
c1_sfx = substr(c1, length(c1) - 6)
|
||||||
|
if (c1 == d || c1_sfx == s) {
|
||||||
|
print name
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
' "$cfile" 2>/dev/null || true
|
||||||
|
}
|
||||||
|
|
||||||
|
send_callscreen_fifo() {
|
||||||
|
cmd="${1:-}"
|
||||||
|
[ -n "$cmd" ] || return 0
|
||||||
|
if [ -p "$CALLSCREEN_FIFO" ]; then
|
||||||
|
timeout 1 sh -c 'printf "%s\n" "$1" > "$2"' _ "$cmd" "$CALLSCREEN_FIFO" >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
stop_ring_audio() {
|
||||||
|
killall -q -TERM bananarchy-melody sxmo_vibrate pw-play mpv 2>/dev/null || true
|
||||||
|
rpids="$(pgrep -f '[s]xmo_hook_ring\.sh|[p]w-play.*ring|[m]pv.*ring' 2>/dev/null || true)"
|
||||||
|
[ -n "$rpids" ] && kill -TERM $rpids 2>/dev/null || true
|
||||||
|
}
|
||||||
|
|
||||||
|
run_user_cmd() {
|
||||||
|
ucmd="$1"
|
||||||
|
if [ -n "${BANANARCHY_COVER_TEST_USER_SH:-}" ]; then
|
||||||
|
sh -c "$ucmd" >/dev/null 2>&1 || true
|
||||||
|
elif [ "$(id -u)" -eq 0 ]; then
|
||||||
|
su -s /bin/sh user -c "export HOME=/home/user XDG_RUNTIME_DIR=/run/user/10000 XDG_CONFIG_HOME=/home/user/.config DISPLAY=:0 SXMO_STATE=/run/user/10000/sxmo.state PATH=/home/user/.config/sxmo/hooks:/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin; $ucmd" </dev/null >/dev/null 2>&1 || true
|
||||||
|
else
|
||||||
|
sh -c "$ucmd" </dev/null >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
case "$EVENT" in
|
case "$EVENT" in
|
||||||
notification)
|
notification)
|
||||||
/usr/bin/bananarchy-coverctl NOTIFY "Notification" >/dev/null 2>&1 || true
|
coverctl NOTIFY "Notification" >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
ring)
|
ring)
|
||||||
/usr/bin/bananarchy-coverctl CALL incoming "${1:--}" "-" >/dev/null 2>&1 || true
|
arg1="$(clean_field "${1:-}")"
|
||||||
|
sim="$(clean_field "${2:-}")"
|
||||||
|
case "$arg1" in
|
||||||
|
"[SIM1] "*|"[SIM1]")
|
||||||
|
[ -z "$sim" ] && sim="SIM1"
|
||||||
|
arg1="$(clean_field "${arg1#"[SIM1]"}")"
|
||||||
|
;;
|
||||||
|
"[SIM2] "*|"[SIM2]")
|
||||||
|
[ -z "$sim" ] && sim="SIM2"
|
||||||
|
arg1="$(clean_field "${arg1#"[SIM2]"}")"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
num="-"
|
||||||
|
name="-"
|
||||||
|
if [ -n "$arg1" ] && [ "$arg1" != "-" ]; then
|
||||||
|
if is_phone_number "$arg1"; then
|
||||||
|
num="$arg1"
|
||||||
|
resolved="$(clean_field "$(lookup_contact_name "$num")")"
|
||||||
|
[ -n "$resolved" ] && name="$resolved"
|
||||||
|
else
|
||||||
|
name="$arg1"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
[ -n "$sim" ] || sim="-"
|
||||||
|
coverctl CALL "incoming|${num}|${name}|${sim}" >/dev/null 2>&1 || true
|
||||||
|
;;
|
||||||
|
muted)
|
||||||
|
num="$(clean_field "${1:--}")"
|
||||||
|
name="$(clean_field "${2:--}")"
|
||||||
|
sim="$(clean_field "${3:--}")"
|
||||||
|
[ -n "$num" ] || num="-"
|
||||||
|
[ -n "$name" ] || name="-"
|
||||||
|
[ -n "$sim" ] || sim="-"
|
||||||
|
coverctl CALL "muted|${num}|${name}|${sim}" >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
missed)
|
missed)
|
||||||
/usr/bin/bananarchy-coverctl CALL missed "${1:--}" "-" >/dev/null 2>&1 || true
|
who="$(clean_field "${1:--}")"
|
||||||
|
[ -n "$who" ] || who="-"
|
||||||
|
coverctl CALL "missed|${who}|-|-" >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
call|active)
|
call|active)
|
||||||
/usr/bin/bananarchy-coverctl CALL active "${1:--}" "-" >/dev/null 2>&1 || true
|
num="$(clean_field "${1:--}")"
|
||||||
|
name="$(clean_field "${2:--}")"
|
||||||
|
sim="$(clean_field "${3:--}")"
|
||||||
|
[ -n "$num" ] || num="-"
|
||||||
|
[ -n "$name" ] || name="-"
|
||||||
|
[ -n "$sim" ] || sim="-"
|
||||||
|
coverctl CALL "active|${num}|${name}|${sim}" >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
hangup|ended)
|
hangup|ended)
|
||||||
/usr/bin/bananarchy-coverctl CALL none "-" "-" >/dev/null 2>&1 || true
|
coverctl CALL "none|-|-|-" >/dev/null 2>&1 || true
|
||||||
|
;;
|
||||||
|
mute-ring)
|
||||||
|
stop_ring_audio
|
||||||
|
for f in /run/user/10000/sxmo_calls/*.monitoredcall /run/user/10000/sxmo_calls/*.ringing-in; do
|
||||||
|
[ -e "$f" ] || continue
|
||||||
|
touch "${f%.*}.mutedring" 2>/dev/null || true
|
||||||
|
done
|
||||||
|
send_callscreen_fifo "MUTE_RING"
|
||||||
|
run_user_cmd "sxmo_jobs.sh stop ringing >/dev/null 2>&1 || true; sxmo_hook_mute_ring.sh >/dev/null 2>&1 || true"
|
||||||
|
;;
|
||||||
|
hangup-call)
|
||||||
|
rm -f "$RING_FILE" "$ACTIVE_CALL_FILE" 2>/dev/null || true
|
||||||
|
stop_ring_audio
|
||||||
|
send_callscreen_fifo "HANGUP_CLOSE"
|
||||||
|
if [ -x /usr/libexec/msm-modem-uim-selection ]; then
|
||||||
|
timeout 2 /usr/libexec/msm-modem-uim-selection call-hangup all >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
if command -v mmcli >/dev/null 2>&1; then
|
||||||
|
timeout 2 mmcli -m any --voice-hangup-all >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
run_user_cmd "sxmo_modemcall.sh hangup all >/dev/null 2>&1 || true; sxmo_hook_discard.sh >/dev/null 2>&1 || true"
|
||||||
;;
|
;;
|
||||||
sms)
|
sms)
|
||||||
/usr/bin/bananarchy-coverctl SMS "${1:-1}" >/dev/null 2>&1 || true
|
coverctl SMS "${1:-1}" >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
screenoff)
|
screenoff)
|
||||||
/usr/bin/bananarchy-coverctl REFRESH >/dev/null 2>&1 || true
|
coverctl REFRESH >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
network)
|
network)
|
||||||
/usr/bin/bananarchy-cover-status.sh >/dev/null 2>&1 || true
|
/usr/bin/bananarchy-cover-status.sh >/dev/null 2>&1 || true
|
||||||
@@ -33,17 +166,17 @@ case "$EVENT" in
|
|||||||
button)
|
button)
|
||||||
# Trusted external side-button wake (also sent directly by
|
# Trusted external side-button wake (also sent directly by
|
||||||
# bananarchy-volume-keys when the flip is closed).
|
# bananarchy-volume-keys when the flip is closed).
|
||||||
/usr/bin/bananarchy-coverctl BUTTON >/dev/null 2>&1 || true
|
coverctl BUTTON >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
wake)
|
wake)
|
||||||
# Every blocked main-panel wake request is forwarded here by the lid gate.
|
# Every blocked main-panel wake request is forwarded here by the lid gate.
|
||||||
/usr/bin/bananarchy-coverctl WAKE >/dev/null 2>&1 || true
|
coverctl WAKE >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
refresh|theme)
|
refresh|theme)
|
||||||
/usr/bin/bananarchy-coverctl RELOAD_THEME >/dev/null 2>&1 || true
|
coverctl RELOAD_THEME >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
/usr/bin/bananarchy-coverctl REFRESH >/dev/null 2>&1 || true
|
coverctl REFRESH >/dev/null 2>&1 || true
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
exit 0
|
exit 0
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Executable
+224
@@ -0,0 +1,224 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Cross-compile libneoui.so, dwm plugins (*.so except dmenu.so), and plugin
|
||||||
|
# helper binaries for armv7 without recompiling dwm/st/dmenu.so.
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
BASE_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
ROOTFS_DIR="${ROOTFS_DIR:-$BASE_DIR/rootfs}"
|
||||||
|
if [ -e "$ROOTFS_DIR" ]; then
|
||||||
|
ROOTFS_DIR="$(realpath "$ROOTFS_DIR")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec docker run --rm --network=host \
|
||||||
|
-e HOST_UID="$(id -u)" \
|
||||||
|
-e HOST_GID="$(id -g)" \
|
||||||
|
-v "$BASE_DIR:/bananarchy" \
|
||||||
|
-v "$ROOTFS_DIR:/target-rootfs" \
|
||||||
|
alpine:3.24 sh -eu -c '
|
||||||
|
cat > /etc/apk/repositories <<EOF
|
||||||
|
http://mirror.nura.eco/postmarketos/v26.06
|
||||||
|
https://dl-cdn.alpinelinux.org/alpine/edge/main
|
||||||
|
https://dl-cdn.alpinelinux.org/alpine/edge/community
|
||||||
|
https://dl-cdn.alpinelinux.org/alpine/edge/testing
|
||||||
|
EOF
|
||||||
|
cp /bananarchy/keys/* /etc/apk/keys/
|
||||||
|
|
||||||
|
echo "[1/4] Installing host cross-compilation toolchain..."
|
||||||
|
apk add --no-cache \
|
||||||
|
build-base \
|
||||||
|
gcc-armv7 \
|
||||||
|
g++-armv7 \
|
||||||
|
binutils-armv7 \
|
||||||
|
pkgconf >/dev/null
|
||||||
|
|
||||||
|
echo "[2/4] Preparing armv7 sysroot..."
|
||||||
|
SYSROOT="/tmp/armv7-sysroot"
|
||||||
|
mkdir -p "$SYSROOT/etc/apk/keys"
|
||||||
|
cp /etc/apk/repositories "$SYSROOT/etc/apk/repositories"
|
||||||
|
cp /etc/apk/keys/* "$SYSROOT/etc/apk/keys/"
|
||||||
|
apk --root "$SYSROOT" --initdb --arch armv7 add --no-scripts \
|
||||||
|
alpine-baselayout \
|
||||||
|
musl-dev \
|
||||||
|
linux-headers \
|
||||||
|
alsa-lib-dev \
|
||||||
|
libx11-dev \
|
||||||
|
libxfixes-dev \
|
||||||
|
libxft-dev \
|
||||||
|
libxinerama-dev \
|
||||||
|
libxext-dev \
|
||||||
|
libxrender-dev \
|
||||||
|
libxcb-dev \
|
||||||
|
xcb-util-dev \
|
||||||
|
fontconfig-dev \
|
||||||
|
freetype-dev \
|
||||||
|
harfbuzz-dev \
|
||||||
|
pango-dev \
|
||||||
|
glib-dev \
|
||||||
|
cairo-dev \
|
||||||
|
libjpeg-turbo-dev \
|
||||||
|
libpng-dev \
|
||||||
|
openssl-dev \
|
||||||
|
opus-dev \
|
||||||
|
gsm-dev \
|
||||||
|
toxcore-dev \
|
||||||
|
gtk+3.0-dev \
|
||||||
|
webkit2gtk-4.1-dev \
|
||||||
|
libwpe-dev \
|
||||||
|
libwpebackend-fdo-dev >/dev/null
|
||||||
|
|
||||||
|
export PKG_CONFIG_SYSROOT_DIR="$SYSROOT"
|
||||||
|
export PKG_CONFIG_LIBDIR="$SYSROOT/usr/lib/pkgconfig:$SYSROOT/usr/share/pkgconfig"
|
||||||
|
CC="armv7-alpine-linux-musleabihf-gcc --sysroot=$SYSROOT"
|
||||||
|
CXX="armv7-alpine-linux-musleabihf-g++ --sysroot=$SYSROOT"
|
||||||
|
STRIP="armv7-alpine-linux-musleabihf-strip"
|
||||||
|
OPT_CFLAGS="-O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -fno-plt -fomit-frame-pointer"
|
||||||
|
|
||||||
|
echo "[3/4] Compiling NeoUI SDK shared library (libneoui.so)..."
|
||||||
|
mkdir -p /bananarchy/prebuilt/sxmo-x11/usr/lib \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/include \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/bin \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins
|
||||||
|
PLUG_INCS="$(pkgconf --cflags x11 xfixes xft fontconfig freetype2 pango pangoxft alsa libjpeg libpng) -I/bananarchy/src/neoui"
|
||||||
|
PLUG_LIBS="$(pkgconf --libs x11 xfixes xft fontconfig freetype2 pango pangoxft alsa)"
|
||||||
|
MEDIA_LIBS="$(pkgconf --libs libjpeg libpng)"
|
||||||
|
CXX_PLUG_FLAGS="$OPT_CFLAGS -fPIC -shared -std=c++20 -Wall -Wextra -Wno-psabi"
|
||||||
|
|
||||||
|
$CXX $CXX_PLUG_FLAGS -Wl,-soname,libneoui.so $PLUG_INCS \
|
||||||
|
/bananarchy/src/neoui/neoui.cpp $PLUG_LIBS $MEDIA_LIBS \
|
||||||
|
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/libneoui.so
|
||||||
|
cp -f /bananarchy/src/neoui/neoui.h /bananarchy/prebuilt/sxmo-x11/usr/include/neoui.h
|
||||||
|
cp -f /bananarchy/src/neoui/neoui.h "$SYSROOT/usr/include/neoui.h"
|
||||||
|
cp -f /bananarchy/prebuilt/sxmo-x11/usr/lib/libneoui.so "$SYSROOT/usr/lib/libneoui.so"
|
||||||
|
NEOUI_LIBS="-L/bananarchy/prebuilt/sxmo-x11/usr/lib -lneoui"
|
||||||
|
|
||||||
|
echo "[4/4] Compiling DWM Plugins and helper binaries (dwm untouched)..."
|
||||||
|
pids=""
|
||||||
|
|
||||||
|
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||||
|
/bananarchy/src/xdrawer/xdrawer.cpp $NEOUI_LIBS $PLUG_LIBS \
|
||||||
|
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/xdrawer.so &
|
||||||
|
pids="$pids $!"
|
||||||
|
|
||||||
|
for plug in dialer calllog callscreen contacts sms themes modem networks ringtones music passcode engmenu privacy; do
|
||||||
|
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||||
|
"/bananarchy/src/dwm-plugins/${plug}_plugin.cpp" $NEOUI_LIBS $PLUG_LIBS \
|
||||||
|
-o "/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/${plug}.so" &
|
||||||
|
pids="$pids $!"
|
||||||
|
done
|
||||||
|
|
||||||
|
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||||
|
/bananarchy/src/dwm-plugins/files_plugin.cpp $NEOUI_LIBS $PLUG_LIBS $MEDIA_LIBS \
|
||||||
|
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/files.so &
|
||||||
|
pids="$pids $!"
|
||||||
|
|
||||||
|
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||||
|
/bananarchy/src/dwm-plugins/camera_plugin.cpp $NEOUI_LIBS $PLUG_LIBS $MEDIA_LIBS -lpthread \
|
||||||
|
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/camera.so &
|
||||||
|
pids="$pids $!"
|
||||||
|
|
||||||
|
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||||
|
/bananarchy/src/dwm-plugins/wallpapers_plugin.cpp $NEOUI_LIBS $PLUG_LIBS $MEDIA_LIBS \
|
||||||
|
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/wallpapers.so &
|
||||||
|
pids="$pids $!"
|
||||||
|
|
||||||
|
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||||
|
/bananarchy/src/dwm-plugins/locker_plugin.cpp $NEOUI_LIBS $PLUG_LIBS -lcrypt \
|
||||||
|
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/locker.so &
|
||||||
|
pids="$pids $!"
|
||||||
|
|
||||||
|
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||||
|
/bananarchy/src/dwm-plugins/sip_plugin.cpp $NEOUI_LIBS $PLUG_LIBS -lssl -lcrypto -lopus -lgsm -lpthread \
|
||||||
|
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/sip.so &
|
||||||
|
pids="$pids $!"
|
||||||
|
|
||||||
|
for ssl_plug in email irc smallweb; do
|
||||||
|
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||||
|
"/bananarchy/src/dwm-plugins/${ssl_plug}_plugin.cpp" $NEOUI_LIBS $PLUG_LIBS -lssl -lcrypto \
|
||||||
|
-o "/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/${ssl_plug}.so" &
|
||||||
|
pids="$pids $!"
|
||||||
|
done
|
||||||
|
|
||||||
|
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||||
|
/bananarchy/src/dwm-plugins/tox_plugin.cpp $NEOUI_LIBS $PLUG_LIBS -ltoxcore -lpthread \
|
||||||
|
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/tox.so &
|
||||||
|
pids="$pids $!"
|
||||||
|
|
||||||
|
WEBARCHY_INCS="$(pkgconf --cflags webkit2gtk-4.1 gtk+-3.0 wpe-1.0 wpebackend-fdo-1.0)"
|
||||||
|
WEBARCHY_LIBS="$(pkgconf --libs webkit2gtk-4.1 gtk+-3.0 wpe-1.0 wpebackend-fdo-1.0)"
|
||||||
|
$CXX $CXX_PLUG_FLAGS $PLUG_INCS $WEBARCHY_INCS \
|
||||||
|
/bananarchy/src/dwm-plugins/webarchy_plugin.cpp $NEOUI_LIBS $PLUG_LIBS $WEBARCHY_LIBS \
|
||||||
|
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/webarchy.so &
|
||||||
|
pids="$pids $!"
|
||||||
|
|
||||||
|
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||||
|
/bananarchy/src/dwm-plugins/gps_plugin.cpp $NEOUI_LIBS $PLUG_LIBS $MEDIA_LIBS -lssl -lcrypto -lpthread \
|
||||||
|
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/gps.so &
|
||||||
|
pids="$pids $!"
|
||||||
|
|
||||||
|
for pid in $pids; do
|
||||||
|
wait "$pid"
|
||||||
|
done
|
||||||
|
|
||||||
|
$STRIP --strip-unneeded \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/libneoui.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/xdrawer.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/dialer.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/calllog.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/callscreen.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/contacts.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/sms.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/files.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/camera.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/themes.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/modem.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/networks.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/ringtones.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/wallpapers.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/music.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/locker.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/sip.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/email.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/irc.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/tox.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/smallweb.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/webarchy.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/gps.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/passcode.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/engmenu.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/privacy.so
|
||||||
|
|
||||||
|
$CC $OPT_CFLAGS -std=c99 -D_DEFAULT_SOURCE -Wall -Wextra \
|
||||||
|
/bananarchy/src/dwm-plugins/dwm_plugin_runner.c -ldl \
|
||||||
|
-o /bananarchy/prebuilt/sxmo-x11/usr/bin/dwm-plugin
|
||||||
|
$STRIP --strip-unneeded /bananarchy/prebuilt/sxmo-x11/usr/bin/dwm-plugin
|
||||||
|
|
||||||
|
$CC $OPT_CFLAGS -std=c99 -D_DEFAULT_SOURCE -Wall -Wextra \
|
||||||
|
/bananarchy/src/dwm-plugins/sxmo_vibrate.c \
|
||||||
|
-o /bananarchy/prebuilt/sxmo-x11/usr/bin/sxmo_vibrate
|
||||||
|
$STRIP --strip-unneeded /bananarchy/prebuilt/sxmo-x11/usr/bin/sxmo_vibrate
|
||||||
|
|
||||||
|
$CC $OPT_CFLAGS -std=c99 -D_DEFAULT_SOURCE -Wall -Wextra \
|
||||||
|
/bananarchy/src/dwm-plugins/verify_passcode.c -lcrypt \
|
||||||
|
-o /bananarchy/prebuilt/sxmo-x11/usr/bin/bananarchy-verify-passcode
|
||||||
|
$STRIP --strip-unneeded /bananarchy/prebuilt/sxmo-x11/usr/bin/bananarchy-verify-passcode
|
||||||
|
|
||||||
|
$CC $OPT_CFLAGS -std=c99 -D_DEFAULT_SOURCE -Wall -Wextra \
|
||||||
|
/bananarchy/src/dwm-plugins/engmenu_exec.c \
|
||||||
|
-o /bananarchy/prebuilt/sxmo-x11/usr/bin/bananarchy-engmenu-exec
|
||||||
|
$STRIP --strip-unneeded /bananarchy/prebuilt/sxmo-x11/usr/bin/bananarchy-engmenu-exec
|
||||||
|
chmod 4755 /bananarchy/prebuilt/sxmo-x11/usr/bin/bananarchy-engmenu-exec
|
||||||
|
|
||||||
|
$CXX $OPT_CFLAGS -std=c++20 -Wall -Wextra \
|
||||||
|
/bananarchy/src/dwm-plugins/bananarchy_melody.cpp -lm \
|
||||||
|
-o /bananarchy/prebuilt/sxmo-x11/usr/bin/bananarchy-melody
|
||||||
|
$STRIP --strip-unneeded /bananarchy/prebuilt/sxmo-x11/usr/bin/bananarchy-melody
|
||||||
|
|
||||||
|
chown -R "$HOST_UID:$HOST_GID" \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11 \
|
||||||
|
/bananarchy/src/neoui \
|
||||||
|
/bananarchy/src/xdrawer \
|
||||||
|
/bananarchy/src/dwm-plugins
|
||||||
|
ls -lh /bananarchy/prebuilt/sxmo-x11/usr/lib/libneoui.so \
|
||||||
|
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/*.so
|
||||||
|
'
|
||||||
|
"$BASE_DIR/scripts/sync-prebuilt-overlay.sh"
|
||||||
@@ -397,8 +397,8 @@ fi
|
|||||||
|
|
||||||
echo "[check] Known-good flashable image set..."
|
echo "[check] Known-good flashable image set..."
|
||||||
for pair in \
|
for pair in \
|
||||||
"d913b7fe328b3d8c0be242e5d2666d6f03453c565ddc1120ef59698f4445e079 images/bananarchy-nokia-argon.img" \
|
"7b39e0ef4cbfc169a4fa0eeda5641ed59df7644b5e5265f8f3f5b25e7f3a8e41 images/bananarchy-nokia-argon.img" \
|
||||||
"d290476ba796abc4eb36eeacb0f6312fe3e33623f7a38b2c607a609808fe4f5e images/bananarchy-nokia-beatles.img" \
|
"19f605dbb5a80ca073895a7ed41149a1a7692c79f12f399bff1e61d497daf069 images/bananarchy-nokia-beatles.img" \
|
||||||
"7920fae28fa3389602be16a02ad7311b50e61c9c205be48f160307d594f65eb6 images/boot-bananarchy-nokia-beatles.img" \
|
"7920fae28fa3389602be16a02ad7311b50e61c9c205be48f160307d594f65eb6 images/boot-bananarchy-nokia-beatles.img" \
|
||||||
"b5549698c20f4de7603fc746d32bb5baa96ec377e41e74407823c98506fc185d images/boot-lk2nd-nokia-beatles-display.img"; do
|
"b5549698c20f4de7603fc746d32bb5baa96ec377e41e74407823c98506fc185d images/boot-lk2nd-nokia-beatles-display.img"; do
|
||||||
set -- $pair
|
set -- $pair
|
||||||
@@ -1233,10 +1233,10 @@ for dts in \
|
|||||||
fail "${dts#"$BASE_DIR/"} is missing MSM8909 interconnect/GPU-BIMC/OPP bandwidth nodes or 0x25800 floor"
|
fail "${dts#"$BASE_DIR/"} is missing MSM8909 interconnect/GPU-BIMC/OPP bandwidth nodes or 0x25800 floor"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if ! grep -qxF 'MODEM_DRX_MODE=6' "$BASE_DIR/overlay/rootfs/etc/bananarchy-power-policy.conf" || \
|
if ! grep -qxF 'MODEM_DRX_MODE=0' "$BASE_DIR/overlay/rootfs/etc/bananarchy-power-policy.conf" || \
|
||||||
! grep -qxF 'DSDS_SECONDARY_MODE=active' "$BASE_DIR/overlay/rootfs/etc/bananarchy-power-policy.conf" || \
|
! grep -qxF 'DSDS_SECONDARY_MODE=active' "$BASE_DIR/overlay/rootfs/etc/bananarchy-power-policy.conf" || \
|
||||||
! grep -qxF 'CPU_RPM_SLEEP=1' "$BASE_DIR/overlay/rootfs/etc/bananarchy-power-policy.conf" || \
|
! grep -qxF 'CPU_RPM_SLEEP=0' "$BASE_DIR/overlay/rootfs/etc/bananarchy-power-policy.conf" || \
|
||||||
! grep -qxF 'CPU_L2_SLEEP=1' "$BASE_DIR/overlay/rootfs/etc/bananarchy-power-policy.conf" || \
|
! grep -qxF 'CPU_L2_SLEEP=0' "$BASE_DIR/overlay/rootfs/etc/bananarchy-power-policy.conf" || \
|
||||||
! grep -qxF 'WIFI_SCREEN_OFF_IPV6_MUTE=1' "$BASE_DIR/overlay/rootfs/etc/bananarchy-power-policy.conf" || \
|
! grep -qxF 'WIFI_SCREEN_OFF_IPV6_MUTE=1' "$BASE_DIR/overlay/rootfs/etc/bananarchy-power-policy.conf" || \
|
||||||
! grep -qxF 'WIFI_STANDBY_RAT=keep' "$BASE_DIR/overlay/rootfs/etc/bananarchy-power-policy.conf" || \
|
! grep -qxF 'WIFI_STANDBY_RAT=keep' "$BASE_DIR/overlay/rootfs/etc/bananarchy-power-policy.conf" || \
|
||||||
! grep -qF 'if [ "$port" = "all" ]; then' "$BASE_DIR/overlay/rootfs/usr/libexec/msm-modem-uim-selection" || \
|
! grep -qF 'if [ "$port" = "all" ]; then' "$BASE_DIR/overlay/rootfs/usr/libexec/msm-modem-uim-selection" || \
|
||||||
@@ -1255,10 +1255,20 @@ if ! grep -qxF 'MODEM_DRX_MODE=6' "$BASE_DIR/overlay/rootfs/etc/bananarchy-power
|
|||||||
"$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-display-power-sync" || \
|
"$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-display-power-sync" || \
|
||||||
! grep -qF 'SPM_SCREEN_OFF_PATH=/sys/module/cpuidle_qcom_spm/parameters/screen_off' \
|
! grep -qF 'SPM_SCREEN_OFF_PATH=/sys/module/cpuidle_qcom_spm/parameters/screen_off' \
|
||||||
"$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-display-power-sync" || \
|
"$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-display-power-sync" || \
|
||||||
|
! grep -qF 'SPM_RPM_SLEEP_PATH=/sys/module/cpuidle_qcom_spm/parameters/rpm_sleep' \
|
||||||
|
"$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-display-power-sync" || \
|
||||||
|
! grep -qF 'sync_spm_screen_off' \
|
||||||
|
"$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-display-power-sync" || \
|
||||||
! grep -qF 'sync_schedutil_rate_limit' \
|
! grep -qF 'sync_schedutil_rate_limit' \
|
||||||
"$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-display-power-sync"; then
|
"$BASE_DIR/overlay/rootfs/usr/bin/bananarchy-display-power-sync"; then
|
||||||
fail "userspace DSDS DRX, compiled C daemons, CPU/L2/Wi-Fi power policy, or wcn36xx screen_off_offload sync is missing"
|
fail "userspace DSDS DRX, compiled C daemons, CPU/L2/Wi-Fi power policy, or wcn36xx screen_off_offload sync is missing"
|
||||||
fi
|
fi
|
||||||
|
if [ "$(grep -c 'sxmo_modem\.voicecalls\.lock' "$BASE_DIR/overlay/rootfs/usr/bin/sxmo_modem.sh" 2>/dev/null || echo 0)" -lt 2 ] || \
|
||||||
|
! grep -qF 'is_recent_hangup_requested' "$BASE_DIR/overlay/rootfs/usr/bin/sxmo_modem.sh" || \
|
||||||
|
! grep -qF 'alreadyClosedBlanked' "$BASE_DIR/src/dwm-plugins/locker_plugin.cpp" || \
|
||||||
|
! grep -qF 'lastRejectedCallId' "$BASE_DIR/src/dwm-plugins/callscreen_plugin.cpp"; then
|
||||||
|
fail "voice call lock serialization, stale hangup expiry, or closed-flip hangup guard is missing"
|
||||||
|
fi
|
||||||
echo "[check] ZRAM, NetworkManager DNS filter, and target pkill cleanup..."
|
echo "[check] ZRAM, NetworkManager DNS filter, and target pkill cleanup..."
|
||||||
ZRAMSTART="$BASE_DIR/overlay/rootfs/usr/bin/zramstart"
|
ZRAMSTART="$BASE_DIR/overlay/rootfs/usr/bin/zramstart"
|
||||||
NM_DNS_FILTER="$BASE_DIR/overlay/rootfs/usr/lib/NetworkManager/dispatcher.d/50-dns-filter.sh"
|
NM_DNS_FILTER="$BASE_DIR/overlay/rootfs/usr/lib/NetworkManager/dispatcher.d/50-dns-filter.sh"
|
||||||
@@ -1708,6 +1718,11 @@ if [ -x "$BASE_DIR/scripts/test-gps-time-sync.py" ] && \
|
|||||||
! "$BASE_DIR/scripts/test-gps-time-sync.py" >/dev/null 2>&1; then
|
! "$BASE_DIR/scripts/test-gps-time-sync.py" >/dev/null 2>&1; then
|
||||||
fail "host GPS-only time source test failed"
|
fail "host GPS-only time source test failed"
|
||||||
fi
|
fi
|
||||||
|
if [ -x "$BASE_DIR/scripts/test-time-timezone-sync.py" ] && \
|
||||||
|
command -v python3 >/dev/null 2>&1 && \
|
||||||
|
! "$BASE_DIR/scripts/test-time-timezone-sync.py" >/dev/null 2>&1; then
|
||||||
|
fail "host network time and live timezone sync test failed"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "[check] Cover display behaviour..."
|
echo "[check] Cover display behaviour..."
|
||||||
COVER_SRC="$BASE_DIR/src/bananarchy-daemons/bananarchy-cover-idle.c"
|
COVER_SRC="$BASE_DIR/src/bananarchy-daemons/bananarchy-cover-idle.c"
|
||||||
@@ -1746,6 +1761,11 @@ if ! grep -qF 'bananarchy-cover-status.sh' "$COVER_EVENT" || \
|
|||||||
! grep -qF 'network)' "$COVER_EVENT"; then
|
! grep -qF 'network)' "$COVER_EVENT"; then
|
||||||
fail "cover event bridge lost the network/button commands"
|
fail "cover event bridge lost the network/button commands"
|
||||||
fi
|
fi
|
||||||
|
for token in 'mute-ring)' 'hangup-call)' 'HANGUP_CLOSE' 'MUTE_RING'; do
|
||||||
|
if ! grep -qF -- "$token" "$COVER_EVENT"; then
|
||||||
|
fail "cover event bridge is missing closed-flip call control: $token"
|
||||||
|
fi
|
||||||
|
done
|
||||||
if ! grep -qF 'bananarchy-cover-event.sh network' "$NET_EVENT" || \
|
if ! grep -qF 'bananarchy-cover-event.sh network' "$NET_EVENT" || \
|
||||||
! grep -qF 'bananarchy-cover-event.sh network' "$COVER_INIT"; then
|
! grep -qF 'bananarchy-cover-event.sh network' "$COVER_INIT"; then
|
||||||
fail "network indicators are not published to the cover daemon"
|
fail "network indicators are not published to the cover daemon"
|
||||||
@@ -1907,6 +1927,27 @@ if ! grep -qF 'parser.add_argument("--dtb"' \
|
|||||||
fail "sync-beatles-bootfs.py lost its DTB/boot-image overrides"
|
fail "sync-beatles-bootfs.py lost its DTB/boot-image overrides"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "[check] Lock call-preservation and Power menu hygiene..."
|
||||||
|
LOCK_HOOK="$BASE_DIR/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_lock.sh"
|
||||||
|
if grep -qF 'HANGUP_CLOSE' "$LOCK_HOOK"; then
|
||||||
|
fail "sxmo_hook_lock.sh still contains HANGUP_CLOSE call termination"
|
||||||
|
fi
|
||||||
|
for f in "$DMENU_SRC" \
|
||||||
|
"$BASE_DIR/overlay/rootfs/usr/bin/sxmo_appmenu.sh" \
|
||||||
|
"$BASE_DIR/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_contextmenu.sh"; do
|
||||||
|
if grep -qF 'Logout' "$f" || grep -qF 'confirm_logout' "$f"; then
|
||||||
|
fail "${f#"$BASE_DIR/"} still exposes the removed Logout menu item"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if ! grep -qF 'isLiveSxmoCallFile' "$BASE_DIR/src/dwm-plugins/phone_data.h" || \
|
||||||
|
! grep -qF 'isLiveSxmoCallFile' "$BASE_DIR/src/dwm-plugins/callscreen_plugin.cpp" || \
|
||||||
|
! grep -qF 'is_live_sxmo_call_file' "$DMENU_SRC" || \
|
||||||
|
! grep -qF 'isLiveSxmoCallFileNeoui' "$BASE_DIR/src/neoui/neoui.cpp" || \
|
||||||
|
! grep -qF 'isLiveSxmoCallFileXdrawer' "$BASE_DIR/src/xdrawer/xdrawer.cpp" || \
|
||||||
|
! grep -qF 'is_live_call_entry' "$BASE_DIR/src/bananarchy-daemons/bananarchy-dsds.c"; then
|
||||||
|
fail "one or more sxmo_calls readers lost post-call marker filtering"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$FAILURES" -ne 0 ]; then
|
if [ "$FAILURES" -ne 0 ]; then
|
||||||
echo "[check] $FAILURES check(s) failed."
|
echo "[check] $FAILURES check(s) failed."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
+169
-1
@@ -27,7 +27,7 @@ FRAME_SIZE = FB_WIDTH * FB_HEIGHT * (FB_BPP // 8)
|
|||||||
|
|
||||||
|
|
||||||
class Cover:
|
class Cover:
|
||||||
def __init__(self, root, exe, config, main_cfg, lid_state=None):
|
def __init__(self, root, exe, config, main_cfg, lid_state=None, extra_env=None):
|
||||||
self.root = root
|
self.root = root
|
||||||
self.sock_path = root / "cover.sock"
|
self.sock_path = root / "cover.sock"
|
||||||
self.fb = root / "fb1"
|
self.fb = root / "fb1"
|
||||||
@@ -43,6 +43,8 @@ class Cover:
|
|||||||
})
|
})
|
||||||
if lid_state is not None:
|
if lid_state is not None:
|
||||||
self.env["BANANARCHY_COVER_LID_STATE"] = str(lid_state)
|
self.env["BANANARCHY_COVER_LID_STATE"] = str(lid_state)
|
||||||
|
if extra_env:
|
||||||
|
self.env.update(extra_env)
|
||||||
self.proc = subprocess.Popen([str(exe), "--config", str(config)],
|
self.proc = subprocess.Popen([str(exe), "--config", str(config)],
|
||||||
env=self.env, stdout=subprocess.DEVNULL,
|
env=self.env, stdout=subprocess.DEVNULL,
|
||||||
stderr=subprocess.DEVNULL)
|
stderr=subprocess.DEVNULL)
|
||||||
@@ -329,6 +331,172 @@ def main():
|
|||||||
os.close(keep_w)
|
os.close(keep_w)
|
||||||
finally:
|
finally:
|
||||||
daemon2.close()
|
daemon2.close()
|
||||||
|
|
||||||
|
sub3 = root / "run3"
|
||||||
|
sub3.mkdir()
|
||||||
|
main_cfg3 = sub3 / "sxmo.noidle"
|
||||||
|
main_cfg3.write_text("1\n")
|
||||||
|
events_log = sub3 / "cover-events.log"
|
||||||
|
event_stub = sub3 / "cover-event-stub.sh"
|
||||||
|
event_stub.write_text(
|
||||||
|
"#!/bin/sh\n"
|
||||||
|
f'printf "%s\\n" "$*" >> "{events_log}"\n',
|
||||||
|
encoding="utf-8",
|
||||||
|
)
|
||||||
|
event_stub.chmod(0o755)
|
||||||
|
lt_path = sub3 / "localtime"
|
||||||
|
tz_file = sub3 / "timezone"
|
||||||
|
utc_zi = pathlib.Path("/usr/share/zoneinfo/UTC")
|
||||||
|
ny_zi = pathlib.Path("/usr/share/zoneinfo/America/New_York")
|
||||||
|
lt_path.symlink_to(utc_zi)
|
||||||
|
tz_file.write_text("UTC\n", encoding="utf-8")
|
||||||
|
cfg3 = sub3 / "cover.conf"
|
||||||
|
cfg3.write_text(
|
||||||
|
"enabled = 1\n"
|
||||||
|
"backend = fb\n"
|
||||||
|
"blank_timeout = 1\n"
|
||||||
|
f"socket_path = {sub3 / 'cover.sock'}\n"
|
||||||
|
f"fb_device = {sub3 / 'fb1'}\n"
|
||||||
|
f"backlight_path = {sub3 / 'backlight'}\n"
|
||||||
|
"brightness = 160\n",
|
||||||
|
encoding="utf-8",
|
||||||
|
)
|
||||||
|
daemon3 = Cover(
|
||||||
|
sub3,
|
||||||
|
exe,
|
||||||
|
cfg3,
|
||||||
|
main_cfg3,
|
||||||
|
extra_env={
|
||||||
|
"BANANARCHY_COVER_EVENT_CMD": str(event_stub),
|
||||||
|
"BANANARCHY_TZ_LOCALTIME": str(lt_path),
|
||||||
|
"BANANARCHY_TZ_FILE": str(tz_file),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
daemon3.send("LID CLOSED")
|
||||||
|
daemon3.send("CALL incoming|+380501234567|Alice|SIM1")
|
||||||
|
if not wait_for(
|
||||||
|
lambda: "call=incoming" in daemon3.send("STATUS") and
|
||||||
|
"visible=1" in daemon3.send("STATUS"),
|
||||||
|
timeout=3,
|
||||||
|
):
|
||||||
|
sys.stderr.write("FAIL: CALL incoming did not wake cover cleanly\n")
|
||||||
|
return 1
|
||||||
|
# Cover must stay lit past the 1 s blank timeout while incoming call rings.
|
||||||
|
time.sleep(1.25)
|
||||||
|
if not daemon3.frame()[1] or "visible=1" not in daemon3.send("STATUS"):
|
||||||
|
sys.stderr.write("FAIL: cover blanked during active incoming call\n")
|
||||||
|
return 1
|
||||||
|
daemon3.send("BUTTON VOLUP")
|
||||||
|
if not wait_for(lambda: "call=muted" in daemon3.send("STATUS"), timeout=3):
|
||||||
|
sys.stderr.write("FAIL: BUTTON VOLUP did not mute incoming call\n")
|
||||||
|
return 1
|
||||||
|
if not wait_for(
|
||||||
|
lambda: events_log.exists() and "mute-ring" in events_log.read_text(),
|
||||||
|
timeout=2,
|
||||||
|
):
|
||||||
|
sys.stderr.write("FAIL: BUTTON VOLUP did not invoke mute-ring bridge\n")
|
||||||
|
return 1
|
||||||
|
daemon3.send("BUTTON POWER")
|
||||||
|
if not wait_for(lambda: "call=none" in daemon3.send("STATUS"), timeout=3):
|
||||||
|
sys.stderr.write("FAIL: BUTTON POWER did not hang up incoming call\n")
|
||||||
|
return 1
|
||||||
|
if not wait_for(
|
||||||
|
lambda: "hangup-call" in events_log.read_text(),
|
||||||
|
timeout=2,
|
||||||
|
):
|
||||||
|
sys.stderr.write("FAIL: BUTTON POWER did not invoke hangup-call bridge\n")
|
||||||
|
return 1
|
||||||
|
# Late CALL muted|-|-|- arriving after hangup must not resurrect call=muted.
|
||||||
|
daemon3.send("CALL muted|-|-|-")
|
||||||
|
if "call=none" not in daemon3.send("STATUS"):
|
||||||
|
sys.stderr.write("FAIL: stale CALL muted overwrote call=none\n")
|
||||||
|
return 1
|
||||||
|
main_cfg3.write_text("0\n")
|
||||||
|
daemon3.send("BUTTON")
|
||||||
|
if not wait_for(lambda: daemon3.frame()[1], timeout=3):
|
||||||
|
sys.stderr.write("FAIL: cover did not show idle clock after call hangup\n")
|
||||||
|
return 1
|
||||||
|
frame_utc = daemon3.frame()[0]
|
||||||
|
lt_path.unlink()
|
||||||
|
lt_path.symlink_to(ny_zi)
|
||||||
|
tz_file.write_text("America/New_York\n", encoding="utf-8")
|
||||||
|
daemon3.send("REFRESH")
|
||||||
|
if not wait_for(lambda: daemon3.frame()[0] != frame_utc, timeout=3):
|
||||||
|
sys.stderr.write("FAIL: live timezone change + REFRESH did not update cover clock\n")
|
||||||
|
return 1
|
||||||
|
if daemon3.backlight_value() == "0":
|
||||||
|
sys.stderr.write("FAIL: expected lit backlight before SIGTERM test\n")
|
||||||
|
return 1
|
||||||
|
daemon3.proc.terminate()
|
||||||
|
rc = daemon3.proc.wait(timeout=3)
|
||||||
|
if rc != 0:
|
||||||
|
sys.stderr.write(f"FAIL: cover daemon exited {rc} on SIGTERM\n")
|
||||||
|
return 1
|
||||||
|
if daemon3.backlight_value() != "0":
|
||||||
|
sys.stderr.write(f"FAIL: SIGTERM did not blank backlight (got {daemon3.backlight_value()!r})\n")
|
||||||
|
return 1
|
||||||
|
print("[ok] closed-flip incoming call UI, side-key mute/hangup, and live TZ refresh")
|
||||||
|
finally:
|
||||||
|
daemon3.close()
|
||||||
|
|
||||||
|
sub4 = pathlib.Path(tmp) / "cover_event_bridge"
|
||||||
|
sub4.mkdir()
|
||||||
|
cover_event_sh = pathlib.Path(__file__).resolve().parents[1] / "overlay/rootfs/usr/bin/bananarchy-cover-event.sh"
|
||||||
|
lid_profile = sub4 / "lid-profile"
|
||||||
|
lid_profile.write_text("flip\n", encoding="utf-8")
|
||||||
|
contacts = sub4 / "contacts.tsv"
|
||||||
|
contacts.write_text("+380501234567\tAlice\n", encoding="utf-8")
|
||||||
|
ctl_log = sub4 / "coverctl.log"
|
||||||
|
fake_ctl = sub4 / "coverctl"
|
||||||
|
fake_ctl.write_text(
|
||||||
|
f"#!/bin/sh\nprintf '%s\\n' \"$*\" >> {ctl_log}\n",
|
||||||
|
encoding="utf-8",
|
||||||
|
)
|
||||||
|
fake_ctl.chmod(0o755)
|
||||||
|
ring_file = sub4 / "sxmo_call_ringing"
|
||||||
|
ring_file.write_text("+380501234567\n", encoding="utf-8")
|
||||||
|
fifo_path = sub4 / "callscreen.fifo"
|
||||||
|
os.mkfifo(fifo_path)
|
||||||
|
fifo_fd = os.open(fifo_path, os.O_RDWR | os.O_NONBLOCK)
|
||||||
|
try:
|
||||||
|
bridge_env = os.environ.copy()
|
||||||
|
bridge_env.update({
|
||||||
|
"BANANARCHY_LID_PROFILE_FILE": str(lid_profile),
|
||||||
|
"BANANARCHY_COVERCTL_BIN": str(fake_ctl),
|
||||||
|
"BANANARCHY_CALLSCREEN_FIFO": str(fifo_path),
|
||||||
|
"BANANARCHY_RINGING_FILE": str(ring_file),
|
||||||
|
"BANANARCHY_ACTIVE_CALL_FILE": str(sub4 / "sxmo_active_call"),
|
||||||
|
"SXMO_CONTACTFILE": str(contacts),
|
||||||
|
"BANANARCHY_COVER_TEST_USER_SH": "1",
|
||||||
|
})
|
||||||
|
for args in (
|
||||||
|
["ring", "+380501234567", "SIM1"],
|
||||||
|
["ring", "Alice"],
|
||||||
|
["mute-ring"],
|
||||||
|
["hangup-call"],
|
||||||
|
):
|
||||||
|
res = subprocess.run([str(cover_event_sh), *args], env=bridge_env, check=False)
|
||||||
|
if res.returncode != 0:
|
||||||
|
sys.stderr.write(f"FAIL: bananarchy-cover-event.sh {args} exited {res.returncode}\n")
|
||||||
|
return 1
|
||||||
|
ctl_lines = ctl_log.read_text(encoding="utf-8").splitlines()
|
||||||
|
if "CALL incoming|+380501234567|Alice|SIM1" not in ctl_lines:
|
||||||
|
sys.stderr.write(f"FAIL: unexpected ring contact resolution: {ctl_lines!r}\n")
|
||||||
|
return 1
|
||||||
|
if "CALL incoming|-|Alice|-" not in ctl_lines:
|
||||||
|
sys.stderr.write(f"FAIL: unexpected contact-only ring payload: {ctl_lines!r}\n")
|
||||||
|
return 1
|
||||||
|
if ring_file.exists():
|
||||||
|
sys.stderr.write("FAIL: hangup-call did not remove sxmo_call_ringing\n")
|
||||||
|
return 1
|
||||||
|
fifo_data = os.read(fifo_fd, 4096).decode("utf-8", errors="replace")
|
||||||
|
if "MUTE_RING" not in fifo_data or "HANGUP_CLOSE" not in fifo_data:
|
||||||
|
sys.stderr.write(f"FAIL: callscreen FIFO missing mute/hangup commands: {fifo_data!r}\n")
|
||||||
|
return 1
|
||||||
|
print("[ok] cover event bridge resolves contacts and dispatches mute/hangup")
|
||||||
|
finally:
|
||||||
|
os.close(fifo_fd)
|
||||||
print("cover display behaviour: all checks passed")
|
print("cover display behaviour: all checks passed")
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|||||||
@@ -138,6 +138,130 @@ class DsdsDaemonTests(unittest.TestCase):
|
|||||||
res2 = subprocess.run([self.bin, q1, q2], capture_output=True, text=True, check=True)
|
res2 = subprocess.run([self.bin, q1, q2], capture_output=True, text=True, check=True)
|
||||||
self.assertIn("DELIVER\t2\t+358401234567\tOne Two\n", res2.stdout)
|
self.assertIn("DELIVER\t2\t+358401234567\tOne Two\n", res2.stdout)
|
||||||
|
|
||||||
|
def test_sxmo_calls_post_call_markers_ignored_and_reaped(self):
|
||||||
|
phone_dir = os.path.join(BASE_DIR, "src", "dwm-plugins")
|
||||||
|
cpp_src = os.path.join(self.tmpdir.name, "test_calls.cpp")
|
||||||
|
cpp_bin = os.path.join(self.tmpdir.name, "test_calls.bin")
|
||||||
|
with open(cpp_src, "w") as handle:
|
||||||
|
handle.write(
|
||||||
|
'#include <cassert>\n'
|
||||||
|
'#include <string>\n'
|
||||||
|
'#include "phone_data.h"\n'
|
||||||
|
'int main(int argc, char** argv) {\n'
|
||||||
|
' if (argc < 3) return 2;\n'
|
||||||
|
' std::string dir = argv[1];\n'
|
||||||
|
' std::string name = argv[2];\n'
|
||||||
|
' return bananarchy::isLiveSxmoCallFile(dir, name.c_str()) ? 0 : 1;\n'
|
||||||
|
'}\n'
|
||||||
|
)
|
||||||
|
pkg_cflags = subprocess.run(
|
||||||
|
["pkg-config", "--cflags", "xft", "pangoxft"],
|
||||||
|
capture_output=True, text=True, check=True,
|
||||||
|
).stdout.split()
|
||||||
|
subprocess.run(
|
||||||
|
[
|
||||||
|
"g++", "-std=c++20", "-O2", "-Wall", "-Wextra", "-Werror",
|
||||||
|
"-I", phone_dir, *pkg_cflags, "-o", cpp_bin, cpp_src,
|
||||||
|
],
|
||||||
|
check=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
work = os.path.join(self.tmpdir.name, "calls_work")
|
||||||
|
rt = os.path.join(work, "run")
|
||||||
|
cfg = os.path.join(work, "cfg")
|
||||||
|
data = os.path.join(work, "data")
|
||||||
|
hooks = os.path.join(cfg, "sxmo", "hooks")
|
||||||
|
calls_dir = os.path.join(rt, "sxmo_calls")
|
||||||
|
os.makedirs(calls_dir, exist_ok=True)
|
||||||
|
os.makedirs(hooks, exist_ok=True)
|
||||||
|
os.makedirs(data, exist_ok=True)
|
||||||
|
|
||||||
|
stubs = {
|
||||||
|
"mmcli": "#!/bin/sh\necho 'No calls were found.'\nexit 0\n",
|
||||||
|
"doas": "#!/bin/sh\nexit 1\n",
|
||||||
|
"sxmo_hook_discard.sh": "#!/bin/sh\nexit 0\n",
|
||||||
|
"sxmo_hook_hangup.sh": "#!/bin/sh\nexit 0\n",
|
||||||
|
"sxmo_log": "#!/bin/sh\nexit 0\n",
|
||||||
|
"pgrep": "#!/bin/sh\nexit 1\n",
|
||||||
|
"dbus-send": "#!/bin/sh\nexit 0\n",
|
||||||
|
"sxmo_hook_icons.sh": "icon_phn=P\n",
|
||||||
|
"sxmo_common.sh": 'export SXMO_LOGDIR="${SXMO_LOGDIR:-$XDG_DATA_HOME/sxmo/modem}"\n',
|
||||||
|
}
|
||||||
|
for name, content in stubs.items():
|
||||||
|
path = os.path.join(hooks, name)
|
||||||
|
with open(path, "w") as handle:
|
||||||
|
handle.write(content)
|
||||||
|
os.chmod(path, 0o755)
|
||||||
|
|
||||||
|
appmenu = os.path.join(BASE_DIR, "overlay", "rootfs", "usr", "bin", "sxmo_appmenu.sh")
|
||||||
|
modemcall = os.path.join(BASE_DIR, "overlay", "rootfs", "usr", "bin", "sxmo_modemcall.sh")
|
||||||
|
env = dict(os.environ)
|
||||||
|
env.update({
|
||||||
|
"HOME": work,
|
||||||
|
"XDG_CONFIG_HOME": cfg,
|
||||||
|
"XDG_DATA_HOME": data,
|
||||||
|
"XDG_CACHE_HOME": os.path.join(work, "cache"),
|
||||||
|
"XDG_STATE_HOME": os.path.join(work, "state"),
|
||||||
|
"XDG_RUNTIME_DIR": rt,
|
||||||
|
"SXMO_LOGDIR": os.path.join(data, "sxmo", "modem"),
|
||||||
|
"SHELLSPEC_PATH": "1",
|
||||||
|
"PATH": f"{hooks}:{os.environ.get('PATH', '/usr/bin:/bin')}",
|
||||||
|
})
|
||||||
|
|
||||||
|
def clear_calls():
|
||||||
|
for fn in os.listdir(calls_dir):
|
||||||
|
os.unlink(os.path.join(calls_dir, fn))
|
||||||
|
|
||||||
|
def check_live(files, probe_name, expect_live):
|
||||||
|
clear_calls()
|
||||||
|
for fn in files:
|
||||||
|
open(os.path.join(calls_dir, fn), "w").close()
|
||||||
|
res_cpp = subprocess.run([cpp_bin, calls_dir, probe_name], env=env)
|
||||||
|
self.assertEqual(
|
||||||
|
res_cpp.returncode == 0,
|
||||||
|
expect_live,
|
||||||
|
f"isLiveSxmoCallFile({files}, {probe_name}) expected {expect_live}",
|
||||||
|
)
|
||||||
|
res_sh = subprocess.run(
|
||||||
|
["sh", "-c", f'. "{appmenu}"; has_tracked_calls'],
|
||||||
|
env=env,
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
res_sh.returncode == 0,
|
||||||
|
expect_live,
|
||||||
|
f"sxmo_appmenu.sh has_tracked_calls({files}) expected {expect_live}",
|
||||||
|
)
|
||||||
|
|
||||||
|
for marker in [
|
||||||
|
"1.discardedcall",
|
||||||
|
"1.hangedupcall",
|
||||||
|
"1.terminated",
|
||||||
|
"1.blockedcall",
|
||||||
|
"1.mutedring",
|
||||||
|
]:
|
||||||
|
check_live([marker], marker, False)
|
||||||
|
|
||||||
|
check_live(["1.monitoredcall", "1.discardedcall"], "1.monitoredcall", False)
|
||||||
|
check_live(["1.monitoredcall"], "1.monitoredcall", True)
|
||||||
|
check_live(["1.monitoredcall", "1.mutedring"], "1.monitoredcall", True)
|
||||||
|
for live_marker in [
|
||||||
|
"1.pickedupcall",
|
||||||
|
"1.initiatedcall",
|
||||||
|
"sub1_1.ringing-in",
|
||||||
|
"sub1_1.active",
|
||||||
|
]:
|
||||||
|
check_live([live_marker], live_marker, True)
|
||||||
|
|
||||||
|
clear_calls()
|
||||||
|
open(os.path.join(calls_dir, "1.monitoredcall"), "w").close()
|
||||||
|
had_hangup_req = os.path.exists("/tmp/sxmo_hangup_requested")
|
||||||
|
try:
|
||||||
|
subprocess.run(["sh", modemcall, "hangup", "1"], env=env, check=True)
|
||||||
|
finally:
|
||||||
|
if not had_hangup_req and os.path.exists("/tmp/sxmo_hangup_requested"):
|
||||||
|
os.unlink("/tmp/sxmo_hangup_requested")
|
||||||
|
self.assertEqual(os.listdir(calls_dir), [])
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
@@ -17,6 +17,8 @@ BIN = BASE / "overlay/rootfs/usr/bin"
|
|||||||
LOCK = BIN / "bananarchy-idle-lock.sh"
|
LOCK = BIN / "bananarchy-idle-lock.sh"
|
||||||
BLANK = BIN / "bananarchy-idle-blank.sh"
|
BLANK = BIN / "bananarchy-idle-blank.sh"
|
||||||
WAKE = BIN / "bananarchy-screen-wake.sh"
|
WAKE = BIN / "bananarchy-screen-wake.sh"
|
||||||
|
DPMS_SYNC = BIN / "bananarchy-display-power-sync"
|
||||||
|
MODEM_SH = BIN / "sxmo_modem.sh"
|
||||||
UNLOCK_HOOK = BASE / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_unlock.sh"
|
UNLOCK_HOOK = BASE / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_unlock.sh"
|
||||||
|
|
||||||
WM_STUB = '''#!/bin/sh
|
WM_STUB = '''#!/bin/sh
|
||||||
@@ -183,6 +185,152 @@ def main():
|
|||||||
if "bananarchy-idle-lock.sh cancel" not in UNLOCK_HOOK.read_text():
|
if "bananarchy-idle-lock.sh cancel" not in UNLOCK_HOOK.read_text():
|
||||||
return failure("sxmo_hook_unlock.sh does not cancel the pending lock")
|
return failure("sxmo_hook_unlock.sh does not cancel the pending lock")
|
||||||
print("[ok] wake: screen-wake and unlock hook cancel the pending lock")
|
print("[ok] wake: screen-wake and unlock hook cancel the pending lock")
|
||||||
|
|
||||||
|
# Closed flip and ringing/active calls must suppress idle-lock activation.
|
||||||
|
lid_state = root / "lid-state"
|
||||||
|
ring_flag = root / "ring.flag"
|
||||||
|
active_flag = root / "active.flag"
|
||||||
|
env.update({
|
||||||
|
"BANANARCHY_LID_STATE": str(lid_state),
|
||||||
|
"BANANARCHY_RING_FLAG": str(ring_flag),
|
||||||
|
"BANANARCHY_ACTIVE_CALL_FLAG": str(active_flag),
|
||||||
|
})
|
||||||
|
clear()
|
||||||
|
dark(True)
|
||||||
|
cfg.write_text("0\n", encoding="utf-8")
|
||||||
|
lid_state.write_text("closed\n", encoding="utf-8")
|
||||||
|
run(LOCK, "arm")
|
||||||
|
if log():
|
||||||
|
return failure("idle-lock fired while flip was closed")
|
||||||
|
lid_state.write_text("open\n", encoding="utf-8")
|
||||||
|
ring_flag.write_text("1\n", encoding="utf-8")
|
||||||
|
run(LOCK, "arm")
|
||||||
|
if log():
|
||||||
|
return failure("idle-lock fired while a call was ringing")
|
||||||
|
ring_flag.unlink()
|
||||||
|
active_flag.write_text("2\n", encoding="utf-8")
|
||||||
|
run(LOCK, "arm")
|
||||||
|
if log():
|
||||||
|
return failure("idle-lock fired while a call was active")
|
||||||
|
active_flag.unlink()
|
||||||
|
print("[ok] closed-flip and active/ringing calls suppress idle-lock")
|
||||||
|
|
||||||
|
# bananarchy-display-power-sync must keep screen_off=N unless rpm_sleep=Y.
|
||||||
|
for prof_val in ("slider\n", "flip\n"):
|
||||||
|
prof_file = root / "lid-profile"
|
||||||
|
prof_file.write_text(prof_val, encoding="utf-8")
|
||||||
|
lid_state.write_text("open\n" if prof_val == "slider\n" else "closed\n",
|
||||||
|
encoding="utf-8")
|
||||||
|
br_file = root / "brightness"
|
||||||
|
blp_file = root / "bl_power"
|
||||||
|
kbd_file = root / "kbd_brightness"
|
||||||
|
dpms_file = root / "dpms"
|
||||||
|
gpu_file = root / "gpu_gov"
|
||||||
|
wifi_file = root / "wifi_offload"
|
||||||
|
spm_screen_file = root / "spm_screen_off"
|
||||||
|
spm_rpm_file = root / "spm_rpm_sleep"
|
||||||
|
br_file.write_text("0\n", encoding="utf-8")
|
||||||
|
blp_file.write_text("4\n", encoding="utf-8")
|
||||||
|
kbd_file.write_text("0\n", encoding="utf-8")
|
||||||
|
dpms_file.write_text("Off\n", encoding="utf-8")
|
||||||
|
gpu_file.write_text("simple_ondemand\n", encoding="utf-8")
|
||||||
|
wifi_file.write_text("N\n", encoding="utf-8")
|
||||||
|
spm_screen_file.write_text("N\n", encoding="utf-8")
|
||||||
|
spm_rpm_file.write_text("N\n", encoding="utf-8")
|
||||||
|
dpms_env = dict(os.environ)
|
||||||
|
dpms_env.update({
|
||||||
|
"BANANARCHY_LID_PROFILE": str(prof_file),
|
||||||
|
"BANANARCHY_LID_STATE": str(lid_state),
|
||||||
|
"BANANARCHY_LID_GATE": "/bin/false" if prof_val == "flip\n" else "/bin/true",
|
||||||
|
"BANANARCHY_BR_PATH": str(br_file),
|
||||||
|
"BANANARCHY_BL_POWER_PATH": str(blp_file),
|
||||||
|
"BANANARCHY_KBD_PATH": str(kbd_file),
|
||||||
|
"BANANARCHY_DPMS_PATH": str(dpms_file),
|
||||||
|
"BANANARCHY_GPU_GOV_PATH": str(gpu_file),
|
||||||
|
"BANANARCHY_WIFI_OFFLOAD_PATH": str(wifi_file),
|
||||||
|
"BANANARCHY_SPM_SCREEN_OFF_PATH": str(spm_screen_file),
|
||||||
|
"BANANARCHY_SPM_RPM_SLEEP_PATH": str(spm_rpm_file),
|
||||||
|
"BANANARCHY_COVER_MARKER": str(root / "cover-backlight"),
|
||||||
|
"BANANARCHY_FORCE_MARKER": str(root / "cover-bl-force"),
|
||||||
|
"BANANARCHY_STATE_CACHE": str(root / "cover-power-state"),
|
||||||
|
})
|
||||||
|
res = subprocess.run(["sh", str(DPMS_SYNC)], env=dpms_env,
|
||||||
|
capture_output=True, text=True)
|
||||||
|
if res.returncode != 0 or spm_screen_file.read_text().strip() != "N":
|
||||||
|
return failure("display-power-sync set screen_off=Y while rpm_sleep=N (%s)"
|
||||||
|
% prof_val.strip())
|
||||||
|
spm_rpm_file.write_text("Y\n", encoding="utf-8")
|
||||||
|
res = subprocess.run(["sh", str(DPMS_SYNC)], env=dpms_env,
|
||||||
|
capture_output=True, text=True)
|
||||||
|
if res.returncode != 0 or spm_screen_file.read_text().strip() != "Y":
|
||||||
|
return failure("display-power-sync did not set screen_off=Y when rpm_sleep=Y (%s)"
|
||||||
|
% prof_val.strip())
|
||||||
|
print("[ok] display-power-sync gates spm screen_off on rpm_sleep")
|
||||||
|
|
||||||
|
# sxmo_modem.sh must not ring on a call that terminated mid-lookup, and must expire stale hangup flags.
|
||||||
|
modem_rt = root / "modem_rt"
|
||||||
|
modem_bin = root / "modem_bin"
|
||||||
|
modem_calls = modem_rt / "sxmo_calls"
|
||||||
|
modem_logs = modem_rt / "sxmo_logs"
|
||||||
|
modem_rt.mkdir()
|
||||||
|
modem_bin.mkdir()
|
||||||
|
modem_calls.mkdir()
|
||||||
|
modem_logs.mkdir()
|
||||||
|
modem_events = root / "modem_events.log"
|
||||||
|
hangup_flag = root / "sxmo_hangup_requested"
|
||||||
|
for name, body in (
|
||||||
|
("sxmo_hook_icons.sh", "#!/bin/sh\nicon_phn=P\n"),
|
||||||
|
("sxmo_common.sh", "#!/bin/sh\nSXMO_LOGDIR=\"%s\"\nSXMO_BLOCKDIR=\"%s/block\"\nsxmo_log() { :; }\n" % (modem_logs, modem_logs)),
|
||||||
|
("pnc", "#!/bin/sh\n[ \"$1\" = valid ] && exit 0\necho \"$2\"\n"),
|
||||||
|
("sxmo_contacts.sh", "#!/bin/sh\necho 'Test Contact'\n"),
|
||||||
|
("sxmo_hook_block_call.sh", "#!/bin/sh\nexit 1\n"),
|
||||||
|
("sxmo_modemcall.sh", "#!/bin/sh\ncase \"$1\" in vid_to_number) echo '+380631112233' ;; list_active_calls) ;; esac\n"),
|
||||||
|
("sxmo_jobs.sh", "#!/bin/sh\nprintf 'jobs %%s\\n' \"$*\" >> \"%s\"\n" % modem_events),
|
||||||
|
("sxmo_state.sh", "#!/bin/sh\necho unlock\n"),
|
||||||
|
("sxmo_wm.sh", "#!/bin/sh\nexit 0\n"),
|
||||||
|
("xcallscreen", "#!/bin/sh\nprintf 'xcallscreen %%s\\n' \"$*\" >> \"%s\"\n" % modem_events),
|
||||||
|
("sxmo_hook_statusbar.sh", "#!/bin/sh\nexit 0\n"),
|
||||||
|
("sxmo_modemaudio.sh", "#!/bin/sh\nexit 0\n"),
|
||||||
|
("sxmo_notifs.sh", "#!/bin/sh\nprintf 'notif %%s\\n' \"$*\" >> \"%s\"\n" % modem_events),
|
||||||
|
("sxmo_hook_missed_call.sh", "#!/bin/sh\nexit 0\n"),
|
||||||
|
("sxmo_wakelock.sh", "#!/bin/sh\nexit 0\n"),
|
||||||
|
("sxmo_hook_after_call.sh", "#!/bin/sh\nexit 0\n"),
|
||||||
|
("sxmo_vibrate", "#!/bin/sh\nexit 0\n"),
|
||||||
|
("mmcli", "#!/bin/sh\nif [ \"$3\" = '--voice-list-calls' ]; then\n if [ \"$MMCLI_MODE\" = 'terminated' ]; then\n echo '/org/freedesktop/ModemManager1/Call/7 (terminated)'\n else\n echo '/org/freedesktop/ModemManager1/Call/7 incoming (ringing-in)'\n fi\nelif echo \"$*\" | grep -q -- '-K'; then\n echo 'call.properties.state : terminated'\nfi\n"),
|
||||||
|
):
|
||||||
|
p = modem_bin / name
|
||||||
|
p.write_text(body, encoding="utf-8")
|
||||||
|
p.chmod(0o755)
|
||||||
|
modem_env = dict(os.environ)
|
||||||
|
modem_env.update({
|
||||||
|
"HOME": str(home),
|
||||||
|
"XDG_CONFIG_HOME": str(home / ".config"),
|
||||||
|
"XDG_RUNTIME_DIR": str(modem_rt),
|
||||||
|
"SXMO_HANGUP_FLAG": str(hangup_flag),
|
||||||
|
"PATH": "%s:%s" % (modem_bin, os.environ.get("PATH", "")),
|
||||||
|
"MMCLI_MODE": "ringing",
|
||||||
|
})
|
||||||
|
res = subprocess.run(["sh", str(MODEM_SH), "checkforincomingcalls"],
|
||||||
|
env=modem_env, capture_output=True, text=True)
|
||||||
|
ev_txt = modem_events.read_text() if modem_events.exists() else ""
|
||||||
|
if res.returncode != 0 or "jobs start --group ringing" in ev_txt or "xcallscreen incoming" in ev_txt:
|
||||||
|
return failure("sxmo_modem.sh rang or opened callscreen for an already-terminated call: %r" % ev_txt)
|
||||||
|
if (modem_calls / "7.monitoredcall").exists():
|
||||||
|
return failure("sxmo_modem.sh left stale .monitoredcall after terminated lookup")
|
||||||
|
|
||||||
|
# Stale >8s hangup flag must expire so a missed call is not misclassified as wehangedup.
|
||||||
|
hangup_flag.write_text("1\n", encoding="utf-8")
|
||||||
|
stale_t = time.time() - 30
|
||||||
|
os.utime(hangup_flag, (stale_t, stale_t))
|
||||||
|
modem_events.unlink(missing_ok=True)
|
||||||
|
modem_env["MMCLI_MODE"] = "terminated"
|
||||||
|
res = subprocess.run(["sh", str(MODEM_SH), "checkforfinishedcalls"],
|
||||||
|
env=modem_env, capture_output=True, text=True)
|
||||||
|
ev_txt = modem_events.read_text() if modem_events.exists() else ""
|
||||||
|
if res.returncode != 0 or "notif new" not in ev_txt or hangup_flag.exists():
|
||||||
|
return failure("stale sxmo_hangup_requested suppressed missed-call notification: %r" % ev_txt)
|
||||||
|
print("[ok] sxmo_modem.sh guards terminated-call race and expires stale hangup flag")
|
||||||
|
|
||||||
run(LOCK, "cancel")
|
run(LOCK, "cancel")
|
||||||
print("idle blank screenlock wiring: all checks passed")
|
print("idle blank screenlock wiring: all checks passed")
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ INPUT_HOOKS = (
|
|||||||
BASE / "overlay/rootfs/home/user/.config/sxmo/hooks/sxmo_hook_inputhandler.sh",
|
BASE / "overlay/rootfs/home/user/.config/sxmo/hooks/sxmo_hook_inputhandler.sh",
|
||||||
)
|
)
|
||||||
EVENT = BASE / "overlay/rootfs/usr/bin/bananarchy-cover-event.sh"
|
EVENT = BASE / "overlay/rootfs/usr/bin/bananarchy-cover-event.sh"
|
||||||
|
LOCK_HOOK = BASE / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_lock.sh"
|
||||||
HOOKS = (
|
HOOKS = (
|
||||||
BASE / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_ring.sh",
|
BASE / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_ring.sh",
|
||||||
BASE / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_notification.sh",
|
BASE / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_notification.sh",
|
||||||
@@ -86,9 +87,12 @@ def main():
|
|||||||
if 'write_session_file(LOCK_FLAG, "1")' not in lid_open or \
|
if 'write_session_file(LOCK_FLAG, "1")' not in lid_open or \
|
||||||
'write_session_file(state, "lock")' not in lid_open:
|
'write_session_file(state, "lock")' not in lid_open:
|
||||||
return fail("opening the flip does not keep the desktop locked")
|
return fail("opening the flip does not keep the desktop locked")
|
||||||
if lid_open.index('write_session_file(state, "lock")') > \
|
if 'write_session_file(state, "lock")' in lid_open and \
|
||||||
|
lid_open.index('write_session_file(state, "lock")') > \
|
||||||
lid_open.index('write_sysfs_int(BRIGHTNESS, bl)'):
|
lid_open.index('write_sysfs_int(BRIGHTNESS, bl)'):
|
||||||
return fail("the desktop lock is published after the panel is relit")
|
return fail("the desktop lock is published after the panel is relit")
|
||||||
|
if 'callscreen_send("RAISE\\n")' not in lid_open:
|
||||||
|
return fail("opening the flip does not raise active/incoming callscreen")
|
||||||
print("[ok] lid daemon: instant close, persistent lock and bus handover")
|
print("[ok] lid daemon: instant close, persistent lock and bus handover")
|
||||||
|
|
||||||
scratch = pathlib.Path("/tmp/bantam/9064bb701d9e9f7c6412f0ea6846d88a")
|
scratch = pathlib.Path("/tmp/bantam/9064bb701d9e9f7c6412f0ea6846d88a")
|
||||||
@@ -129,10 +133,25 @@ def main():
|
|||||||
"if (!visible || isLidClosed())" not in locker or \
|
"if (!visible || isLidClosed())" not in locker or \
|
||||||
'runAsyncArgv("/usr/bin/bananarchy-lid-gate.sh", "wake")' not in locker:
|
'runAsyncArgv("/usr/bin/bananarchy-lid-gate.sh", "wake")' not in locker:
|
||||||
return fail("locker_plugin.cpp is not gated on /run/bananarchy/lid-state")
|
return fail("locker_plugin.cpp is not gated on /run/bananarchy/lid-state")
|
||||||
|
if "if (blankDisplay && !alreadyClosedBlanked)" not in locker or \
|
||||||
|
locker.index("if (blankDisplay && !alreadyClosedBlanked)") > locker.index("HANGUP_CLOSE") or \
|
||||||
|
"if (hadActiveCall)" not in locker or \
|
||||||
|
'sendPluginCommand("callscreen", "RAISE")' not in locker:
|
||||||
|
return fail("locker_plugin.cpp still hangs up active calls on non-blank LOCK/open or closed-flip blank")
|
||||||
|
if "cancel_idle_lock_timer()" not in lid:
|
||||||
|
return fail("bananarchy-lid.c does not cancel pending idle-lock timers on flip transitions")
|
||||||
|
lock_hook = LOCK_HOOK.read_text(encoding="utf-8")
|
||||||
|
if "HANGUP_CLOSE" in lock_hook or "hangup all" in lock_hook:
|
||||||
|
return fail("sxmo_hook_lock.sh unconditionally hangs up calls on lock/flip-open")
|
||||||
callscreen = CALLSCREEN_SRC.read_text(encoding="utf-8")
|
callscreen = CALLSCREEN_SRC.read_text(encoding="utf-8")
|
||||||
if "/run/bananarchy/lid-state" not in callscreen or \
|
if "/run/bananarchy/lid-state" not in callscreen or \
|
||||||
'runAsyncArgv("/usr/bin/bananarchy-lid-gate.sh", "wake")' not in callscreen:
|
'runAsyncArgv("/usr/bin/bananarchy-lid-gate.sh", "wake")' not in callscreen or \
|
||||||
return fail("callscreen_plugin.cpp wakeDisplayHardware is not lid-gated")
|
"isFlipClosed()" not in callscreen or \
|
||||||
|
"notifyCoverCall(" not in callscreen or \
|
||||||
|
"callState == CallState::Idle && !isCallActiveOrRingingFast()" not in callscreen or \
|
||||||
|
"lastRejectedCallId" not in callscreen or \
|
||||||
|
"syncModemCalls();" not in callscreen:
|
||||||
|
return fail("callscreen_plugin.cpp is missing lid-gate, idle HANGUP_CLOSE guard, or stale-call RAISE verification")
|
||||||
conf = COVER_CONF.read_text(encoding="utf-8")
|
conf = COVER_CONF.read_text(encoding="utf-8")
|
||||||
if "spi_word_bits" not in conf:
|
if "spi_word_bits" not in conf:
|
||||||
return fail("the cover config lost the 8/9-bit sign-off knob")
|
return fail("the cover config lost the 8/9-bit sign-off knob")
|
||||||
|
|||||||
Executable
+294
@@ -0,0 +1,294 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
import os
|
||||||
|
import pathlib
|
||||||
|
import shutil
|
||||||
|
import signal
|
||||||
|
import subprocess
|
||||||
|
import tempfile
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
ROOT = pathlib.Path(__file__).resolve().parent.parent
|
||||||
|
COMMON_H = ROOT / "src" / "bananarchy-daemons" / "common.h"
|
||||||
|
RUN_ALIGNED_C = ROOT / "src" / "bananarchy-daemons" / "bananarchy-run-aligned.c"
|
||||||
|
TIME_SYNC_SH = ROOT / "overlay" / "rootfs" / "usr" / "bin" / "bananarchy-time-sync.sh"
|
||||||
|
|
||||||
|
|
||||||
|
def test_ba_refresh_tz(tmp: pathlib.Path) -> None:
|
||||||
|
src = tmp / "tz_probe.c"
|
||||||
|
bin_path = tmp / "tz_probe"
|
||||||
|
src.write_text(
|
||||||
|
'#include "common.h"\n'
|
||||||
|
'int main(void) {\n'
|
||||||
|
' char cmd[16];\n'
|
||||||
|
' time_t sample = (time_t)1700000000;\n'
|
||||||
|
' while (fgets(cmd, sizeof(cmd), stdin)) {\n'
|
||||||
|
' struct tm tm_now;\n'
|
||||||
|
' ba_refresh_tz();\n'
|
||||||
|
' localtime_r(&sample, &tm_now);\n'
|
||||||
|
' printf("%02d\\n", tm_now.tm_hour);\n'
|
||||||
|
' fflush(stdout);\n'
|
||||||
|
' }\n'
|
||||||
|
' return 0;\n'
|
||||||
|
'}\n',
|
||||||
|
encoding="utf-8",
|
||||||
|
)
|
||||||
|
subprocess.run(
|
||||||
|
[
|
||||||
|
"gcc",
|
||||||
|
"-std=c11",
|
||||||
|
"-O2",
|
||||||
|
"-Wall",
|
||||||
|
"-Wextra",
|
||||||
|
"-Werror",
|
||||||
|
f"-I{COMMON_H.parent}",
|
||||||
|
str(src),
|
||||||
|
"-o",
|
||||||
|
str(bin_path),
|
||||||
|
],
|
||||||
|
check=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
lt = tmp / "localtime"
|
||||||
|
tzf = tmp / "timezone"
|
||||||
|
utc = pathlib.Path("/usr/share/zoneinfo/UTC")
|
||||||
|
ny = pathlib.Path("/usr/share/zoneinfo/America/New_York")
|
||||||
|
kyiv = pathlib.Path("/usr/share/zoneinfo/Europe/Kyiv")
|
||||||
|
assert utc.exists() and ny.exists() and kyiv.exists(), "host zoneinfo missing"
|
||||||
|
|
||||||
|
# 1) Symlink repointing including A -> B -> C -> A cycle
|
||||||
|
lt.symlink_to(utc)
|
||||||
|
tzf.write_text("UTC\n", encoding="utf-8")
|
||||||
|
env = os.environ.copy()
|
||||||
|
env["BANANARCHY_TZ_LOCALTIME"] = str(lt)
|
||||||
|
env["BANANARCHY_TZ_FILE"] = str(tzf)
|
||||||
|
env.pop("TZ", None)
|
||||||
|
|
||||||
|
proc = subprocess.Popen(
|
||||||
|
[str(bin_path)],
|
||||||
|
stdin=subprocess.PIPE,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
text=True,
|
||||||
|
env=env,
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
def query(step_zone: pathlib.Path, label: str, symlink_mode: bool = True) -> str:
|
||||||
|
lt.unlink()
|
||||||
|
if symlink_mode:
|
||||||
|
lt.symlink_to(step_zone)
|
||||||
|
else:
|
||||||
|
shutil.copyfile(step_zone, lt)
|
||||||
|
tzf.write_text(f"{label}\n", encoding="utf-8")
|
||||||
|
assert proc.stdin is not None and proc.stdout is not None
|
||||||
|
proc.stdin.write("q\n")
|
||||||
|
proc.stdin.flush()
|
||||||
|
return proc.stdout.readline().strip()
|
||||||
|
|
||||||
|
assert proc.stdin is not None and proc.stdout is not None
|
||||||
|
proc.stdin.write("q\n")
|
||||||
|
proc.stdin.flush()
|
||||||
|
assert proc.stdout.readline().strip() == "22", "expected initial UTC hour 22"
|
||||||
|
assert query(ny, "America/New_York", True) == "17", "expected New York hour 17"
|
||||||
|
assert query(kyiv, "Europe/Kyiv", True) == "00", "expected Kyiv hour 00"
|
||||||
|
assert query(utc, "UTC", True) == "22", "expected return to UTC hour 22"
|
||||||
|
# 2) In-place file overwrite (no symlink change)
|
||||||
|
assert query(ny, "America/New_York", False) == "17", "expected copy NY hour 17"
|
||||||
|
assert query(kyiv, "Europe/Kyiv", False) == "00", "expected copy Kyiv hour 00"
|
||||||
|
finally:
|
||||||
|
proc.terminate()
|
||||||
|
proc.wait(timeout=5)
|
||||||
|
|
||||||
|
|
||||||
|
def test_run_aligned_sigusr1(tmp: pathlib.Path) -> None:
|
||||||
|
bin_path = tmp / "run_aligned"
|
||||||
|
out_file = tmp / "aligned_ticks"
|
||||||
|
subprocess.run(
|
||||||
|
[
|
||||||
|
"gcc",
|
||||||
|
"-std=c11",
|
||||||
|
"-O2",
|
||||||
|
"-Wall",
|
||||||
|
"-Wextra",
|
||||||
|
"-Werror",
|
||||||
|
str(RUN_ALIGNED_C),
|
||||||
|
"-o",
|
||||||
|
str(bin_path),
|
||||||
|
],
|
||||||
|
check=True,
|
||||||
|
)
|
||||||
|
proc = subprocess.Popen(
|
||||||
|
[str(bin_path), "300", "sh", "-c", f'echo tick >> "{out_file}"'],
|
||||||
|
stdout=subprocess.DEVNULL,
|
||||||
|
stderr=subprocess.DEVNULL,
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
deadline = time.monotonic() + 3.0
|
||||||
|
while time.monotonic() < deadline:
|
||||||
|
if out_file.exists() and len(out_file.read_text().splitlines()) >= 1:
|
||||||
|
break
|
||||||
|
time.sleep(0.05)
|
||||||
|
assert out_file.exists() and len(out_file.read_text().splitlines()) == 1
|
||||||
|
time.sleep(0.15)
|
||||||
|
proc.send_signal(signal.SIGUSR1)
|
||||||
|
deadline = time.monotonic() + 2.0
|
||||||
|
while time.monotonic() < deadline:
|
||||||
|
if len(out_file.read_text().splitlines()) >= 2:
|
||||||
|
break
|
||||||
|
time.sleep(0.05)
|
||||||
|
lines = out_file.read_text().splitlines()
|
||||||
|
assert len(lines) >= 2, f"SIGUSR1 did not wake bananarchy-run-aligned: {lines}"
|
||||||
|
finally:
|
||||||
|
proc.terminate()
|
||||||
|
proc.wait(timeout=5)
|
||||||
|
|
||||||
|
|
||||||
|
def test_time_sync_waits_and_refreshes(tmp: pathlib.Path) -> None:
|
||||||
|
fake_bin = tmp / "bin"
|
||||||
|
fake_bin.mkdir()
|
||||||
|
run_dir = tmp / "run"
|
||||||
|
run_dir.mkdir()
|
||||||
|
trace = tmp / "trace.log"
|
||||||
|
chronyc_calls = tmp / "chronyc_calls"
|
||||||
|
locker_fifo = tmp / "locker.fifo"
|
||||||
|
os.mkfifo(locker_fifo)
|
||||||
|
|
||||||
|
chronyc = fake_bin / "chronyc"
|
||||||
|
chronyc.write_text(
|
||||||
|
"#!/bin/sh\n"
|
||||||
|
f'trace="{trace}"\n'
|
||||||
|
f'calls="{chronyc_calls}"\n'
|
||||||
|
'sock="$2"; shift 2\n'
|
||||||
|
'cmd="${1:-}"\n'
|
||||||
|
'n=0; [ -r "$calls" ] && read -r n < "$calls" || true\n'
|
||||||
|
'n=$((n + 1))\n'
|
||||||
|
'if [ "$cmd" = "tracking" ] || [ "$cmd" = "activity" ]; then\n'
|
||||||
|
' printf "%s\\n" "$n" > "$calls"\n'
|
||||||
|
'fi\n'
|
||||||
|
'echo "chronyc $cmd $n" >> "$trace"\n'
|
||||||
|
'if [ "$cmd" = "activity" ]; then\n'
|
||||||
|
' echo "1 sources online"\n'
|
||||||
|
' echo "0 sources offline"\n'
|
||||||
|
' if [ "$n" -le 5 ]; then\n'
|
||||||
|
' echo "1 sources doing burst"\n'
|
||||||
|
' else\n'
|
||||||
|
' echo "0 sources doing burst"\n'
|
||||||
|
' fi\n'
|
||||||
|
' echo "0 sources with unknown address"\n'
|
||||||
|
'elif [ "$cmd" = "tracking" ]; then\n'
|
||||||
|
' if [ "$n" -le 4 ]; then\n'
|
||||||
|
' echo "Reference ID : 00000000 ()"\n'
|
||||||
|
' else\n'
|
||||||
|
' echo "Reference ID : C0A80101 (ntp)"\n'
|
||||||
|
' fi\n'
|
||||||
|
'fi\n',
|
||||||
|
encoding="utf-8",
|
||||||
|
)
|
||||||
|
chronyc.chmod(0o755)
|
||||||
|
|
||||||
|
for name in ("su", "bananarchy-coverctl", "killall", "sxmo_hook_statusbar.sh"):
|
||||||
|
tool = fake_bin / name
|
||||||
|
tool.write_text(
|
||||||
|
f'#!/bin/sh\necho "{name} $*" >> "{trace}"\nexit 0\n',
|
||||||
|
encoding="utf-8",
|
||||||
|
)
|
||||||
|
tool.chmod(0o755)
|
||||||
|
|
||||||
|
test_script = tmp / "time-sync-under-test.sh"
|
||||||
|
content = TIME_SYNC_SH.read_text(encoding="utf-8")
|
||||||
|
sock_file = tmp / "chronyd.sock"
|
||||||
|
sock_file.touch()
|
||||||
|
content = (
|
||||||
|
content
|
||||||
|
.replace("SOCKET=/run/chrony/chronyd.sock", f"SOCKET={sock_file}")
|
||||||
|
.replace("CHRONYC=/usr/bin/chronyc", f"CHRONYC={chronyc}")
|
||||||
|
.replace("RUNDIR=/run/bananarchy-time-sync", f"RUNDIR={run_dir}")
|
||||||
|
.replace("[ -S \"$SOCKET\" ]", "[ -e \"$SOCKET\" ]")
|
||||||
|
)
|
||||||
|
test_script.write_text(content, encoding="utf-8")
|
||||||
|
test_script.chmod(0o755)
|
||||||
|
|
||||||
|
fifo_reader = subprocess.Popen(
|
||||||
|
["sh", "-c", f'cat "{locker_fifo}" > "{tmp / "locker.out"}"'],
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
env = os.environ.copy()
|
||||||
|
env["PATH"] = f"{fake_bin}:{env['PATH']}"
|
||||||
|
env["BANANARCHY_TIME_SYNC_NO_ESCALATION"] = "1"
|
||||||
|
env["BANANARCHY_TIME_SOURCE_FILE"] = str(tmp / "missing_source")
|
||||||
|
env["BANANARCHY_STATUS_REFRESH_CMD"] = str(fake_bin / "su")
|
||||||
|
env["BANANARCHY_LOCKER_FIFO"] = str(locker_fifo)
|
||||||
|
env["BANANARCHY_COVERCTL"] = str(fake_bin / "bananarchy-coverctl")
|
||||||
|
env["BANANARCHY_SYNC_WAIT"] = "6"
|
||||||
|
env["BANANARCHY_TIME_SYNC_SLEEP"] = "0.02"
|
||||||
|
|
||||||
|
res = subprocess.run([str(test_script), "network-up"], env=env, capture_output=True, text=True)
|
||||||
|
assert res.returncode == 0, res.stderr
|
||||||
|
finally:
|
||||||
|
fifo_reader.wait(timeout=5)
|
||||||
|
|
||||||
|
events = trace.read_text(encoding="utf-8").splitlines()
|
||||||
|
burst_idx = max(i for i, l in enumerate(events) if l.startswith("chronyc burst"))
|
||||||
|
refresh_idx = next(i for i, l in enumerate(events) if "sxmo_hook_statusbar.sh" in l)
|
||||||
|
tracking_after_burst = [i for i, l in enumerate(events) if i > burst_idx and l.startswith("chronyc tracking")]
|
||||||
|
assert tracking_after_burst, f"missing post-burst tracking check: {events}"
|
||||||
|
assert refresh_idx > tracking_after_burst[-1], (
|
||||||
|
f"UI refresh happened before sync confirmed: {events}"
|
||||||
|
)
|
||||||
|
assert any("bananarchy-coverctl REFRESH" in l for l in events), events
|
||||||
|
assert any("killall -q -USR1 bananarchy-run-aligned" in l for l in events), events
|
||||||
|
assert "REFRESH_TIME" in (tmp / "locker.out").read_text(encoding="utf-8")
|
||||||
|
|
||||||
|
|
||||||
|
def test_shell_syntax_and_no_pkill() -> None:
|
||||||
|
scripts = [
|
||||||
|
ROOT / "overlay/rootfs/usr/bin/bananarchy-time-sync.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/bin/bananarchy-gps-time-sync.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/bin/sxmo_timezonechange.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_statusbar.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/sbin/setup-timezone",
|
||||||
|
ROOT / "overlay/rootfs/usr/bin/bananarchy-cover-event.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_lock.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_ring.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_mute_ring.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_discard.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_pickup.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/bin/sxmo_modem.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/bin/sxmo_modemcall.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/bin/sxmo_appmenu.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_contextmenu.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/bin/sxmo_power.sh",
|
||||||
|
ROOT / "scripts/build-dwm-plugins.sh",
|
||||||
|
]
|
||||||
|
for path in scripts:
|
||||||
|
res = subprocess.run(["sh", "-n", str(path)], capture_output=True, text=True)
|
||||||
|
assert res.returncode == 0, f"syntax error in {path}: {res.stderr}"
|
||||||
|
|
||||||
|
no_pkill = [
|
||||||
|
ROOT / "src/dwm-plugins/callscreen_plugin.cpp",
|
||||||
|
ROOT / "overlay/rootfs/usr/bin/bananarchy-cover-event.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_ring.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_mute_ring.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_discard.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_pickup.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/bin/sxmo_modem.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/bin/sxmo_modemcall.sh",
|
||||||
|
ROOT / "overlay/rootfs/usr/bin/sxmo_power.sh",
|
||||||
|
]
|
||||||
|
for path in no_pkill:
|
||||||
|
txt = path.read_text(encoding="utf-8")
|
||||||
|
assert "pkill" not in txt, f"unexpected pkill in {path}"
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> int:
|
||||||
|
with tempfile.TemporaryDirectory() as td:
|
||||||
|
tmp = pathlib.Path(td)
|
||||||
|
test_ba_refresh_tz(tmp)
|
||||||
|
test_run_aligned_sigusr1(tmp)
|
||||||
|
test_time_sync_waits_and_refreshes(tmp)
|
||||||
|
test_shell_syntax_and_no_pkill()
|
||||||
|
print("test-time-timezone-sync: PASS")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
raise SystemExit(main())
|
||||||
@@ -22,7 +22,9 @@
|
|||||||
*/
|
*/
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
|
#include <signal.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
@@ -295,6 +297,12 @@ static const struct glyph font[] = {
|
|||||||
{':', {0x00, 0x36, 0x36, 0x00, 0x00}}, {'-', {0x08, 0x08, 0x08, 0x08, 0x08}},
|
{':', {0x00, 0x36, 0x36, 0x00, 0x00}}, {'-', {0x08, 0x08, 0x08, 0x08, 0x08}},
|
||||||
{'.', {0x00, 0x60, 0x60, 0x00, 0x00}}, {'/', {0x20, 0x10, 0x08, 0x04, 0x02}},
|
{'.', {0x00, 0x60, 0x60, 0x00, 0x00}}, {'/', {0x20, 0x10, 0x08, 0x04, 0x02}},
|
||||||
{'%', {0x23, 0x13, 0x08, 0x64, 0x62}}, {'|', {0x00, 0x00, 0x7f, 0x00, 0x00}},
|
{'%', {0x23, 0x13, 0x08, 0x64, 0x62}}, {'|', {0x00, 0x00, 0x7f, 0x00, 0x00}},
|
||||||
|
{'+', {0x08, 0x08, 0x3e, 0x08, 0x08}}, {'(', {0x00, 0x1c, 0x22, 0x41, 0x00}},
|
||||||
|
{')', {0x00, 0x41, 0x22, 0x1c, 0x00}}, {'*', {0x14, 0x08, 0x3e, 0x08, 0x14}},
|
||||||
|
{'#', {0x14, 0x7f, 0x14, 0x7f, 0x14}}, {',', {0x00, 0x50, 0x30, 0x00, 0x00}},
|
||||||
|
{'!', {0x00, 0x00, 0x5f, 0x00, 0x00}}, {'?', {0x02, 0x01, 0x51, 0x09, 0x06}},
|
||||||
|
{'_', {0x40, 0x40, 0x40, 0x40, 0x40}}, {'[', {0x00, 0x7f, 0x41, 0x41, 0x00}},
|
||||||
|
{']', {0x00, 0x41, 0x41, 0x7f, 0x00}}, {'\'', {0x00, 0x05, 0x03, 0x00, 0x00}},
|
||||||
{' ', {0x00, 0x00, 0x00, 0x00, 0x00}},
|
{' ', {0x00, 0x00, 0x00, 0x00, 0x00}},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -422,6 +430,91 @@ static void frame_text_centered(struct frame *fb, const char *text, int y,
|
|||||||
frame_text(fb, text, x, y, scale, color);
|
frame_text(fb, text, x, y, scale, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Transliterate basic Cyrillic UTF-8 and sanitize caller labels to 5x7 ASCII. */
|
||||||
|
static void sanitize_cover_text(const char *src, char *dst, size_t dstlen)
|
||||||
|
{
|
||||||
|
static const char *const cyr_map[32] = {
|
||||||
|
"A", "B", "V", "G", "D", "E", "ZH", "Z",
|
||||||
|
"I", "Y", "K", "L", "M", "N", "O", "P",
|
||||||
|
"R", "S", "T", "U", "F", "KH", "TS", "CH",
|
||||||
|
"SH", "SHCH", "", "Y", "", "E", "YU", "YA"
|
||||||
|
};
|
||||||
|
const unsigned char *p = (const unsigned char *)(src ? src : "");
|
||||||
|
size_t out = 0;
|
||||||
|
if(!dst || dstlen == 0)
|
||||||
|
return;
|
||||||
|
while(*p && out + 1 < dstlen) {
|
||||||
|
unsigned char b = *p;
|
||||||
|
if(b < 0x80) {
|
||||||
|
char ch = (b >= 0x20 && b < 0x7f) ? (char)toupper(b) : ' ';
|
||||||
|
if(ch == ' ' && (out == 0 || dst[out - 1] == ' ')) {
|
||||||
|
p++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
dst[out++] = ch;
|
||||||
|
p++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if((b == 0xd0 || b == 0xd1 || b == 0xd2) && p[1] >= 0x80 && p[1] <= 0xbf) {
|
||||||
|
unsigned char b2 = p[1];
|
||||||
|
const char *rep = NULL;
|
||||||
|
if(b == 0xd0 && b2 == 0x81)
|
||||||
|
rep = "YO";
|
||||||
|
else if(b == 0xd1 && b2 == 0x91)
|
||||||
|
rep = "YO";
|
||||||
|
else if((b == 0xd0 && b2 == 0x84) || (b == 0xd1 && b2 == 0x94))
|
||||||
|
rep = "YE";
|
||||||
|
else if((b == 0xd0 && b2 == 0x86) || (b == 0xd1 && b2 == 0x96))
|
||||||
|
rep = "I";
|
||||||
|
else if((b == 0xd0 && b2 == 0x87) || (b == 0xd1 && b2 == 0x97))
|
||||||
|
rep = "YI";
|
||||||
|
else if(b == 0xd2 && (b2 == 0x90 || b2 == 0x91))
|
||||||
|
rep = "G";
|
||||||
|
else if(b == 0xd0 && b2 >= 0x90 && b2 <= 0xbf)
|
||||||
|
rep = cyr_map[(b2 - 0x90) % 32];
|
||||||
|
else if(b == 0xd1 && b2 >= 0x80 && b2 <= 0x8f)
|
||||||
|
rep = cyr_map[(b2 - 0x80 + 16) % 32];
|
||||||
|
if(rep) {
|
||||||
|
while(*rep && out + 1 < dstlen)
|
||||||
|
dst[out++] = *rep++;
|
||||||
|
}
|
||||||
|
p += 2;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
p++;
|
||||||
|
while((*p & 0xc0) == 0x80)
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
while(out > 0 && dst[out - 1] == ' ')
|
||||||
|
out--;
|
||||||
|
dst[out] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
static void draw_fit_centered(struct frame *fb, const char *text, int y,
|
||||||
|
int pref_scale, uint32_t color)
|
||||||
|
{
|
||||||
|
char buf[64];
|
||||||
|
int max_chars;
|
||||||
|
int scale = pref_scale;
|
||||||
|
size_t len;
|
||||||
|
if(!text || !*text)
|
||||||
|
return;
|
||||||
|
sanitize_cover_text(text, buf, sizeof(buf));
|
||||||
|
if(!buf[0])
|
||||||
|
return;
|
||||||
|
len = strlen(buf);
|
||||||
|
max_chars = ((int)fb->width - 8) / (6 * scale);
|
||||||
|
if(max_chars < 1)
|
||||||
|
max_chars = 1;
|
||||||
|
if((int)len > max_chars && scale > 1) {
|
||||||
|
scale = 1;
|
||||||
|
max_chars = ((int)fb->width - 8) / 6;
|
||||||
|
}
|
||||||
|
if((int)len > max_chars)
|
||||||
|
buf[max_chars] = '\0';
|
||||||
|
frame_text_centered(fb, buf, y, scale, color);
|
||||||
|
}
|
||||||
|
|
||||||
static int read_uint_file(const char *path, unsigned int *value)
|
static int read_uint_file(const char *path, unsigned int *value)
|
||||||
{
|
{
|
||||||
FILE *handle = fopen(path, "r");
|
FILE *handle = fopen(path, "r");
|
||||||
@@ -505,6 +598,9 @@ struct state {
|
|||||||
char lid[16];
|
char lid[16];
|
||||||
char backend[16];
|
char backend[16];
|
||||||
char call[64];
|
char call[64];
|
||||||
|
char call_num[64];
|
||||||
|
char call_name[64];
|
||||||
|
char call_sim[16];
|
||||||
char message[128];
|
char message[128];
|
||||||
char network[96];
|
char network[96];
|
||||||
int enabled;
|
int enabled;
|
||||||
@@ -520,6 +616,12 @@ struct state {
|
|||||||
int backlight_level;
|
int backlight_level;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int cover_hold_awake(const struct state *state)
|
||||||
|
{
|
||||||
|
return strcmp(state->call, "incoming") == 0 ||
|
||||||
|
strcmp(state->call, "muted") == 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* A lit cover needs a lit framebuffer, a lit backlight and an unblanked fbdev;
|
/* A lit cover needs a lit framebuffer, a lit backlight and an unblanked fbdev;
|
||||||
* everything else is "fully off". TEST modes are diagnostic overrides. */
|
* everything else is "fully off". TEST modes are diagnostic overrides. */
|
||||||
static int cover_is_lit(const struct state *state)
|
static int cover_is_lit(const struct state *state)
|
||||||
@@ -557,10 +659,12 @@ static void render_frame(struct frame *fb, const struct state *state)
|
|||||||
char clock[16];
|
char clock[16];
|
||||||
char date[32];
|
char date[32];
|
||||||
char battery[32];
|
char battery[32];
|
||||||
time_t now = time(NULL);
|
time_t now;
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
unsigned int width = fb->width;
|
unsigned int width = fb->width;
|
||||||
unsigned int height = fb->height;
|
unsigned int height = fb->height;
|
||||||
|
ba_refresh_tz();
|
||||||
|
now = time(NULL);
|
||||||
localtime_r(&now, &tm);
|
localtime_r(&now, &tm);
|
||||||
strftime(clock, sizeof(clock), "%H:%M", &tm);
|
strftime(clock, sizeof(clock), "%H:%M", &tm);
|
||||||
strftime(date, sizeof(date), "%d.%m.%Y", &tm);
|
strftime(date, sizeof(date), "%d.%m.%Y", &tm);
|
||||||
@@ -578,6 +682,42 @@ static void render_frame(struct frame *fb, const struct state *state)
|
|||||||
rgb888(245, 245, 245));
|
rgb888(245, 245, 245));
|
||||||
} else if(!cover_is_lit(state)) {
|
} else if(!cover_is_lit(state)) {
|
||||||
frame_rect(fb, 0, 0, (int)width, (int)height, rgb888(0, 0, 0));
|
frame_rect(fb, 0, 0, (int)width, (int)height, rgb888(0, 0, 0));
|
||||||
|
} else if(cover_hold_awake(state)) {
|
||||||
|
int muted = strcmp(state->call, "muted") == 0;
|
||||||
|
char subhdr[48];
|
||||||
|
char name_san[64];
|
||||||
|
char num_san[64];
|
||||||
|
uint32_t accent = muted ? rgb888(250, 210, 60) : rgb888(80, 220, 120);
|
||||||
|
frame_rect(fb, 0, 0, (int)width, (int)height, rgb888(8, 12, 26));
|
||||||
|
frame_rect(fb, 0, 0, (int)width, 4, accent);
|
||||||
|
frame_text_centered(fb, muted ? "RING MUTED" : "INCOMING CALL",
|
||||||
|
18, 2, accent);
|
||||||
|
if(state->call_sim[0])
|
||||||
|
snprintf(subhdr, sizeof(subhdr), "%s %s", state->call_sim, clock);
|
||||||
|
else
|
||||||
|
snprintf(subhdr, sizeof(subhdr), "%s", clock);
|
||||||
|
frame_text_centered(fb, subhdr, 44, 1, rgb888(140, 180, 240));
|
||||||
|
sanitize_cover_text(state->call_name, name_san, sizeof(name_san));
|
||||||
|
sanitize_cover_text(state->call_num, num_san, sizeof(num_san));
|
||||||
|
if(name_san[0] && num_san[0] && strcmp(name_san, num_san) != 0) {
|
||||||
|
draw_fit_centered(fb, name_san, 78, 2, rgb888(245, 248, 255));
|
||||||
|
draw_fit_centered(fb, num_san, 112, 2, rgb888(160, 210, 250));
|
||||||
|
} else if(name_san[0]) {
|
||||||
|
draw_fit_centered(fb, name_san, 96, 2, rgb888(245, 248, 255));
|
||||||
|
} else {
|
||||||
|
if(!num_san[0])
|
||||||
|
safe_copy(num_san, sizeof(num_san), "UNKNOWN");
|
||||||
|
draw_fit_centered(fb, num_san, 96, 2, rgb888(245, 248, 255));
|
||||||
|
}
|
||||||
|
if(state->battery >= 0) {
|
||||||
|
snprintf(battery, sizeof(battery), "BAT %d%%", state->battery);
|
||||||
|
frame_text_centered(fb, battery, (int)height - 52, 1,
|
||||||
|
rgb888(250, 210, 60));
|
||||||
|
}
|
||||||
|
frame_text_centered(fb, muted ? "RINGER MUTED" : "VOL: MUTE RING",
|
||||||
|
(int)height - 34, 1, rgb888(250, 210, 60));
|
||||||
|
frame_text_centered(fb, "PWR: HANG UP",
|
||||||
|
(int)height - 18, 1, rgb888(255, 110, 110));
|
||||||
} else {
|
} else {
|
||||||
int clock_scale = width >= 220 ? 5 : 3;
|
int clock_scale = width >= 220 ? 5 : 3;
|
||||||
int clock_h = 7 * clock_scale;
|
int clock_h = 7 * clock_scale;
|
||||||
@@ -2210,6 +2350,21 @@ static int test_value(const char *mode)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void spawn_cover_event(const char *action, const char *arg)
|
||||||
|
{
|
||||||
|
const char *cmd = getenv("BANANARCHY_COVER_EVENT_CMD");
|
||||||
|
const char *bin = (cmd && *cmd) ? cmd : "/usr/bin/bananarchy-cover-event.sh";
|
||||||
|
char *const argv_with_arg[] = {
|
||||||
|
(char *)bin, (char *)action, (char *)arg, NULL
|
||||||
|
};
|
||||||
|
char *const argv_no_arg[] = {
|
||||||
|
(char *)bin, (char *)action, NULL
|
||||||
|
};
|
||||||
|
if(!action || !*action)
|
||||||
|
return;
|
||||||
|
spawn_async_cmd((arg && *arg) ? argv_with_arg : argv_no_arg);
|
||||||
|
}
|
||||||
|
|
||||||
/* A closed flip lights the outer panel only. Status updates (NETWORK,
|
/* A closed flip lights the outer panel only. Status updates (NETWORK,
|
||||||
* BATTERY) refresh an already visible cover but never wake it; real events
|
* BATTERY) refresh an already visible cover but never wake it; real events
|
||||||
* (BUTTON, WAKE, CALL, NOTIFY, SMS) do. */
|
* (BUTTON, WAKE, CALL, NOTIFY, SMS) do. */
|
||||||
@@ -2281,6 +2436,7 @@ static void handle_command(char *buffer, struct state *state,
|
|||||||
}
|
}
|
||||||
} else if(strcmp(command, "BUTTON") == 0 ||
|
} else if(strcmp(command, "BUTTON") == 0 ||
|
||||||
strcmp(command, "WAKE") == 0) {
|
strcmp(command, "WAKE") == 0) {
|
||||||
|
char *sub = strtok_r(NULL, " \t\r\n", &save);
|
||||||
/* Trusted external side button, or a main-panel wake request that the
|
/* Trusted external side button, or a main-panel wake request that the
|
||||||
* closed-lid gate forwarded to the cover display. Ignore WAKE (never
|
* closed-lid gate forwarded to the cover display. Ignore WAKE (never
|
||||||
* BUTTON) during the 450 ms close-settle window so dwm's spurious
|
* BUTTON) during the 450 ms close-settle window so dwm's spurious
|
||||||
@@ -2289,6 +2445,29 @@ static void handle_command(char *buffer, struct state *state,
|
|||||||
state->closed_since_ms > 0 &&
|
state->closed_since_ms > 0 &&
|
||||||
now_ms() - state->closed_since_ms < 450)
|
now_ms() - state->closed_since_ms < 450)
|
||||||
return;
|
return;
|
||||||
|
if(strcmp(command, "BUTTON") == 0 && sub &&
|
||||||
|
strcmp(state->lid, "closed") == 0 && cover_hold_awake(state)) {
|
||||||
|
upper_string(sub);
|
||||||
|
if(strcmp(sub, "VOLUP") == 0 || strcmp(sub, "VOLDOWN") == 0) {
|
||||||
|
if(strcmp(state->call, "incoming") == 0) {
|
||||||
|
safe_copy(state->call, sizeof(state->call), "muted");
|
||||||
|
spawn_cover_event("mute-ring", state->call_num);
|
||||||
|
}
|
||||||
|
cover_wake(state, redraw);
|
||||||
|
*redraw = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(strcmp(sub, "POWER") == 0) {
|
||||||
|
safe_copy(state->call, sizeof(state->call), "none");
|
||||||
|
state->call_num[0] = '\0';
|
||||||
|
state->call_name[0] = '\0';
|
||||||
|
state->call_sim[0] = '\0';
|
||||||
|
spawn_cover_event("hangup-call", "");
|
||||||
|
cover_wake(state, redraw);
|
||||||
|
*redraw = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
cover_wake(state, redraw);
|
cover_wake(state, redraw);
|
||||||
} else if(strcmp(command, "NETWORK") == 0) {
|
} else if(strcmp(command, "NETWORK") == 0) {
|
||||||
char *rest = save;
|
char *rest = save;
|
||||||
@@ -2308,12 +2487,107 @@ static void handle_command(char *buffer, struct state *state,
|
|||||||
if(state->visible)
|
if(state->visible)
|
||||||
*redraw = 1;
|
*redraw = 1;
|
||||||
} else if(strcmp(command, "CALL") == 0) {
|
} else if(strcmp(command, "CALL") == 0) {
|
||||||
char *value = strtok_r(NULL, " \t\r\n", &save);
|
char *rest = save;
|
||||||
if(value) {
|
char status[64] = "";
|
||||||
safe_copy(state->call, sizeof(state->call), value);
|
char num[64] = "";
|
||||||
lower_string(state->call);
|
char name[64] = "";
|
||||||
if(strcmp(state->call, "none") != 0)
|
char sim[16] = "";
|
||||||
|
while(rest && (*rest == ' ' || *rest == '\t'))
|
||||||
|
rest++;
|
||||||
|
if(rest && *rest) {
|
||||||
|
trim(rest);
|
||||||
|
if(strchr(rest, '|')) {
|
||||||
|
char *parts[4] = { NULL, NULL, NULL, NULL };
|
||||||
|
int idx = 0;
|
||||||
|
char *p = rest;
|
||||||
|
parts[idx++] = p;
|
||||||
|
while((p = strchr(p, '|')) != NULL && idx < 4) {
|
||||||
|
*p++ = '\0';
|
||||||
|
parts[idx++] = p;
|
||||||
|
}
|
||||||
|
if(parts[0]) safe_copy(status, sizeof(status), parts[0]);
|
||||||
|
if(parts[1]) safe_copy(num, sizeof(num), parts[1]);
|
||||||
|
if(parts[2]) safe_copy(name, sizeof(name), parts[2]);
|
||||||
|
if(parts[3]) safe_copy(sim, sizeof(sim), parts[3]);
|
||||||
|
} else {
|
||||||
|
char *t0 = strtok_r(rest, " \t\r\n", &save);
|
||||||
|
char *t1 = t0 ? strtok_r(NULL, " \t\r\n", &save) : NULL;
|
||||||
|
char *t2 = t1 ? strtok_r(NULL, " \t\r\n", &save) : NULL;
|
||||||
|
char *t3 = t2 ? strtok_r(NULL, " \t\r\n", &save) : NULL;
|
||||||
|
if(t0) safe_copy(status, sizeof(status), t0);
|
||||||
|
if(t1) safe_copy(num, sizeof(num), t1);
|
||||||
|
if(t2) safe_copy(name, sizeof(name), t2);
|
||||||
|
if(t3) safe_copy(sim, sizeof(sim), t3);
|
||||||
|
}
|
||||||
|
trim(status);
|
||||||
|
lower_string(status);
|
||||||
|
trim(num);
|
||||||
|
trim(name);
|
||||||
|
trim(sim);
|
||||||
|
if(strcmp(num, "-") == 0) num[0] = '\0';
|
||||||
|
if(strcmp(name, "-") == 0) name[0] = '\0';
|
||||||
|
if(strcmp(sim, "-") == 0) sim[0] = '\0';
|
||||||
|
if(strcmp(status, "none") == 0) {
|
||||||
|
safe_copy(state->call, sizeof(state->call), "none");
|
||||||
|
state->call_num[0] = '\0';
|
||||||
|
state->call_name[0] = '\0';
|
||||||
|
state->call_sim[0] = '\0';
|
||||||
|
state->last_input_ms = now_ms();
|
||||||
|
if(state->visible)
|
||||||
|
*redraw = 1;
|
||||||
|
} else if(strcmp(status, "muted") == 0) {
|
||||||
|
if(strcmp(state->call, "incoming") != 0 &&
|
||||||
|
strcmp(state->call, "muted") != 0)
|
||||||
|
return;
|
||||||
|
safe_copy(state->call, sizeof(state->call), "muted");
|
||||||
|
if(num[0]) safe_copy(state->call_num, sizeof(state->call_num), num);
|
||||||
|
if(name[0]) safe_copy(state->call_name, sizeof(state->call_name), name);
|
||||||
|
if(sim[0]) safe_copy(state->call_sim, sizeof(state->call_sim), sim);
|
||||||
cover_wake(state, redraw);
|
cover_wake(state, redraw);
|
||||||
|
*redraw = 1;
|
||||||
|
} else if(strcmp(status, "incoming") == 0) {
|
||||||
|
if(num[0] && strcmp(state->call_num, num) != 0) {
|
||||||
|
safe_copy(state->call_num, sizeof(state->call_num), num);
|
||||||
|
state->call_name[0] = '\0';
|
||||||
|
}
|
||||||
|
if(name[0])
|
||||||
|
safe_copy(state->call_name, sizeof(state->call_name), name);
|
||||||
|
if(sim[0])
|
||||||
|
safe_copy(state->call_sim, sizeof(state->call_sim), sim);
|
||||||
|
safe_copy(state->call, sizeof(state->call), "incoming");
|
||||||
|
cover_wake(state, redraw);
|
||||||
|
*redraw = 1;
|
||||||
|
} else if(strcmp(status, "missed") == 0) {
|
||||||
|
const char *who = name[0] ? name :
|
||||||
|
(num[0] ? num :
|
||||||
|
(state->call_name[0] ? state->call_name :
|
||||||
|
state->call_num));
|
||||||
|
if(who && *who) {
|
||||||
|
char clean_who[64];
|
||||||
|
sanitize_cover_text(who, clean_who, sizeof(clean_who));
|
||||||
|
if(clean_who[0])
|
||||||
|
snprintf(state->message, sizeof(state->message),
|
||||||
|
"MISSED: %s", clean_who);
|
||||||
|
else
|
||||||
|
snprintf(state->message, sizeof(state->message), "MISSED CALL");
|
||||||
|
} else {
|
||||||
|
snprintf(state->message, sizeof(state->message), "MISSED CALL");
|
||||||
|
}
|
||||||
|
safe_copy(state->call, sizeof(state->call), "missed");
|
||||||
|
state->call_num[0] = '\0';
|
||||||
|
state->call_name[0] = '\0';
|
||||||
|
state->call_sim[0] = '\0';
|
||||||
|
cover_wake(state, redraw);
|
||||||
|
*redraw = 1;
|
||||||
|
} else if(strcmp(status, "active") == 0) {
|
||||||
|
safe_copy(state->call, sizeof(state->call), "active");
|
||||||
|
state->last_input_ms = now_ms();
|
||||||
|
if(state->visible)
|
||||||
|
*redraw = 1;
|
||||||
|
} else if(status[0]) {
|
||||||
|
safe_copy(state->call, sizeof(state->call), status);
|
||||||
|
cover_wake(state, redraw);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if(strcmp(command, "SMS") == 0) {
|
} else if(strcmp(command, "SMS") == 0) {
|
||||||
char *value = strtok_r(NULL, " \t\r\n", &save);
|
char *value = strtok_r(NULL, " \t\r\n", &save);
|
||||||
@@ -2438,6 +2712,7 @@ static void handle_command(char *buffer, struct state *state,
|
|||||||
} else if(strcmp(command, "REFRESH") == 0 ||
|
} else if(strcmp(command, "REFRESH") == 0 ||
|
||||||
strcmp(command, "RELOAD_THEME") == 0 ||
|
strcmp(command, "RELOAD_THEME") == 0 ||
|
||||||
strcmp(command, "STATUS") == 0) {
|
strcmp(command, "STATUS") == 0) {
|
||||||
|
ba_refresh_tz();
|
||||||
refresh_blank_timeout(state);
|
refresh_blank_timeout(state);
|
||||||
if(state->visible && strcmp(command, "STATUS") != 0)
|
if(state->visible && strcmp(command, "STATUS") != 0)
|
||||||
*redraw = 1;
|
*redraw = 1;
|
||||||
@@ -2480,6 +2755,24 @@ static void reply_for(char *buffer, const struct state *state,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static volatile sig_atomic_t g_stop_requested = 0;
|
||||||
|
|
||||||
|
static void handle_stop_signal(int sig)
|
||||||
|
{
|
||||||
|
(void)sig;
|
||||||
|
g_stop_requested = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void install_stop_handlers(void)
|
||||||
|
{
|
||||||
|
struct sigaction sa;
|
||||||
|
memset(&sa, 0, sizeof(sa));
|
||||||
|
sa.sa_handler = handle_stop_signal;
|
||||||
|
sigemptyset(&sa.sa_mask);
|
||||||
|
sigaction(SIGTERM, &sa, NULL);
|
||||||
|
sigaction(SIGINT, &sa, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
const char *lock_path = getenv("BANANARCHY_COVER_LOCK");
|
const char *lock_path = getenv("BANANARCHY_COVER_LOCK");
|
||||||
@@ -2501,6 +2794,7 @@ int main(int argc, char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
(void)lock_fd;
|
(void)lock_fd;
|
||||||
install_reaper();
|
install_reaper();
|
||||||
|
install_stop_handlers();
|
||||||
if(argc > 2 && strcmp(argv[1], "--config") == 0)
|
if(argc > 2 && strcmp(argv[1], "--config") == 0)
|
||||||
config = argv[2];
|
config = argv[2];
|
||||||
memset(&state, 0, sizeof(state));
|
memset(&state, 0, sizeof(state));
|
||||||
@@ -2532,7 +2826,7 @@ int main(int argc, char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
chmod(socket_path, 0660);
|
chmod(socket_path, 0660);
|
||||||
chown(socket_path, 0, SESSION_GID);
|
chown(socket_path, 0, SESSION_GID);
|
||||||
while(1) {
|
while(!g_stop_requested) {
|
||||||
struct pollfd pfds[2];
|
struct pollfd pfds[2];
|
||||||
nfds_t nfds = 1;
|
nfds_t nfds = 1;
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
@@ -2542,6 +2836,7 @@ int main(int argc, char **argv)
|
|||||||
socklen_t peer_len = sizeof(peer);
|
socklen_t peer_len = sizeof(peer);
|
||||||
ssize_t nread;
|
ssize_t nread;
|
||||||
long long now = now_ms();
|
long long now = now_ms();
|
||||||
|
int pr;
|
||||||
/* With the cover off there is no timer at all: poll blocks until IPC. */
|
/* With the cover off there is no timer at all: poll blocks until IPC. */
|
||||||
int timeout_ms = -1;
|
int timeout_ms = -1;
|
||||||
if(state.visible) {
|
if(state.visible) {
|
||||||
@@ -2551,7 +2846,9 @@ int main(int argc, char **argv)
|
|||||||
refresh_blank_timeout(&state);
|
refresh_blank_timeout(&state);
|
||||||
if(next < 1)
|
if(next < 1)
|
||||||
next = 1;
|
next = 1;
|
||||||
if(state.blank_ms > 0) {
|
if(cover_hold_awake(&state)) {
|
||||||
|
state.last_input_ms = now;
|
||||||
|
} else if(state.blank_ms > 0) {
|
||||||
long long remaining = state.blank_ms - (now - state.last_input_ms);
|
long long remaining = state.blank_ms - (now - state.last_input_ms);
|
||||||
if(remaining <= 0) {
|
if(remaining <= 0) {
|
||||||
state.visible = 0;
|
state.visible = 0;
|
||||||
@@ -2580,7 +2877,9 @@ int main(int argc, char **argv)
|
|||||||
long long interval = strcmp(hw.backend, "kernel") == 0 ?
|
long long interval = strcmp(hw.backend, "kernel") == 0 ?
|
||||||
KERNEL_REDRAW_MS : CLOCK_REDRAW_MS;
|
KERNEL_REDRAW_MS : CLOCK_REDRAW_MS;
|
||||||
long long next = interval;
|
long long next = interval;
|
||||||
if(state.blank_ms > 0) {
|
if(cover_hold_awake(&state)) {
|
||||||
|
state.last_input_ms = now;
|
||||||
|
} else if(state.blank_ms > 0) {
|
||||||
long long remaining = state.blank_ms - (now - state.last_input_ms);
|
long long remaining = state.blank_ms - (now - state.last_input_ms);
|
||||||
if(remaining < 1)
|
if(remaining < 1)
|
||||||
remaining = 1;
|
remaining = 1;
|
||||||
@@ -2603,7 +2902,15 @@ int main(int argc, char **argv)
|
|||||||
pfds[1].revents = 0;
|
pfds[1].revents = 0;
|
||||||
nfds = 2;
|
nfds = 2;
|
||||||
}
|
}
|
||||||
if(poll(pfds, nfds, timeout_ms) == 0 && pending_until > now &&
|
pr = poll(pfds, nfds, timeout_ms);
|
||||||
|
if(pr < 0) {
|
||||||
|
if(errno == EINTR && g_stop_requested)
|
||||||
|
break;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(g_stop_requested)
|
||||||
|
break;
|
||||||
|
if(pr == 0 && pending_until > now &&
|
||||||
strcmp(state.backend, "pending") == 0) {
|
strcmp(state.backend, "pending") == 0) {
|
||||||
redraw = 1;
|
redraw = 1;
|
||||||
}
|
}
|
||||||
@@ -2624,14 +2931,20 @@ int main(int argc, char **argv)
|
|||||||
sendto(server, reply, strlen(reply), 0,
|
sendto(server, reply, strlen(reply), 0,
|
||||||
(struct sockaddr *)&peer, peer_len);
|
(struct sockaddr *)&peer, peer_len);
|
||||||
if(strncasecmp(original, "QUIT", 4) == 0) {
|
if(strncasecmp(original, "QUIT", 4) == 0) {
|
||||||
|
g_stop_requested = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
state.visible = 0;
|
||||||
|
state.test = 0;
|
||||||
set_backlight(&state, 0);
|
set_backlight(&state, 0);
|
||||||
|
if(strcmp(state.lid, "closed") == 0 &&
|
||||||
|
(hw.kernel_lit > 0 || hw.mux_claimed))
|
||||||
|
cover_draw(&hw, fb_path, &state);
|
||||||
cover_hw_shutdown(&hw);
|
cover_hw_shutdown(&hw);
|
||||||
close(server);
|
close(server);
|
||||||
unlink(socket_path);
|
unlink(socket_path);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <sys/un.h>
|
||||||
#if defined(__has_include) && __has_include(<linux/qrtr.h>)
|
#if defined(__has_include) && __has_include(<linux/qrtr.h>)
|
||||||
#include <linux/qrtr.h>
|
#include <linux/qrtr.h>
|
||||||
#else
|
#else
|
||||||
@@ -98,10 +99,12 @@ static BA_UNUSED void sleep_ms(int ms)
|
|||||||
|
|
||||||
static void format_now_iso(char *out, size_t len)
|
static void format_now_iso(char *out, size_t len)
|
||||||
{
|
{
|
||||||
time_t now = time(NULL);
|
time_t now;
|
||||||
struct tm tm_now;
|
struct tm tm_now;
|
||||||
char base[32];
|
char base[32];
|
||||||
char tz[16];
|
char tz[16];
|
||||||
|
ba_refresh_tz();
|
||||||
|
now = time(NULL);
|
||||||
localtime_r(&now, &tm_now);
|
localtime_r(&now, &tm_now);
|
||||||
strftime(base, sizeof(base), "%Y-%m-%dT%H:%M:%S", &tm_now);
|
strftime(base, sizeof(base), "%Y-%m-%dT%H:%M:%S", &tm_now);
|
||||||
strftime(tz, sizeof(tz), "%z", &tm_now);
|
strftime(tz, sizeof(tz), "%z", &tm_now);
|
||||||
@@ -1453,6 +1456,42 @@ static int parse_call_info(const uint8_t *pkt, size_t pkt_len,
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int is_live_call_entry(const char *cdir, const char *name)
|
||||||
|
{
|
||||||
|
const char *dot;
|
||||||
|
const char *ext;
|
||||||
|
size_t i;
|
||||||
|
static const char *const live_exts[] = {
|
||||||
|
"pickedupcall", "initiatedcall", "ringing-in", "dialing",
|
||||||
|
"ringing-out", "active", "held", "waiting",
|
||||||
|
};
|
||||||
|
static const char *const term_exts[] = {
|
||||||
|
"discardedcall", "hangedupcall", "terminated", "blockedcall",
|
||||||
|
};
|
||||||
|
|
||||||
|
if(!name || name[0] == '\0' || name[0] == '.')
|
||||||
|
return 0;
|
||||||
|
dot = strrchr(name, '.');
|
||||||
|
if(!dot || dot == name || dot[1] == '\0')
|
||||||
|
return 0;
|
||||||
|
ext = dot + 1;
|
||||||
|
for(i = 0; i < sizeof(live_exts) / sizeof(live_exts[0]); i++) {
|
||||||
|
if(strcmp(ext, live_exts[i]) == 0)
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if(strcmp(ext, "monitoredcall") == 0) {
|
||||||
|
char p[PATH_MAX];
|
||||||
|
int blen = (int)(dot - name);
|
||||||
|
for(i = 0; i < sizeof(term_exts) / sizeof(term_exts[0]); i++) {
|
||||||
|
int n = snprintf(p, sizeof(p), "%s/%.*s.%s", cdir, blen, name, term_exts[i]);
|
||||||
|
if(n > 0 && (size_t)n < sizeof(p) && access(p, F_OK) == 0)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int has_sub1_call_files(void)
|
static int has_sub1_call_files(void)
|
||||||
{
|
{
|
||||||
DIR *dir = opendir(CALLS_DIR);
|
DIR *dir = opendir(CALLS_DIR);
|
||||||
@@ -1460,7 +1499,8 @@ static int has_sub1_call_files(void)
|
|||||||
if(!dir)
|
if(!dir)
|
||||||
return 0;
|
return 0;
|
||||||
while((de = readdir(dir)) != NULL) {
|
while((de = readdir(dir)) != NULL) {
|
||||||
if(strncmp(de->d_name, "sub1_", 5) == 0) {
|
if(strncmp(de->d_name, "sub1_", 5) == 0 &&
|
||||||
|
is_live_call_entry(CALLS_DIR, de->d_name)) {
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -1476,7 +1516,8 @@ static int has_mm_call_files(void)
|
|||||||
if(!dir)
|
if(!dir)
|
||||||
return 0;
|
return 0;
|
||||||
while((de = readdir(dir)) != NULL) {
|
while((de = readdir(dir)) != NULL) {
|
||||||
if(isdigit((unsigned char)de->d_name[0])) {
|
if(isdigit((unsigned char)de->d_name[0]) &&
|
||||||
|
is_live_call_entry(CALLS_DIR, de->d_name)) {
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -1586,6 +1627,42 @@ static void cleanup_call_files_for_key(const char *call_key, int all_for_key)
|
|||||||
closedir(dir);
|
closedir(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void send_cover_call_event(const char *status, const char *num, int sim_slot)
|
||||||
|
{
|
||||||
|
struct sockaddr_un addr;
|
||||||
|
char clean[96];
|
||||||
|
char msg[192];
|
||||||
|
size_t i = 0;
|
||||||
|
int fd;
|
||||||
|
int n;
|
||||||
|
if(is_non_flip_profile() || !status || !*status)
|
||||||
|
return;
|
||||||
|
if(num) {
|
||||||
|
for(; num[i] && i + 1 < sizeof(clean); i++) {
|
||||||
|
char c = num[i];
|
||||||
|
clean[i] = (c == '|' || c == '\n' || c == '\r' || c == '\t') ? ' ' : c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clean[i] = '\0';
|
||||||
|
fd = socket(AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0);
|
||||||
|
if(fd < 0)
|
||||||
|
return;
|
||||||
|
memset(&addr, 0, sizeof(addr));
|
||||||
|
addr.sun_family = AF_UNIX;
|
||||||
|
snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", "/run/bananarchy/cover.sock");
|
||||||
|
if(sim_slot == 1 || sim_slot == 2) {
|
||||||
|
n = snprintf(msg, sizeof(msg), "CALL %s|%s||SIM%d\n", status, clean, sim_slot);
|
||||||
|
} else {
|
||||||
|
n = snprintf(msg, sizeof(msg), "CALL %s|%s||\n", status, clean);
|
||||||
|
}
|
||||||
|
if(n > 0) {
|
||||||
|
size_t len = (size_t)n < sizeof(msg) ? (size_t)n : sizeof(msg) - 1;
|
||||||
|
(void)sendto(fd, msg, len, MSG_DONTWAIT | MSG_NOSIGNAL,
|
||||||
|
(const struct sockaddr *)&addr, sizeof(addr));
|
||||||
|
}
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
|
|
||||||
static void sync_sub1_calls(struct voice_call *calls, int n_calls, int sim_slot,
|
static void sync_sub1_calls(struct voice_call *calls, int n_calls, int sim_slot,
|
||||||
int vs, const struct sockaddr_qrtr *voice_addr)
|
int vs, const struct sockaddr_qrtr *voice_addr)
|
||||||
{
|
{
|
||||||
@@ -1719,6 +1796,7 @@ static void sync_sub1_calls(struct voice_call *calls, int n_calls, int sim_slot,
|
|||||||
snprintf(fifo_msg, sizeof(fifo_msg), "INCOMING %s %s SIM%d",
|
snprintf(fifo_msg, sizeof(fifo_msg), "INCOMING %s %s SIM%d",
|
||||||
call_key, num, sim_slot);
|
call_key, num, sim_slot);
|
||||||
send_fifo_line("/tmp/dwm_plugin_callscreen.fifo", fifo_msg);
|
send_fifo_line("/tmp/dwm_plugin_callscreen.fifo", fifo_msg);
|
||||||
|
send_cover_call_event("incoming", num, sim_slot);
|
||||||
snprintf(ring_cmd, sizeof(ring_cmd),
|
snprintf(ring_cmd, sizeof(ring_cmd),
|
||||||
"sxmo_jobs.sh start --group ringing sxmo_hook_ring.sh '%s'",
|
"sxmo_jobs.sh start --group ringing sxmo_hook_ring.sh '%s'",
|
||||||
num);
|
num);
|
||||||
@@ -1746,6 +1824,7 @@ static void sync_sub1_calls(struct voice_call *calls, int n_calls, int sim_slot,
|
|||||||
snprintf(fifo_msg, sizeof(fifo_msg), "ACTIVE %s %s SIM%d",
|
snprintf(fifo_msg, sizeof(fifo_msg), "ACTIVE %s %s SIM%d",
|
||||||
call_key, num, sim_slot);
|
call_key, num, sim_slot);
|
||||||
send_fifo_line("/tmp/dwm_plugin_callscreen.fifo", fifo_msg);
|
send_fifo_line("/tmp/dwm_plugin_callscreen.fifo", fifo_msg);
|
||||||
|
send_cover_call_event("active", num, sim_slot);
|
||||||
} else if(strcmp(st, "terminated") == 0) {
|
} else if(strcmp(st, "terminated") == 0) {
|
||||||
char log_line[256];
|
char log_line[256];
|
||||||
const char *evt = (strcmp(prev, "ringing-in") == 0) ?
|
const char *evt = (strcmp(prev, "ringing-in") == 0) ?
|
||||||
@@ -1754,6 +1833,8 @@ static void sync_sub1_calls(struct voice_call *calls, int n_calls, int sim_slot,
|
|||||||
snprintf(log_line, sizeof(log_line), "%s\t%s\t%s\t[SIM %d]\n",
|
snprintf(log_line, sizeof(log_line), "%s\t%s\t%s\t[SIM %d]\n",
|
||||||
now_str, evt, num, sim_slot);
|
now_str, evt, num, sim_slot);
|
||||||
append_modemlog(log_line);
|
append_modemlog(log_line);
|
||||||
|
send_cover_call_event(strcmp(prev, "ringing-in") == 0 ? "missed" : "none",
|
||||||
|
num, sim_slot);
|
||||||
if(!hangup_req)
|
if(!hangup_req)
|
||||||
send_fifo_line("/tmp/dwm_plugin_callscreen.fifo", "ENDED CALL ENDED");
|
send_fifo_line("/tmp/dwm_plugin_callscreen.fifo", "ENDED CALL ENDED");
|
||||||
sent_ended = 1;
|
sent_ended = 1;
|
||||||
@@ -1789,6 +1870,7 @@ static void sync_sub1_calls(struct voice_call *calls, int n_calls, int sim_slot,
|
|||||||
}
|
}
|
||||||
if(removed_stale) {
|
if(removed_stale) {
|
||||||
stop_ringing_user();
|
stop_ringing_user();
|
||||||
|
send_cover_call_event("none", "", 0);
|
||||||
if(!sent_ended && !hangup_req)
|
if(!sent_ended && !hangup_req)
|
||||||
send_fifo_line("/tmp/dwm_plugin_callscreen.fifo", "ENDED CALL ENDED");
|
send_fifo_line("/tmp/dwm_plugin_callscreen.fifo", "ENDED CALL ENDED");
|
||||||
}
|
}
|
||||||
|
|||||||
Loaded 100 of 110 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user