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
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
10
https://bugs.freedesktop.org/show_bug.cgi?id=70321#c1
12
src/linux/up-device-supply.c | 2 +-
13
1 file changed, 1 insertion(+), 1 deletion(-)
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)
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);
27
/* If we have any online AC, assume charging, otherwise