modem: prevent duplicate SIM PIN entry dialog in dual-SIM mode

This commit is contained in:
Luxferre committed 2026-10-28 08:32:05 +02:00
1 parent 2e2adcc7f2
commit 4aa087f372
6 files changed
+174 -65

No files matched your search

@@ -17,6 +17,13 @@ sxmo_debug "$2 (old: $1 [reason: $3])"
open_sim_unlock_ui() {
(
uim_st="$(doas -n /usr/libexec/msm-modem-uim-selection status 2>/dev/null || /usr/libexec/msm-modem-uim-selection status 2>/dev/null || true)"
if printf "%s\n" "$uim_st" | grep -q "^MODEM_AVAILABLE=1$"; then
if ! printf "%s\n" "$uim_st" | grep -qE "SLOT[12]_PIN1_STATE=(enabled-not-verified|blocked)|SLOT[12]_APP_STATE=(pin1|puk1)"; then
sxmo_log "QMI UIM reports no SIM requires PIN/PUK; skipping unlock UI."
exit 0
fi
fi
i=0
while [ "$i" -lt 40 ] && [ ! -p /tmp/dwm_plugin_modem.fifo ]; do
sleep 0.2