Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38eee0ff authored by David Ferguson's avatar David Ferguson
Browse files

charger: make default to not suspend in charge mode

  * http://r.cyanogenmod.com/#/c/19760 made the device suspend in
    charge mode when the animation was not displayed. Previously
    the device never suspended.
  * The above change broke charging mode on some (maybe many?) devices
    that do not properly handle suspending in charge mode.
  * This change brings back the more compatible default behavior of
    not suspending in charge mode and introduces a new BoardConfig.mk
    variable called BOARD_ALLOW_SUSPEND_IN_CHARGER that, when set to
    true, will suspend in charge mode.
  * This allows devices that support suspend in charger to opt-in
    instead of having to opt-out previously working devices.

Change-Id: I5a480e34ba5946a52e371ac79a965ecee5471c5a
parent cc3f9d17
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -23,6 +23,10 @@ ifneq ($(BOARD_BATTERY_DEVICE_NAME),)
LOCAL_CFLAGS += -DBATTERY_DEVICE_NAME=\"$(BOARD_BATTERY_DEVICE_NAME)\"
endif

ifeq ($(BOARD_ALLOW_SUSPEND_IN_CHARGER),true)
LOCAL_CFLAGS += -DALLOW_SUSPEND_IN_CHARGER
endif

include $(BUILD_EXECUTABLE)

define _add-charger-image
+4 −0
Original line number Diff line number Diff line
@@ -697,7 +697,9 @@ static void redraw_screen(struct charger *charger)

static void kick_animation(struct animation *anim)
{
#ifdef ALLOW_SUSPEND_IN_CHARGER
    write_file(SYS_POWER_STATE, "on", strlen("on"));
#endif
    anim->run = true;
}

@@ -722,7 +724,9 @@ static void update_screen_state(struct charger *charger, int64_t now)
        reset_animation(batt_anim);
        charger->next_screen_transition = -1;
        gr_fb_blank(true);
#ifdef ALLOW_SUSPEND_IN_CHARGER
        write_file(SYS_POWER_STATE, "mem", strlen("mem"));
#endif
        LOGV("[%lld] animation done\n", now);
        return;
    }