HomePhabricator

Batman Udev: Don't include batteries who have unknown status, have never had a…

Authored by stephenmhouston on Jan 23 2019, 8:17 AM.

Description

Batman Udev: Don't include batteries who have unknown status, have never had a full charge, and have no charge rate.

Summary: This fixes issues where erroneous udev detections of batteries are included. @bu5hm4n and I both have had issues where udev thinks we have two batteries because our hid/touchscreens report a battery even though they are not accurate. The problem is batman will then think there are two batteries and calculate battery percentage based off both batteries. For instance if the laptop battery is 100% and it is detecting this phony hid battery, the result is batman thinks you are at 50% battery life. This also fixes the battery removal code which should only remove the battery with the syspath the function is called with. The code was actually removing every single battery.

Test Plan: You have to have a device that udev reports two batteries for when there aren't two. It should be harmless to not include batteries that have never been charged, have no charge, and have unknown for their status.

Reviewers: bu5hm4n, raster, zmike!, devilhorns

Reviewed By: raster

Subscribers: cedric, bu5hm4n

Tags: enlightenment-git

Differential Revision: https://phab.enlightenment.org/D7736