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.
This commit is contained in:
Jonas Bonn 2017-04-03 14:27:34 +02:00 committed by Denis Kenzior
parent 1e39a9d26d
commit a722cef201
1 changed files with 6 additions and 2 deletions

View File

@ -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);