rpms/DeviceKit-power/devel DeviceKit-power-010-continue-to-poll-when-guessing.patch, NONE, 1.1 DeviceKit-power.spec, 1.22, 1.23
Richard Hughes
rhughes at fedoraproject.org
Mon Aug 3 14:44:37 UTC 2009
Author: rhughes
Update of /cvs/pkgs/rpms/DeviceKit-power/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3486
Modified Files:
DeviceKit-power.spec
Added Files:
DeviceKit-power-010-continue-to-poll-when-guessing.patch
Log Message:
* Mon Aug 03 2009 Richard Hughes <richard at hughsie.com> - 010-4
- Continue to poll when we guessed a status value, and only stop when the
kernel says definitively that we are fully charged.
DeviceKit-power-010-continue-to-poll-when-guessing.patch:
dkp-device-supply.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--- NEW FILE DeviceKit-power-010-continue-to-poll-when-guessing.patch ---
commit 91c1718f6367f9855847611a62365a65d0557d59
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Aug 3 15:32:59 2009 +0100
Only disable the polling if the kernel tells us we're fully charged, not if we guessed it
diff --git a/src/dkp-device-supply.c b/src/dkp-device-supply.c
index aed8bda..e6905bd 100644
--- a/src/dkp-device-supply.c
+++ b/src/dkp-device-supply.c
@@ -50,6 +50,7 @@ struct DkpDeviceSupplyPrivate
gdouble energy_old;
GTimeVal energy_old_timespec;
guint unknown_retries;
+ gboolean enable_poll;
};
static void dkp_device_supply_class_init (DkpDeviceSupplyClass *klass);
@@ -468,6 +469,10 @@ dkp_device_supply_refresh_battery (DkpDeviceSupply *supply)
state = DKP_DEVICE_STATE_UNKNOWN;
}
+ /* only disable the polling if the kernel tells us we're fully charged,
+ not if we've guessed the state to be fully charged */
+ supply->priv->enable_poll = (state != DKP_DEVICE_STATE_FULLY_CHARGED);
+
/* reset unknown counter */
if (state != DKP_DEVICE_STATE_UNKNOWN) {
egg_debug ("resetting unknown timeout after %i retries", supply->priv->unknown_retries);
@@ -672,8 +677,8 @@ dkp_device_supply_setup_poll (DkpDevice *device)
g_object_get (device, "state", &state, NULL);
- /* if it's fully charged, don't poll at all */
- if (state == DKP_DEVICE_STATE_FULLY_CHARGED)
+ /* don't setup the poll only if we're sure */
+ if (!supply->priv->enable_poll)
goto out;
/* if it's unknown, poll faster than we would normally */
@@ -743,6 +748,7 @@ dkp_device_supply_init (DkpDeviceSupply *supply)
supply->priv = DKP_DEVICE_SUPPLY_GET_PRIVATE (supply);
supply->priv->unknown_retries = 0;
supply->priv->poll_timer_id = 0;
+ supply->priv->enable_poll = TRUE;
}
/**
Index: DeviceKit-power.spec
===================================================================
RCS file: /cvs/pkgs/rpms/DeviceKit-power/devel/DeviceKit-power.spec,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -p -r1.22 -r1.23
--- DeviceKit-power.spec 2 Aug 2009 08:11:54 -0000 1.22
+++ DeviceKit-power.spec 3 Aug 2009 14:44:36 -0000 1.23
@@ -9,7 +9,7 @@ Summary: Power Management Service
Name: DeviceKit-power
Version: 010
#Release: 0.4.%{?alphatag}git%{?dist}
-Release: 3%{?dist}
+Release: 4%{?dist}
License: GPLv2+
Group: System Environment/Libraries
URL: http://cgit.freedesktop.org/DeviceKit/DeviceKit-power/
@@ -17,6 +17,9 @@ URL: http://cgit.freedesktop.org/DeviceK
Source0: http://hal.freedesktop.org/releases/%{name}-%{version}.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+# upstream, 91c1718f6367f9855847611a62365a65d0557d59
+Patch1: DeviceKit-power-010-continue-to-poll-when-guessing.patch
+
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
BuildRequires: glib2-devel >= %{glib2_version}
@@ -51,6 +54,7 @@ Headers and libraries for DeviceKit-powe
%prep
%setup -q
+%patch1 -p1 -b .poll-when-guessing
#%setup -q -n %{?name}-%{?version}-%{?alphatag}
%build
@@ -109,8 +113,12 @@ rm -rf $RPM_BUILD_ROOT
%{_includedir}/DeviceKit-power/devkit-power-gobject/*.h
%changelog
+* Mon Aug 03 2009 Richard Hughes <richard at hughsie.com> - 010-4
+- Continue to poll when we guessed a status value, and only stop when the
+ kernel says definitively that we are fully charged.
+
* Sun Aug 02 2009 Richard Hughes <richard at hughsie.com> - 010-3
-- Put the development include files in the devel packagem not the main package.
+- Put the development include files in the devel package not the main package.
- Fixes #515104
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 010-2
More information about the fedora-extras-commits
mailing list