From a722cef201ea080ec62339dc8651f42eb1b8bbdb Mon Sep 17 00:00:00 2001 From: Jonas Bonn Date: Mon, 3 Apr 2017 14:27:34 +0200 Subject: [PATCH] modem: set_online is valid for AlwaysOnline modems 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 b1e8d3e2..ac361be0 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);