From cf5f6527401bcbd9f558e41a5b067d4d02920dc7 Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Wed, 17 Feb 2010 17:19:26 -0800 Subject: Set error condition correctly when device is already created. When device is already created, and we call CreateDevice, we need to report the error correctly. Only then the SDP query will be done from java land. --- core/jni/android_server_BluetoothEventLoop.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/jni/android_server_BluetoothEventLoop.cpp b/core/jni/android_server_BluetoothEventLoop.cpp index 4e1ae62..5432efb 100644 --- a/core/jni/android_server_BluetoothEventLoop.cpp +++ b/core/jni/android_server_BluetoothEventLoop.cpp @@ -1122,9 +1122,10 @@ void onCreateDeviceResult(DBusMessage *msg, void *user, void *n) { if (dbus_set_error_from_message(&err, msg)) { if (dbus_error_has_name(&err, "org.bluez.Error.AlreadyExists")) { result = CREATE_DEVICE_ALREADY_EXISTS; + } else { + result = CREATE_DEVICE_FAILED; } LOG_AND_FREE_DBUS_ERROR(&err); - result = CREATE_DEVICE_FAILED; } env->CallVoidMethod(nat->me, method_onCreateDeviceResult, -- cgit v1.1