After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777149 - Does not detect AC adapter on Apple hardware
Does not detect AC adapter on Apple hardware
Status: RESOLVED FIXED
Product: gnome-battery-bench
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME battery bench maintainer(s)
GNOME battery bench maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-01-11 17:42 UTC by Christian Kellner
Modified: 2017-03-13 12:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Detect AC adapter on Apple hardware (1.39 KB, patch)
2017-01-13 14:52 UTC, Christian Kellner
committed Details | Review

Description Christian Kellner 2017-01-11 17:42:31 UTC
It is "ADPx" on (some?) Apple hardware instead of "ACx".
Relevant line is 249 in src/power-monitor.c
Comment 1 Christian Kellner 2017-01-13 14:52:40 UTC
Created attachment 343435 [details] [review]
Detect AC adapter on Apple hardware

On Apple hardware the sysfs directory for the mains power supply
is called ADPx and not ACx.
Comment 2 Bastien Nocera 2017-01-19 11:41:04 UTC
You should either use UPower, or check for the power_supply type for udev devices instead of hardcoding names.
Comment 3 Christian Kellner 2017-03-13 12:48:10 UTC
I completely agree that utilizing udev is be the right way to go but, after also consulting Own on that matter, we agreed that for now I will commit that quick fix and them maybe later rewrite the whole code to use udev.
Comment 4 Christian Kellner 2017-03-13 12:49:10 UTC
Attachment 343435 [details] pushed as c7c2928 - Detect AC adapter on Apple hardware