summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2017-07-31 12:06:24 +0100
committerRichard Hughes <richard@hughsie.com>2017-07-31 12:06:24 +0100
commit9b0ee0a97a1ea2843c0dc7ac5dbcb84ad0026f87 (patch)
treed8c20d5d5593e93250c06c0b35d740c9561812b6
parent959c093812bfee7caa87f22ecf352e0f286c119e (diff)
downloadcolord-9b0ee0a97a1ea2843c0dc7ac5dbcb84ad0026f87.tar.gz
trivial: Allow dumping the sensor device after it is locked
-rw-r--r--src/cd-sensor.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cd-sensor.c b/src/cd-sensor.c
index 8b5bd80..a35c57f 100644
--- a/src/cd-sensor.c
+++ b/src/cd-sensor.c
@@ -665,6 +665,20 @@ cd_sensor_lock_cb (GObject *source_object,
return;
}
cd_sensor_set_locked (sensor, TRUE);
+
+ /* debug */
+ if (g_getenv ("COLORD_DEVICE_DEBUG") != NULL) {
+ g_autoptr(GString) str = g_string_new (NULL);
+ if (!cd_sensor_dump (sensor, str, &error)) {
+ g_dbus_method_invocation_return_error (invocation,
+ CD_SENSOR_ERROR,
+ CD_SENSOR_ERROR_NO_SUPPORT,
+ "failed to dump: %s",
+ error->message);
+ return;
+ }
+ }
+
g_dbus_method_invocation_return_value (invocation, NULL);
}