Commit Graph

6 Commits

Author SHA1 Message Date
Lukasz Rymanowski
e623075212 android: Update bond state on auth and connect failed 2013-11-15 20:22:23 +02:00
Lukasz Rymanowski
818d532ba3 android: Cache device name on device list. 2013-11-15 20:20:51 +02:00
Lukasz Rymanowski
e9d43a87fa 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.
2013-11-15 20:19:50 +02:00
Szymon Janc
e30125fa92 android: Fix not storing adapter index in index added event
If controller was addded after daemon start its index was not stored
resulting in mgmt commands to be always send to MGMT_INDEX_NONE index.
2013-11-15 14:44:10 +02:00
Szymon Janc
9ad9540f7d android: Rename bluetooth service functions to match service name
Make public functions match service name.
2013-11-14 14:58:16 +02:00
Szymon Janc
c060fc6976 android: Rename adapter.c to bluetooth.c
Match service name that is implemened in that file. This will also
keep convention of foo.c and hal-foo.c implementing remote parts of
same service.
2013-11-14 14:57:56 +02:00