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

Commit 9cc4ea32 authored by Jenny TC's avatar Jenny TC Committed by Todd Poynor
Browse files

Charger: Avoid animation while not charging DO NOT MERGE



At present, charging animation runs irrespective of whether charger
is connected or not. When the charger is disconnected, device not shutdown
for 10secs. Charging animation during this period should be avoided.

Change-Id: Idf8e6a11261aec2812f1ebbbdec1bd1ad769565e
Signed-off-by: default avatarPavan Kumar S <pavan.kumar.s@intel.com>
Signed-off-by: default avatarJenny TC <jenny.tc@intel.com>
Signed-off-by: default avatarYong Yao <yong.yao@intel.com>
parent 6e074c68
Loading
Loading
Loading
Loading
+20 −11
Original line number Diff line number Diff line
@@ -751,9 +751,10 @@ static void update_screen_state(struct charger *charger, int64_t now)
    /* schedule next screen transition */
    charger->next_screen_transition = now + disp_time;

    /* advance frame cntr to the next valid frame
    /* advance frame cntr to the next valid frame only if we are charging
     * if necessary, advance cycle cntr, and reset frame cntr
     */
    if (charger->num_supplies_online != 0) {
        batt_anim->cur_frame++;

        /* if the frame is used for level-only, that is only show it when it's
@@ -770,6 +771,14 @@ static void update_screen_state(struct charger *charger, int64_t now)
         * in a test above to check if animation is over
         */
        }
    } else {
        /* Stop animating if we're not charging.
         * If we stop it immediately instead of going through this loop, then
         * the animation would stop somewhere in the middle.
         */
        batt_anim->cur_frame = 0;
        batt_anim->cur_cycle++;
    }
}

static int set_key_callback(int code, int value, void *data)