[gnome-bluetooth] wizard: Better DisplayPinCode rejection
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] wizard: Better DisplayPinCode rejection
- Date: Mon, 25 Nov 2013 17:23:13 +0000 (UTC)
commit c266a1bf7c96a333ca4ad56c6b7a9c4188302cc0
Author: Bastien Nocera <hadess hadess net>
Date: Mon Nov 25 18:13:47 2013 +0100
wizard: Better DisplayPinCode rejection
This is better code.
wizard/main.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/wizard/main.c b/wizard/main.c
index f9a9c61..4ae39fe 100644
--- a/wizard/main.c
+++ b/wizard/main.c
@@ -412,11 +412,13 @@ display_pincode_callback (GDBusMethodInvocation *invocation,
const char *pincode,
gpointer user_data)
{
- GError *error;
+ g_debug ("Reject bluetoothd PIN %s", pincode);
- error = g_error_new (AGENT_ERROR, AGENT_ERROR_REJECT,
- "Agent callback cancelled");
- g_dbus_method_invocation_take_error (invocation, error);
+ /* Reject all the calls here, so that we'll get asked about the
+ * pincode instead of being told the pincode */
+ g_dbus_method_invocation_return_dbus_error (invocation,
+ "org.bluez.Error.Rejected",
+ "Rejected bluetoothd generated PIN code");
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]