From: Caiwen Zhang <[email protected]>

Some modem may return registration status whitch is out of the range
(0-5). it will cause the modem don't auto register to network when
network atom initializes.
---
 src/network.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/network.c b/src/network.c
index d1bfca6..a1e317d 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1481,9 +1481,9 @@ static void init_registration_status(const struct 
ofono_error *error,
        }
 
        if (netreg->mode != NETWORK_REGISTRATION_MODE_MANUAL &&
-               (status == NETWORK_REGISTRATION_STATUS_NOT_REGISTERED ||
-                       status == NETWORK_REGISTRATION_STATUS_DENIED ||
-                       status == NETWORK_REGISTRATION_STATUS_UNKNOWN)) {
+               (status != NETWORK_REGISTRATION_STATUS_REGISTERED &&
+                       status != NETWORK_REGISTRATION_STATUS_SEARCHING &&
+                       status != NETWORK_REGISTRATION_STATUS_ROAMING)) {
                if (netreg->driver->register_auto != NULL)
                        netreg->driver->register_auto(netreg, init_register,
                                                        netreg);
-- 
1.7.9.5

_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to