diff options
author | Kate Hsuan <hpa@redhat.com> | 2024-02-26 16:35:09 +0800 |
---|---|---|
committer | Kate Hsuan <hpa@redhat.com> | 2024-02-26 16:35:09 +0800 |
commit | 26a1b7db3853917ee82e747a0128a97d22c0cd61 (patch) | |
tree | c45f2cabb874dbffad9702992801674abc3e7fee | |
parent | be823973672297be949fcb9ab70db22b0f5fcc6d (diff) |
Debug messages
-rw-r--r-- | src/linux/up-device-hid.c | 5 | ||||
-rw-r--r-- | src/linux/up-device-supply-battery.c | 3 | ||||
-rw-r--r-- | src/linux/up-device-supply.c | 2 | ||||
-rw-r--r-- | src/linux/up-enumerator-udev.c | 1 | ||||
-rw-r--r-- | src/up-device-battery.c | 3 |
5 files changed, 14 insertions, 0 deletions
diff --git a/src/linux/up-device-hid.c b/src/linux/up-device-hid.c index 9237262..237cfcc 100644 --- a/src/linux/up-device-hid.c +++ b/src/linux/up-device-hid.c @@ -169,6 +169,7 @@ up_device_hid_set_values (UpDeviceHid *hid, guint32 code, gint32 value) g_object_set (device, "state", UP_DEVICE_STATE_DISCHARGING, NULL); break; case UP_DEVICE_HID_BATTERY_PRESENT: + g_warning ("Set is-present line 172"); g_object_set (device, "is-present", (value != 0), NULL); break; case UP_DEVICE_HID_DEVICE_NAME: @@ -316,6 +317,7 @@ up_device_hid_coldplug (UpDevice *device) vendor = g_udev_device_get_property (native, "ID_VENDOR"); /* hardcode some values */ + g_warning ("Set is-present line 320"); g_object_set (device, "type", UP_DEVICE_KIND_UPS, "is-rechargeable", TRUE, @@ -367,6 +369,8 @@ up_device_hid_refresh (UpDevice *device, UpRefreshReason reason) int rd; UpDeviceHid *hid = UP_DEVICE_HID (device); + g_warning ("hid refresh for"); + if (hid->priv->fake_device) goto update_time; @@ -418,6 +422,7 @@ up_device_hid_get_on_battery (UpDevice *device, gboolean *on_battery) g_return_val_if_fail (UP_IS_DEVICE_HID (hid), FALSE); g_return_val_if_fail (on_battery != NULL, FALSE); + g_warning ("Set is-present line 421"); g_object_get (device, "type", &type, "state", &state, diff --git a/src/linux/up-device-supply-battery.c b/src/linux/up-device-supply-battery.c index 456f692..af65d13 100644 --- a/src/linux/up-device-supply-battery.c +++ b/src/linux/up-device-supply-battery.c @@ -145,6 +145,9 @@ up_device_supply_battery_refresh (UpDevice *device, * we can restrict this to updates other than UP_REFRESH_POLL. * NOTE: Only energy.full and cycle_count can change for a battery. */ + + g_warning("device battery refresh"); + info.present = TRUE; if (g_udev_device_has_sysfs_attr (native, "present")) info.present = g_udev_device_get_sysfs_attr_as_boolean_uncached (native, "present"); diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c index 27f73af..46eb6e0 100644 --- a/src/linux/up-device-supply.c +++ b/src/linux/up-device-supply.c @@ -259,6 +259,8 @@ up_device_supply_refresh_device (UpDeviceSupply *supply, native = G_UDEV_DEVICE (up_device_get_native (device)); + g_warning ("Device-supply refresh for %s", g_udev_device_get_sysfs_path (native)); + /* initial values */ if (!supply->priv->has_coldplug_values) { gchar *model_name; diff --git a/src/linux/up-enumerator-udev.c b/src/linux/up-enumerator-udev.c index 36e3887..ec7eb8e 100644 --- a/src/linux/up-enumerator-udev.c +++ b/src/linux/up-enumerator-udev.c @@ -226,6 +226,7 @@ uevent_signal_handler_cb (UpEnumeratorUdev *self, if (g_strcmp0 (action, "change") == 0 || g_strcmp0 (action, "add") == 0) { GObject *obj; + g_warning ("look up device key=%s", device_key); obj = g_hash_table_lookup (self->known, device_key); if (UP_IS_DEVICE (obj) && g_strcmp0 (action, "add") == 0 && g_strcmp0 (g_udev_device_get_sysfs_path (device), diff --git a/src/up-device-battery.c b/src/up-device-battery.c index b2ed74f..410d2d7 100644 --- a/src/up-device-battery.c +++ b/src/up-device-battery.c @@ -435,6 +435,7 @@ up_device_battery_update_info (UpDeviceBattery *self, UpBatteryInfo *info) gdouble energy_design; gint charge_cycles; + g_warning ("is-present set up-device-battery line 438"); /* See above, we have a (new) battery plugged in. */ if (!priv->present) { g_object_set (self, @@ -499,6 +500,8 @@ up_device_battery_update_info (UpDeviceBattery *self, UpBatteryInfo *info) priv->hw_data_len = 0; priv->units = UP_BATTERY_UNIT_UNDEFINED; + g_warning ("is-present set up-device-battery line 503"); + g_object_set (self, "is-present", FALSE, "vendor", NULL, |