Khurshid Alam has proposed merging 
lp:~khurshid-alam/unity-settings-daemon/fix-low-battery-notifications into 
lp:unity-settings-daemon.

Commit message:
power: Remove 'on AC' check from warning-levels
UPower already does this for us, to avoid warning levels being set
when the batteries didn't notice the AC yet.

Requested reviews:
  Sebastien Bacher (seb128)

For more details, see:
https://code.launchpad.net/~khurshid-alam/unity-settings-daemon/fix-low-battery-notifications/+merge/369223
-- 
Your team Unity Settings Daemon Development Team is subscribed to branch 
lp:unity-settings-daemon.
=== modified file 'plugins/power/gsd-power-manager.c'
--- plugins/power/gsd-power-manager.c	2016-06-15 15:40:17 +0000
+++ plugins/power/gsd-power-manager.c	2019-06-24 06:33:38 +0000
@@ -1171,14 +1171,6 @@
                       "time-to-empty", &time_to_empty,
                       NULL);
 
-        /* check to see if the batteries have not noticed we are on AC */
-        if (kind == UP_DEVICE_KIND_BATTERY) {
-                if (!up_client_get_on_battery (manager->priv->up_client)) {
-                        g_warning ("ignoring low message as we are not on battery power");
-                        goto out;
-                }
-        }
-
         if (kind == UP_DEVICE_KIND_BATTERY) {
 
                 /* if the user has no other batteries, drop the "Laptop" wording */
@@ -1287,7 +1279,6 @@
                          /* TRANSLATORS: this is the sound description */
                          CA_PROP_EVENT_DESCRIPTION, _("Battery is low"), NULL);
 
-out:
         if (icon != NULL)
                 g_object_unref (icon);
         g_free (message);
@@ -1312,14 +1303,6 @@
                       "time-to-empty", &time_to_empty,
                       NULL);
 
-        /* check to see if the batteries have not noticed we are on AC */
-        if (kind == UP_DEVICE_KIND_BATTERY) {
-                if (!up_client_get_on_battery (manager->priv->up_client)) {
-                        g_warning ("ignoring critically low message as we are not on battery power");
-                        goto out;
-                }
-        }
-
         if (kind == UP_DEVICE_KIND_BATTERY) {
 
                 /* if the user has no other batteries, drop the "Laptop" wording */
@@ -1468,7 +1451,7 @@
                                  CA_PROP_EVENT_DESCRIPTION, _("Battery is critically low"), NULL);
                 break;
         }
-out:
+
         if (icon != NULL)
                 g_object_unref (icon);
         g_free (message);
@@ -1489,14 +1472,6 @@
                       "kind", &kind,
                       NULL);
 
-        /* check to see if the batteries have not noticed we are on AC */
-        if (kind == UP_DEVICE_KIND_BATTERY) {
-                if (!up_client_get_on_battery (manager->priv->up_client)) {
-                        g_warning ("ignoring critically low message as we are not on battery power");
-                        goto out;
-                }
-        }
-
         if (kind == UP_DEVICE_KIND_BATTERY) {
 
                 /* TRANSLATORS: laptop battery is really, really, low */
@@ -1596,7 +1571,7 @@
                          CA_PROP_EVENT_ID, "battery-caution",
                          /* TRANSLATORS: this is the sound description */
                          CA_PROP_EVENT_DESCRIPTION, _("Battery is critically low"), NULL);
-out:
+
         if (icon != NULL)
                 g_object_unref (icon);
         g_free (message);

-- 
ubuntu-desktop mailing list
ubuntu-desktop@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-desktop

Reply via email to