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

Commit 9015eaa3 authored by Ruchi Kandoi's avatar Ruchi Kandoi
Browse files

healthd: Avoid animation while not charging.

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

Change-Id: I34dc5028522ca199d50a1a1b684b035b2d81ef68
parent 25af09e1
Loading
Loading
Loading
Loading
+22 −13
Original line number Diff line number Diff line
@@ -409,9 +409,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->charger_connected) {
        batt_anim->cur_frame++;

        /* if the frame is used for level-only, that is only show it when it's
@@ -428,6 +429,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)