• spiiroin's avatar
    [battery] Do not report 100% when battery level is unknown. JB#48562 · 3e41f3d2
    spiiroin authored
    Using 100% as default initial value can lead to clients seeing what
    looks like genuine battery level drop during mce startup.
    Use MCE_BATTERY_LEVEL_UNKNOWN (-1) - which is documented in mce-dev
    headers as placeholder value used while battery level is unknown.
    Adapt battery level tracking withing mce to expect and deal with
    unknown/negative initial state.
    To allow debugging of battery level unknown states, expand value
    range allowed by mcetool --set-battery-level=<percent> to include
    also -1.
    Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>