Commit: e9d43a87fa324ab68c459df22e0843f72ac98093
Parent: e30125fa921bc1d2c27ea47f79318ee90bbe54d5
Author: Lukasz Rymanowski <lukasz.rymanowski@tieto.com>
Committer: Johan Hedberg <johan.hedberg@intel.com>
Date: 2013-11-15 20:19:50
Tree: 3bb4fa5dec494f23abfc384dab52d78caab11fc0

android: Update bond state on incoming bonding Before sending any ssp request or pin code request up to HAL library we need to send bond state change with bonding state. Otherwise incoming bonding is not correctly handled by Bluetooth.apk. In this patch also device list has been added in order to e.g track bonding state. Note: For incoming paring (security mode 3) there is a need to send HAL_EVE_REMOTE_DEVICE_PROPS before HAL_EV_PIN_REQUEST. It is because Android will crash due to bug in pinRequestCallback function in java. Android checks if device is already in HashMap and if not then creates device, but forget to use that one, but instead do operations on NULL. By sending HAL_BOND_STATE_BONDING event it works better but we have race issue. It is because new device is added to HashMap not in callback context but later after BONDING msg will be received by BondStateMachine. If it happens before pin_request_cb hits java then we are fine, otherwise not. So for that reason we send HAL_EV_REMOTE_DEVICE_PROPS so in the java handler class new device will be added to HashMap in the callback context. In ssp case we don't have this problem as we send device found once acl is created.

Diffstat

M android/bluetooth.c | 97 ++++++++++++++++++++++++++++++++++++++++- - - - - - - - - - - - - -

1 files changed, 83 insertions(+), 14 deletions(-)

View Full Diff | Patch