Skip to content

Commit

Permalink
[powersavemode] Disable forced-psm on charger connect. JB#43843
Browse files Browse the repository at this point in the history
Setting design change: After user enables forced power save mode, it
gets automatically disabled on the next charger connect.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Dec 21, 2018
1 parent 20b356c commit 03fcbea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/powersavemode.c
Expand Up @@ -196,6 +196,14 @@ static void charger_state_trigger(gconstpointer const data)
charger_state_repr(prev),
charger_state_repr(charger_state));

if( force_psm && charger_state == CHARGER_STATE_ON ) {
mce_log(LL_DEBUG, "autodisable forced-power-save-mode");
/* Change cached value before changing the setting
* value to avoid repeated state evaluation. */
force_psm = false;
mce_setting_set_bool(MCE_SETTING_EM_FORCED_PSM, false);
}

update_power_saving_mode();

EXIT:
Expand Down

0 comments on commit 03fcbea

Please sign in to comment.