From a0c680393f2dd03a937c598b2cb9abf98a58152c Mon Sep 17 00:00:00 2001 From: Matthew Xie Date: Sat, 25 Jun 2011 21:47:07 -0700 Subject: Incoming Bluetooth Connection requests - dialog. This sends the intents to the Settings app to show the dialogs for the incoming connection requests. Includes down merged contributions from Jaikumar Ganesh. Change-Id: Ic8b857aad3554315aae39a0e871eb94d0ac98a91 --- core/java/android/server/BluetoothBondState.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'core/java/android/server/BluetoothBondState.java') diff --git a/core/java/android/server/BluetoothBondState.java b/core/java/android/server/BluetoothBondState.java index 76e7885..75f38f9 100644 --- a/core/java/android/server/BluetoothBondState.java +++ b/core/java/android/server/BluetoothBondState.java @@ -121,6 +121,8 @@ class BluetoothBondState { /** reason is ignored unless state == BOND_NOT_BONDED */ public synchronized void setBondState(String address, int state, int reason) { + if (DBG) Log.d(TAG, "setBondState " + "address" + " " + state + "reason: " + reason); + int oldState = getBondState(address); if (oldState == state) { return; @@ -136,8 +138,10 @@ class BluetoothBondState { if (state == BluetoothDevice.BOND_BONDED) { mService.addProfileState(address); - } else if (state == BluetoothDevice.BOND_NONE) { - mService.removeProfileState(address); + } else if (state == BluetoothDevice.BOND_BONDING) { + if (mA2dpProxy == null || mHeadsetProxy == null) { + getProfileProxy(); + } } setProfilePriorities(address, state); @@ -240,6 +244,8 @@ class BluetoothBondState { } public synchronized void clearPinAttempts(String address) { + if (DBG) Log.d(TAG, "clearPinAttempts: " + address); + mPinAttempt.remove(address); } @@ -265,6 +271,8 @@ class BluetoothBondState { } else { newAttempt = attempt.intValue() + 1; } + if (DBG) Log.d(TAG, "attemp newAttempt: " + newAttempt); + mPinAttempt.put(address, new Integer(newAttempt)); } -- cgit v1.1