~xavi-garcia-mena/upower/percentages-power-off

« back to all changes in this revision

Viewing changes to debian/patches/0001-linux-Don-t-guess-discharging-state-for-devices.patch

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-10-20 17:11:30 UTC
  • mfrom: (49.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20131020171130-flrh6n1po62b1130
Tags: 0.9.23-1
* New upstream bug fix release.
* Force libglib2.0-0 to be at least 2.36 to avoid running against earlier
  glib versions which still required g_type_init(). (Closes: #722612)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From f3898db4d3a340e5a4245bb86c3291d109ae0349 Mon Sep 17 00:00:00 2001
2
 
From: Bastien Nocera <hadess@hadess.net>
3
 
Date: Sat, 12 Oct 2013 15:29:18 +0200
4
 
Subject: [PATCH] linux: Don't guess discharging state for devices
5
 
 
6
 
If the device state is unknown, don't guess based on the laptop's
7
 
power supplies (battery/power line) as it might not be charging
8
 
from there.
9
 
 
10
 
https://bugs.freedesktop.org/show_bug.cgi?id=70321#c1
11
 
---
12
 
 src/linux/up-device-supply.c | 2 +-
13
 
 1 file changed, 1 insertion(+), 1 deletion(-)
14
 
 
15
 
diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c
16
 
index 4a4b431..ef40e06 100644
17
 
--- a/src/linux/up-device-supply.c
18
 
+++ b/src/linux/up-device-supply.c
19
 
@@ -720,7 +720,7 @@ up_device_supply_refresh_battery (UpDeviceSupply *supply)
20
 
 
21
 
        /* the battery isn't charging or discharging, it's just
22
 
         * sitting there half full doing nothing: try to guess a state */
23
 
-       if (state == UP_DEVICE_STATE_UNKNOWN) {
24
 
+       if (state == UP_DEVICE_STATE_UNKNOWN && supply->priv->is_power_supply) {
25
 
                daemon = up_device_get_daemon (device);
26
 
 
27
 
                /* If we have any online AC, assume charging, otherwise
28
 
1.8.3.2
29