Jaikumar Ganesh 50b40cec9c 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
2011-02-03 17:02:06 -08:00
..