Calling set_online(TRUE) for an AlwaysOnline modem should succeed; the
modem is, after all, in the requested state when the call returns.
Returning not_implemented is not necessarily wrong, but it's a bit ugly.
---
 src/modem.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/modem.c b/src/modem.c
index b1e8d3e..ac361be 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -754,8 +754,12 @@ static DBusMessage *set_property_online(struct ofono_modem 
*modem,
        if (ofono_modem_get_emergency_mode(modem) == TRUE)
                return __ofono_error_emergency_active(msg);
 
-       if (modem_is_always_online(modem) == TRUE)
-               return __ofono_error_not_implemented(msg);
+       if (modem_is_always_online(modem) == TRUE) {
+               if (online)
+                       return dbus_message_new_method_return(msg);
+               else
+                       return __ofono_error_not_implemented(msg);
+       }
 
        modem->pending = dbus_message_ref(msg);
 
-- 
2.9.3

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

Reply via email to