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
@@ -138,6 +138,130 @@ class DsdsDaemonTests(unittest.TestCase):
|
||||
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)
|
||||
|
||||
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__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user