UPSTREAM: broadband-modem-qmi: ensure we do not re-use old EPS registration state

When updating the registration state, in the case where LTE is not ready,
ensure we reset the EPS registration state rather than leaving its old
value.
Else when the consolidated registration is built, it can wrongly think
we are registered, e.g. the following case was happening:
[modem0] consolidated registration state: cs 'home', ps 'home', eps 'home', 5gs 'unknown' --> 'home'
a bit later
[modem0] consolidated registration state: cs 'unknown', ps 'unknown', eps 'home', 5gs 'unknown' --> 'home'
then it wrongly tries immediatly to connect
and fails due to 'no-service'

On Qualcomm SC7180, running the following sequence would often reproduce
it:
<stop higher level network manager>
mmcli -m 0 -d
mmcli -m 0 --set-power-state-low
sleep 10
mmcli -m 0 -e
mmcli -m 0 --simple-connect="apn=broadband"

(cherry picked from commit edee1e3f84b34b6a4bd6f230371a36ea03539af7)

BUG=b:186419969
TEST=On Trogdor, the manual test sequence described above and
turn on the #cellular-use-attach-apn flag, then verify connection.

Change-Id: I60296d3d1c835ff28f38f2cade19fb21800f4e97
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/modemmanager-next/+/2859884
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Pavan Holla <pholla@google.com>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>
Commit-Queue: Pavan Holla <pholla@google.com>
(cherry picked from commit 11a497444356c3482919645550cdcb18ddcd4318)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/modemmanager-next/+/2872155
Tested-by: Pavan Holla <pholla@google.com>
Auto-Submit: Pavan Holla <pholla@google.com>
Commit-Queue: Eric Caruso <ejcaruso@chromium.org>
1 file changed