Add Dual-SIM Dual Standby (DSDS), outgoing SIM selection, and instant charging icon update

This commit is contained in:
Luxferre committed 2026-10-27 11:36:00 +02:00
1 parent 5132deb4d8
commit 46f1255905
28 files changed
+2560 -280

No files matched your search

+54 -6
View File
@@ -14,17 +14,24 @@ mkdir -p "$XDG_RUNTIME_DIR/sxmo_calls"
set -e
vid_to_number() {
mmcli -m any -o "$1" -K | \
grep call.properties.number | \
cut -d ':' -f2 | \
tr -d ' '
case "$1" in
sub1_*|sub0_*)
doas -n /usr/libexec/msm-modem-uim-selection call-list 2>/dev/null | awk -F'\t' -v id="$1" '$1 == id {print $4; exit}'
;;
*)
mmcli -m any -o "$1" -K 2>/dev/null | \
grep call.properties.number | \
cut -d ':' -f2 | \
tr -d ' '
;;
esac
}
log_event() {
EVT_HANDLE="$1"
EVT_VID="$2"
NUM="$(vid_to_number "$EVT_VID")"
NUM="$(vid_to_number "$EVT_VID" 2>/dev/null || true)"
TIME="$(date +%FT%H:%M:%S%z)"
mkdir -p "$SXMO_LOGDIR"
@@ -35,6 +42,22 @@ pickup() {
CALLID="$1"
NUM="$(vid_to_number "$CALLID" 2>/dev/null || true)"
case "$CALLID" in
sub1_*|sub0_*)
sxmo_log "Invoking pickup hook for $CALLID"
sxmo_hook_pickup.sh || true
doas -n dbus-send --system --type=signal / org.ofono.VoiceCallManager.CallAdded >/dev/null 2>&1 || true
sxmo_modemaudio.sh setup_audio || true
doas -n /usr/libexec/msm-modem-uim-selection call-accept "$CALLID" >/dev/null 2>&1 || \
/usr/libexec/msm-modem-uim-selection call-accept "$CALLID" >/dev/null 2>&1 || true
touch "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.pickedupcall"
if command -v xcallscreen >/dev/null 2>&1; then
xcallscreen active "$CALLID" "$NUM" >/dev/null 2>&1 || true
fi
return 0
;;
esac
DIRECTION="$(
(mmcli -m any -o "$CALLID" -K 2>/dev/null || mmcli -o "$CALLID" -K 2>/dev/null || mmcli --voice-status -o "$CALLID" -K 2>/dev/null) |
grep call.properties.direction |
@@ -99,6 +122,18 @@ pickup() {
hangup() {
CALLID="$1"
case "$CALLID" in
sub1_*|sub0_*)
rm -f "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}."* 2>/dev/null || true
touch "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.hangedupcall"
doas -n /usr/libexec/msm-modem-uim-selection call-hangup "$CALLID" >/dev/null 2>&1 || \
/usr/libexec/msm-modem-uim-selection call-hangup "$CALLID" >/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
return 0
;;
esac
if [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.pickedupcall" ] || \
[ -f "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.initiatedcall" ]; then
@@ -129,7 +164,7 @@ hangup() {
# We shallow muted/blocked and terminated calls
list_active_calls() {
mmcli -m any --voice-list-calls | \
mmcli -m any --voice-list-calls 2>/dev/null | \
awk '$1=$1' | \
grep -v terminated | \
grep -v "No calls were found" | while read -r line; do
@@ -139,6 +174,19 @@ list_active_calls() {
fi
printf "%s\n" "$line"
done
for f in "$XDG_RUNTIME_DIR"/sxmo_calls/sub1_*.*; do
[ -e "$f" ] || continue
base="${f##*/}"
cid="${base%%.*}"
st="${base#*.}"
case "$st" in
ringing-in|dialing|ringing-out|active|held|waiting)
if [ ! -e "$XDG_RUNTIME_DIR/sxmo_calls/${cid}.mutedring" ]; then
printf "/org/freedesktop/ModemManager1/Call/%s (%s)\n" "$cid" "$st"
fi
;;
esac
done
}
incall_menu() {