From 77b4ad0e496941a28382eb938a05831f1f8d2d4a Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Mon, 30 Nov 2009 14:17:30 -0800 Subject: [PATCH] Register Handsfree profile before headset profile. There is a delay between registering the two profiles, and handsfree profile is a superset of the headset profile. So some devices do an SDP and get the headset profile record before we have registered the handsfree profile. a) We can reject all incoming connections till all profiles are registered, but then this would mean we connect later in some cases. Registering profiles in this order seems fine to me. Note: There is a also the need to fix forking sdptool to register profiles, which would obliviate the need to wait 500 msecs between profile registrations. --- core/java/android/server/BluetoothService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java index cb95396d28cea..f8592e26bd305 100644 --- a/core/java/android/server/BluetoothService.java +++ b/core/java/android/server/BluetoothService.java @@ -344,14 +344,14 @@ public class BluetoothService extends IBluetooth.Stub { // records, use a DBUS call instead. switch (msg.arg1) { case 1: - Log.d(TAG, "Registering hsag record"); - SystemService.start("hsag"); + Log.d(TAG, "Registering hfag record"); + SystemService.start("hfag"); mHandler.sendMessageDelayed( mHandler.obtainMessage(MESSAGE_REGISTER_SDP_RECORDS, 2, -1), 500); break; case 2: - Log.d(TAG, "Registering hfag record"); - SystemService.start("hfag"); + Log.d(TAG, "Registering hsag record"); + SystemService.start("hsag"); mHandler.sendMessageDelayed( mHandler.obtainMessage(MESSAGE_REGISTER_SDP_RECORDS, 3, -1), 500); break;