modemmanager: use the number from settings when the modem reports none

When ModemManager has no own numbers for the modem, mm_modem_get_own_numbers() returns NULL or an empty array, so the loop over them in mmsd_modem_available() never runs. The branch in that loop that falls back to ModemNumber from the settings is behind the loop's own check for a number, so it can't be reached either, and the service ends up without an own number even though one is configured.

This applies the configured number after the loop when the modem gave none. Nothing changes when the modem does report a number.

I found it on a Pixel 9a whose modem sits behind a ModemManager-compatible bridge that reports an empty OwnNumbers, so ModemNumber is the only source there. I've been running 2.6.4 with this change on that phone since early November.

Built on current master: 33 of 33 targets, and meson test passes 4 of 4.

Merge request reports

Loading
Loading