usb-protection: Fix wrong g_variant child index
While doing some testing on the usb-protection I noticed that in the is_only_hid
function I was wrongly using the POLICY_ATTRIBUTES
index, while the correct one is instead PRESENCE_ATTRIBUTES
.
This may lead to a GLib-CRITICAL **: 20:35:33.804: g_variant_get_child_value: assertion 'index_ < g_variant_n_children (value)' failed
error.
I also took this opportunity to fix a compilation warning about the unused is_locked
variable. Now instead of checking for the GError I use the gsd_screen_saver_call_lock_finish
result.
Edited by Ludovico de Nittis