Fix race condition between starting of service and getting the Profile Proxy.
Incoming A2DP connections were not working.
Change-Id: I5a3322ddb39b2512495b4cd2e35593da0f605087
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index ca763ef..ec12e80 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -215,6 +215,7 @@
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 @@
} catch (Throwable e) {
Slog.e(TAG, "Failure starting Recognition Service", e);
}
-
+
try {
Slog.i(TAG, "DiskStats Service");
ServiceManager.addService("diskstats", new DiskStatsService(context));