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

@@ -544,7 +544,7 @@ provision_slot() {
eval "other_app_state=\$SLOT${other_slot}_APP_STATE"
need_prim=1
if [ "$PRIMARY_GW_SLOT" = "$chosen_slot" ] && { [ "$chosen_app_state" = "ready" ] || [ "$chosen_app_state" = "pin1-or-upin-pin-required" ] || [ "$chosen_app_state" = "puk1-or-upin-puk-required" ] || [ "$chosen_app_state" = "pin1_or_upin_pin_required" ] || [ "$chosen_app_state" = "puk1_or_upin_puk_required" ]; }; then
if [ "$PRIMARY_GW_SLOT" = "$chosen_slot" ] && [ -n "$chosen_app_state" ] && [ "$chosen_app_state" != "none" ] && [ "$chosen_app_state" != "illegal" ]; then
need_prim=0
fi
@@ -574,7 +574,7 @@ provision_slot() {
# Dual-SIM Dual Standby (DSDS): provision the second present SIM slot to secondary-gw-provisioning
if [ "$other_state" = "present" ]; then
need_sec=1
if [ "${SECONDARY_GW_SLOT:-0}" = "$other_slot" ] && { [ "$other_app_state" = "ready" ] || [ "$other_app_state" = "pin1-or-upin-pin-required" ] || [ "$other_app_state" = "puk1-or-upin-puk-required" ] || [ "$other_app_state" = "pin1_or_upin_pin_required" ] || [ "$other_app_state" = "puk1_or_upin_puk_required" ]; }; then
if [ "${SECONDARY_GW_SLOT:-0}" = "$other_slot" ] && [ -n "$other_app_state" ] && [ "$other_app_state" != "none" ] && [ "$other_app_state" != "illegal" ]; then
need_sec=0
fi
if [ "$need_sec" = "1" ]; then
@@ -948,10 +948,15 @@ PY
exit 1
fi
prepare_slot_for_pin_op "$slot"
eval "before_pin1=\${SLOT${slot}_PIN1_STATE:-}"
eval "before_app=\${SLOT${slot}_APP_STATE:-}"
eval "before_ret=\${SLOT${slot}_PIN1_RETRIES:-3}"
verified=0
wrong_pin=0
if [ "${PIN_OP_SESSION:-primary-gw-provisioning}" = "primary-gw-provisioning" ]; then
if [ "$before_pin1" = "enabled-verified" ] || [ "$before_pin1" = "disabled" ] || [ "$before_app" = "ready" ]; then
verified=1
fi
if [ "$verified" = "0" ] && [ "${PIN_OP_SESSION:-primary-gw-provisioning}" = "primary-gw-provisioning" ]; then
sim_id="$(timeout 3 mmcli -m any 2>/dev/null | grep -oE 'SIM/[0-9]+' | head -n1 | cut -d'/' -f2 || true)"
if [ -n "$sim_id" ]; then
mm_pin_out="$(timeout 5 mmcli -i "$sim_id" --pin="$pin" 2>&1)" && verified=1 || {