Fix race condition between starting of service and getting the Profile Proxy.

Incoming A2DP connections were not working.

Change-Id: I5a3322ddb39b2512495b4cd2e35593da0f605087
This commit is contained in:
Jaikumar Ganesh
2010-10-18 15:29:09 -07:00
parent 2cd6f4709c
commit 7d0548d094
3 changed files with 8 additions and 1 deletions

View File

@@ -215,6 +215,7 @@ class ServerThread extends Thread {
bluetoothA2dp = new BluetoothA2dpService(context, bluetooth);
ServiceManager.addService(BluetoothA2dpService.BLUETOOTH_A2DP_SERVICE,
bluetoothA2dp);
bluetooth.initAfterA2dpRegistration();
int bluetoothOn = Settings.Secure.getInt(mContentResolver,
Settings.Secure.BLUETOOTH_ON, 0);
@@ -438,7 +439,7 @@ class ServerThread extends Thread {
} catch (Throwable e) {
Slog.e(TAG, "Failure starting Recognition Service", e);
}
try {
Slog.i(TAG, "DiskStats Service");
ServiceManager.addService("diskstats", new DiskStatsService(context));