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
+2728
-285
No files matched your search
@@ -17,6 +17,8 @@ BIN = BASE / "overlay/rootfs/usr/bin"
|
||||
LOCK = BIN / "bananarchy-idle-lock.sh"
|
||||
BLANK = BIN / "bananarchy-idle-blank.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"
|
||||
|
||||
WM_STUB = '''#!/bin/sh
|
||||
@@ -183,6 +185,152 @@ def main():
|
||||
if "bananarchy-idle-lock.sh cancel" not in UNLOCK_HOOK.read_text():
|
||||
return failure("sxmo_hook_unlock.sh does not 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")
|
||||
print("idle blank screenlock wiring: all checks passed")
|
||||
return 0
|
||||
|
||||
Reference in new issue
Block a user