From 50b40cec9c43eeeb9389ba2a99bcffd160246132 Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Wed, 2 Feb 2011 14:44:49 -0800 Subject: Wait till SDP records are registered before sending intent. Wait till all SDP records are registered, before sending STATE_ON intent. This would fix crashes in Settings app when the profile manager is not registered. Problem: We were sending Bluetooth State on intent before we got the uuid state change intent from Bluez, which is asynchronous. Hence when the Settings app queries for the profiles to decide if headset profile was registered it would get false and the profile manager would be null causing crashes. This was not 100 % reproducible, well because it was a race condition. Change-Id: I791eb63dfbc78aba4c06fd8db933069cb5fde00d --- core/java/android/server/BluetoothEventLoop.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/java/android/server/BluetoothEventLoop.java') diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java index cd3bc3e7c32a..e9f28fa9cc31 100644 --- a/core/java/android/server/BluetoothEventLoop.java +++ b/core/java/android/server/BluetoothEventLoop.java @@ -306,6 +306,9 @@ class BluetoothEventLoop { value = str.toString(); } mBluetoothService.setProperty(name, value); + if (name.equals("UUIDs")) { + mBluetoothService.updateBluetoothState(value); + } } else if (name.equals("Powered")) { // bluetoothd has restarted, re-read all our properties. // Note: bluez only sends this property change when it restarts. -- cgit v1.2.3