Bug 89175 - Refresh battery when AC power changes
Summary: Refresh battery when AC power changes
Status: RESOLVED MOVED
Alias: None
Product: upower
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-16 22:06 UTC by Giovanni Campagna
Modified: 2018-06-04 13:24 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Giovanni Campagna 2015-02-16 22:06:08 UTC
On my laptop (a MacBook Pro 11,2 from this year), the firmware emits change events only for the AC power when the power is plugged or unplugged.

This causes upower to miss the events and not update the UI until the next poll interval (unfortunately this firmware has no change events at all for the battery, so polling is required).
Comment 1 Bastien Nocera 2015-04-02 14:20:31 UTC
Which version of upower is this with?
Comment 2 Giovanni Campagna 2015-04-02 15:32:41 UTC
upower-0.99.2-4.fc21.x86_64
Comment 3 Bastien Nocera 2015-04-02 15:42:36 UTC
In up_daemon_device_changed_cb(), we have:
static void 
up_daemon_device_changed_cb (UpDevice *device, GParamSpec *pspec, UpDaemon *daemon)
{
<snip>
        /* refresh battery devices when AC state changes */
        g_object_get (device,
                      "type", &type,
                      NULL);
        if (type == UP_DEVICE_KIND_LINE_POWER) {
                /* refresh now */
                up_daemon_refresh_battery_devices (daemon);
        }

        up_daemon_update_warning_level (daemon);
}


Can you add some debug to that function, and see whether it's getting called correctly? Otherwise, I'll need a debug log.
Comment 4 GitLab Migration User 2018-06-04 13:24:57 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/upower/upower/issues/42.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.