Skip to content
  • Ratchanan Srirattanamet's avatar
    plugins/battery: stop relying on a-i-battery · efa53fee
    Ratchanan Srirattanamet authored and Mike Gabriel's avatar Mike Gabriel committed
    ayatana-indicator-battery 23.6.0 stops providing battery level through
    the action. Instead, the level is provided through menu's attribute.
    That means we'll to retrive the battery level somewhere else.
    
    Since we already talk to UPower for battery history, let's just talk to
    UPower directly for plugged-in state and charge level. This means we'll
    lose the indicator's logic for selecting primary battery, but I guess
    they have different priorities anyway (e.g. we probably don't care about
    accessories' batteries).
    
    The code is re-structued a bit so that there's a dedicated object
    representing a battery. This is done so that we can support multiple
    batteries in the future - even though we're still lacking in this
    regards...
    
    Fixes: https://gitlab.com/ubports/development/core/lomiri-system-settings/-/issues/355
    efa53fee