diff options
author | hyungseoung.yoo <hyungseoung.yoo@samsung.com> | 2011-08-05 23:01:56 -0700 |
---|---|---|
committer | Jaikumar Ganesh <jaikumar@google.com> | 2011-08-10 10:03:48 -0700 |
commit | 5ec09727f44d7f284031e0cad2c96c21b2a8399e (patch) | |
tree | c01818a548f5ed02ad02487c06e958dd943f7e86 /core/jni | |
parent | bc85a087c9a6011743d808d4bf90bd98d31aae90 (diff) | |
download | frameworks_base-5ec09727f44d7f284031e0cad2c96c21b2a8399e.zip frameworks_base-5ec09727f44d7f284031e0cad2c96c21b2a8399e.tar.gz frameworks_base-5ec09727f44d7f284031e0cad2c96c21b2a8399e.tar.bz2 |
Bluetooth : fix for bluetooth turning on issue.(limit: 64times)
Bluetooth fails to turn on after 64 iterations.
When setUpEventLoop is called, Adapter is not ready yet.
However, we have already added the Dbus match rules. These match
rules are not deleted and we hit the dbus limit.
Change-Id: If207d4d33574685520a852b53a641adfbeb45d43
Author: hyungseoung.yoo <hyungseoung.yoo@samsung.com>
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android_server_BluetoothEventLoop.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/jni/android_server_BluetoothEventLoop.cpp b/core/jni/android_server_BluetoothEventLoop.cpp index 8f84b81..45b7f27 100644 --- a/core/jni/android_server_BluetoothEventLoop.cpp +++ b/core/jni/android_server_BluetoothEventLoop.cpp @@ -229,6 +229,13 @@ static jboolean setUpEventLoop(native_data_t *nat) { DBusError err; dbus_error_init(&err); + const char *agent_path = "/android/bluetooth/agent"; + const char *capabilities = "DisplayYesNo"; + if (register_agent(nat, agent_path, capabilities) < 0) { + dbus_connection_unregister_object_path (nat->conn, agent_path); + return JNI_FALSE; + } + // Add a filter for all incoming messages if (!dbus_connection_add_filter(nat->conn, event_filter, nat, NULL)){ return JNI_FALSE; @@ -294,12 +301,6 @@ static jboolean setUpEventLoop(native_data_t *nat) { return JNI_FALSE; } - const char *agent_path = "/android/bluetooth/agent"; - const char *capabilities = "DisplayYesNo"; - if (register_agent(nat, agent_path, capabilities) < 0) { - dbus_connection_unregister_object_path (nat->conn, agent_path); - return JNI_FALSE; - } return JNI_TRUE; } return JNI_FALSE; |