From 39e04f7f4cdd50ba36632635259744982490a4bb Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 1 Aug 2011 20:30:29 +0000 Subject: [PATCH] try something new for battery/ac detection. this may break some stuff, so ping me if your battery gadget stops working... SVN revision: 61967 --- legacy/eeze/src/lib/eeze_udev_watch.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/legacy/eeze/src/lib/eeze_udev_watch.c b/legacy/eeze/src/lib/eeze_udev_watch.c index a071f2a246..cebfaaba42 100644 --- a/legacy/eeze/src/lib/eeze_udev_watch.c +++ b/legacy/eeze/src/lib/eeze_udev_watch.c @@ -216,9 +216,8 @@ _get_syspath_from_watch(void *data, || (strcmp(test, "power_supply"))) goto error; #endif - if (!(test = udev_device_get_property_value(device, "POWER_SUPPLY_TYPE")) - || (strcmp("Mains", test))) - goto error; + test = udev_device_get_property_value(device, "POWER_SUPPLY_ONLINE"); + if (!test) goto error; break; case EEZE_UDEV_TYPE_POWER_BAT: @@ -227,9 +226,8 @@ _get_syspath_from_watch(void *data, || (strcmp(test, "power_supply"))) goto error; #endif - if (!(test = udev_device_get_property_value(device, "POWER_SUPPLY_TYPE")) - || (strcmp("Battery", test))) - goto error; + test = udev_device_get_property_value(device, "POWER_SUPPLY_PRESENT"); + if (!test) goto error; break; case EEZE_UDEV_TYPE_NET: