diff options
author | Andrew Lassalle <andrewlassalle@chromium.org> | 2021-10-06 17:07:49 -0700 |
---|---|---|
committer | Andrew Lassalle <andrewlassalle@chromium.org> | 2021-10-11 10:18:47 -0700 |
commit | 43e76bf1bbca8207e37d3fbddfed4bb8578f0170 (patch) | |
tree | 71d0fae013367d42da4ca807ddc441f62d4e526f /src | |
parent | 53f6c309bfbf87fe2ccb28dc3b9a3775e4e20897 (diff) |
iface-modem: Allow SetPowerState(Low|On) on failed state
In some modems, the modem's radio can be ON when no SIM card is present.
In this case, the modem is in failed state, and the host cannot set the
power state to LOW. Since we we will allow the host to set the power to
LOW, we should allow it to set it back to ON.
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-iface-modem.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 19eb2847..3806661c 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -2163,14 +2163,15 @@ handle_set_power_state_auth_ready (MMBaseModem *self, MM_IFACE_MODEM_STATE, &modem_state, NULL); - /* Going into LOW or ON only allowed in disabled state */ + /* Going into LOW or ON only allowed in disabled and failed states */ if ((ctx->power_state == MM_MODEM_POWER_STATE_LOW || ctx->power_state == MM_MODEM_POWER_STATE_ON) && + modem_state != MM_MODEM_STATE_FAILED && modem_state != MM_MODEM_STATE_DISABLED) { g_dbus_method_invocation_return_error (ctx->invocation, MM_CORE_ERROR, MM_CORE_ERROR_WRONG_STATE, - "Cannot set power state: not in disabled state"); + "Cannot set power state: not in disabled or failed state"); handle_set_power_state_context_free (ctx); return; } |