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,7 @@ fi
|
||||
|
||||
# We use this directory to store states, so it must exist
|
||||
mkdir -p "$XDG_RUNTIME_DIR/sxmo_calls"
|
||||
HANGUP_FLAG="${SXMO_HANGUP_FLAG:-/tmp/sxmo_hangup_requested}"
|
||||
|
||||
stderr() {
|
||||
sxmo_log "$*"
|
||||
@@ -37,8 +38,25 @@ cleanupnumber() {
|
||||
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() {
|
||||
exec 3<> "$XDG_RUNTIME_DIR/sxmo_modem.checkforfinishedcalls.lock"
|
||||
exec 3<> "$XDG_RUNTIME_DIR/sxmo_modem.voicecalls.lock"
|
||||
flock -x 3
|
||||
#find all finished calls
|
||||
for FINISHEDCALLID in $(
|
||||
@@ -67,7 +85,7 @@ checkforfinishedcalls() {
|
||||
STATE=pickedup
|
||||
stderr "Finished call from $FINISHEDNUMBER"
|
||||
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
|
||||
STATE=wehangedup
|
||||
stderr "Finished call from $FINISHEDNUMBER"
|
||||
@@ -111,11 +129,10 @@ checkforfinishedcalls() {
|
||||
if ! sxmo_modemcall.sh list_active_calls | grep -q .; then
|
||||
# Cleanup
|
||||
sxmo_jobs.sh stop ringing
|
||||
pkill -TERM -f sxmo_hook_ring.sh 2>/dev/null || true
|
||||
pkill -TERM -f "pw-play.*ring" 2>/dev/null || true
|
||||
pkill -TERM -f "mpv.*ring" 2>/dev/null || true
|
||||
pkill -TERM -x sxmo_vibrate 2>/dev/null || true
|
||||
rm -f "$XDG_RUNTIME_DIR/sxmo_calls/"* 2>/dev/null || true
|
||||
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
|
||||
rm -f "$XDG_RUNTIME_DIR/sxmo_calls/"* "$HANGUP_FLAG" 2>/dev/null || true
|
||||
if [ "$STATE" != muted ] && [ ! -f "$XDG_CONFIG_HOME/sxmo/.novibrate" ]; then
|
||||
sxmo_vibrate 600 &
|
||||
fi
|
||||
@@ -135,10 +152,9 @@ checkforfinishedcalls() {
|
||||
# Or refresh the menu
|
||||
if ! sxmo_modemcall.sh list_active_calls | grep -q "ringing-in"; then
|
||||
sxmo_jobs.sh stop ringing
|
||||
pkill -TERM -f sxmo_hook_ring.sh 2>/dev/null || true
|
||||
pkill -TERM -f "pw-play.*ring" 2>/dev/null || true
|
||||
pkill -TERM -f "mpv.*ring" 2>/dev/null || true
|
||||
pkill -TERM -x sxmo_vibrate 2>/dev/null || true
|
||||
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
|
||||
fi
|
||||
sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incall_menu
|
||||
fi
|
||||
@@ -146,6 +162,8 @@ checkforfinishedcalls() {
|
||||
}
|
||||
|
||||
checkforincomingcalls() {
|
||||
exec 3<> "$XDG_RUNTIME_DIR/sxmo_modem.voicecalls.lock"
|
||||
flock -x 3
|
||||
VOICECALLID="$(
|
||||
mmcli -m any --voice-list-calls -a |
|
||||
grep -Eo '[0-9]+ incoming \(ringing-in\)' |
|
||||
@@ -153,7 +171,12 @@ checkforincomingcalls() {
|
||||
)"
|
||||
[ -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
|
||||
touch "$XDG_RUNTIME_DIR/sxmo_calls/${VOICECALLID}.monitoredcall" #this signals that we handled the call
|
||||
|
||||
@@ -172,6 +195,11 @@ checkforincomingcalls() {
|
||||
else
|
||||
stderr "Invoking ring hook (async)"
|
||||
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"
|
||||
|
||||
mkdir -p "$SXMO_LOGDIR"
|
||||
@@ -194,7 +222,7 @@ checkforincomingcalls() {
|
||||
| grep -q .; then
|
||||
# Refresh the 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
|
||||
sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incoming_call_menu "$VOICECALLID"
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user