summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2009-11-22 15:59:58 +0000
committerRichard Hughes <richard@hughsie.com>2009-11-22 15:59:58 +0000
commita1783bbf2d866527b9963fa04abf6f02c21cf746 (patch)
treecb0953e7e7bae824dfc6363fa24517731cacf5e3
parentc289ef679161482ee157a743e62fe3efcfc1137b (diff)
When the internal battery is in the unknown state, we can't make a decision whether the system is on battery power
-rw-r--r--src/linux/dkp-device-supply.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/linux/dkp-device-supply.c b/src/linux/dkp-device-supply.c
index ac5e1e1..52b657f 100644
--- a/src/linux/dkp-device-supply.c
+++ b/src/linux/dkp-device-supply.c
@@ -143,6 +143,8 @@ dkp_device_supply_get_on_battery (DkpDevice *device, gboolean *on_battery)
if (type != DKP_DEVICE_TYPE_BATTERY)
return FALSE;
+ if (state == DKP_DEVICE_STATE_UNKNOWN)
+ return FALSE;
if (!is_present)
return FALSE;