Commit Graph

494 Commits

Author SHA1 Message Date
Prerepa Viswanadham
248edc3e96 Update javadoc comments for getBluetoothLeAdvertiser()
To clarify that BluetoothLeAdvertiser object will return null
when BT is off OR if the hw doesn't support these capabilities

bug: 18006072
Change-Id: I635d7971711a3cae7c58f7a0636faf9a03f19970
2014-10-16 16:06:44 +00:00
Prerepa Viswanadham
f0b56a5a7f Remove remanents of onConnectionCongested in framwork
Bug:17289507
Change-Id: Ia28c39822141edd0e4dc3f623b8c2f280fc5f943
2014-09-24 22:15:08 +00:00
Edward Jee
1bbfcc2fdc Merge "Adds APIs for Bluetooth PBAP and MAP access permission." into lmp-dev 2014-09-16 01:19:19 +00:00
Prerepa Viswanadham
ba4f57a1c6 Remove onConnectionCongested callback
Bug:17289507

Change-Id: I49fd99d320084c618dcec756b832fb3b6a6aec51
2014-09-11 22:29:27 +00:00
Edward Jee
8dd30aadaf Adds APIs for Bluetooth PBAP and MAP access permission.
Currently, users' preference in phonebook and call history or message
access per each Bluetooth-paired device is stored in Settings application's
shared preferences.

However, some privileged applications other than Settings need to access
such data. So we decided to migrate the data from Settings application's
shared preferences to Bluetooth application's.

Bug: 17158953
Change-Id: I3771f03eaea3f57cf60d93ab9fd41c9eb3e1e99c
2014-09-09 15:10:01 -07:00
Wei Wang
6550557f99 Merge "Unregister app when advertise failed after registration." into lmp-dev 2014-09-05 18:49:27 +00:00
Matthew Xie
726652e9d3 Close the base socket when bindListen fails
Bug: 10773872
Change-Id: I0a72b2eb65055fa1959070d2dc32d40a573bd6f2
2014-09-03 19:25:39 +00:00
Wei Wang
833559d9f3 Unregister app when advertise failed after registration.
Also moved bluetooth state check to common utils class.

Bug:17364837
Change-Id: I25ff7afae723d47f701236d5a68eab8015de9bbb
2014-09-02 18:32:37 -07:00
Wei Wang
b1e066bc27 Merge "Fix API council review comments. Also hide certain APIs(1/3)." into lmp-dev 2014-08-24 23:00:20 +00:00
Andre Eisenbach
491cb3f578 Merge "LE: Rename new MTU and connection paramter update APIs" into lmp-dev 2014-08-21 17:56:25 +00:00
Wei Wang
7cb10ac392 Merge "Fix threading issue for advertising." into lmp-dev 2014-08-21 04:10:51 +00:00
Andre Eisenbach
4072da041d LE: Rename new MTU and connection paramter update APIs
bug 17005342

Change-Id: I23151e1e92fe86896fc2883f81aef82084bb4215
2014-08-20 02:03:57 +00:00
Wei Wang
9a974be631 Fix threading issue for advertising.
Post callback to main thread to execute. In general we should avoid
running app's callback method from binder thread as the callback method
may block.
Also removed callback from advertisers on stop advertising callback.
This fixes the issue of not being able to restart adv for limited
advertising.

Bug: 17045567

Change-Id: I56cd2bdf4b1ad120a0358fa4065ad77be4bff144
2014-08-19 10:40:36 -07:00
Wei Wang
b661bb7958 Fix race condition for BluetoothLeScanner.
Root cause of the issue:
Client registeration was done on caller's thread, while
onClientRegistered was called from binder thread. There is a slight
chance that onClientRegistered was called before registerClient
returned, causing a premature notifyAll before wait was called.

By forcing acquiring the same lock now it's guaranteed wait would
happen before onClientRegistered callback was executed.

Bug: 16707401
Change-Id: Ic60adec475085741d14ecd2d2bb462246f88da58
2014-08-19 10:46:52 -07:00
Wei Wang
9960b57653 Fix API council review comments. Also hide certain APIs(1/3).
b/17006825.

Change-Id: Iee64b11920152e0ab3da54decf37fa4a83be5dc7
2014-08-15 14:07:14 -07:00
Prerepa Viswanadham
621085e50f Protect from malformed advt with invalid manf_id/data combo
Bug: 16979645
Change-Id: Ie7ea00ed20cbad1120c7582bb2bafd44b4295052
2014-08-14 05:33:11 +00:00
Prerepa Viswanadham
ee3cc8bf17 Prevent crash in Gatt service due to null pointer in
BluetoothGattCharacteristic from framework

Bug 16899517

Change-Id: Ib30ddefee07c2953f9a7faeb4eaa823feeebdc8f
2014-08-14 05:32:06 +00:00
Wei Wang
ee80922c6a Clean up advertise and scan clients upon bluetooth down.
Fixes b/16528460

This allows Advertiser and Scanner to be reused after bluetooth recycle,
which follows same behavior for BluetoothAdapter.

Also prints manufacturer data array for ScanRecord.

Change-Id: I78bca40ac294433782a054bf2a00a775dac02d96
2014-08-13 11:08:48 -07:00
Wei Wang
0d0df3ce25 Add a TLV to support different result storage
Change-Id: Ic20a1720b783508cf85b234950b7fd0c79e9e7c3
2014-08-07 18:57:24 -07:00
Prerepa Viswanadham
d5324e4183 OnLost/OnFound integration - onfound match is done in framework,
whereas hw signal is used to report onlost.

Bug 16733710

Change-Id: I7b177b7afd730341c336818857436c095735b53b
2014-08-07 19:51:59 +00:00
Andre Eisenbach
57210c7a1a Add transport parameter to createBond() function (4/4)
Bug: 14063256
Change-Id: I096248b60752992aa23ce5bfbfc47fda95773db2
2014-08-05 17:01:13 +00:00
Wei Wang
e0d4afb2d4 Add a default impelementation of IBluetoothGattCallback(1/2).
Also cleaned up a few TODOs and fixed bug.
b/16410260 AdvertiseCallback null onSuccess callback

Change-Id: I75a582c03be1e2ef6964c2cbeba42aaaf9f9e17c
2014-08-01 14:34:25 -07:00
Wei Wang
6bf513d32d Revert "Revert "Service data and manufacturer data can be repeated fields.""
This reverts commit 14c797702543bb5ced989565d90abcfa55c7db46.
2014-08-01 11:12:37 -07:00
Sungsoo Lim
67c01a4b6d Revert "Service data and manufacturer data can be repeated fields."
This reverts commit 26dc9b99b17ca9d8ce3632c48e8b6c1450ee53e9.

Change-Id: I1846d0a6491c5b2ba5905411bd98f5d17909b705
2014-08-01 01:24:14 +00:00
Wei Wang
3f7a39063a Service data and manufacturer data can be repeated fields.
b/16635899

Change-Id: I73f1f4effd3f0e38cd427297eb9d22f3ba285d61
2014-07-31 15:43:05 -07:00
Wei Wang
64d2b567c3 Merge "Make scan filter accepts prefix. Add tests." into lmp-dev 2014-07-25 23:01:28 +00:00
Wei Wang
0462468aaf Make scan filter accepts prefix. Add tests.
Change-Id: I714dd6d95ad2bc874dce1106b325762b19159119
2014-07-28 21:46:44 -07:00
Prerepa Viswanadham
f6b3d8ca36 Fix crash in Stopping/Starting BLE advertising after
BluetoothAdapter cycling

Bug 16528460
Change-Id: Iad852bc93d307c5ca5f7e42f24248aa02c105e8a
2014-07-29 21:06:29 +00:00
Andre Eisenbach
d65e8f4b6b LE: Do not invoke callback if retrying read/write operation
When a descriptor read/write operation fails with insufficient
authentication/encryption, it will automatically be tried again with
elevated security requirements. The first (failed) attempt should not be
reported to the application requesting the read/write, since it will get
the 2nd callback once the retry succeeds/fails.

Change-Id: Ia27b91afa63b6f9ffdc597d59c24d29f3d8a1008
2014-07-28 15:48:59 +00:00
Wei Wang
ab2ed62f15 Split manu id and manu data.
b/16407380

Change-Id: I39f6ce0ab4cccadec809f0a4f518f5d2c77a90b7
2014-07-27 23:12:26 -07:00
Wei Wang
ec64dbfbc0 Fix bug of ScanSettings. Add unit test.
b/16318637.

Change-Id: I3fbc1212c1712faa0c29132f3dc9cfc1d58af26b
2014-07-25 10:56:08 -07:00
Wei Wang
c3059ccfb0 Use Scanner for legacy LE scans(1/2).
Also removed different scan methods from IBluetoothGatt and make
BluetoothLeScanner and BluetoothLEAdvertiser singleton.

Change-Id: Ifa2e950b50f100f5507a6dace3bd70db18d7f9ca
2014-07-24 20:26:55 -07:00
Prerepa Viswanadham
5bec5af971 cleanup : delete BLE advertising related hidden state references in Bluetooth Adapter
Change-Id: Ia58a46392157e274f8fc4696e8e25af480eb2d2a
2014-07-24 19:28:12 +00:00
Wei Wang
0e81ca2543 Move AdvertiseData length check to BluetoothAdvertiser.
This will keep AdvertiseData simple and avoid coupling with
BluetoothAdapter.

Change-Id: I3609652bdea1c6e757bac7d2dada7f8ddf20a5e3
2014-07-23 20:39:12 -07:00
Prerepa Viswanadham
8caac741a0 Bug 15564216: Report Bluetooth tx/rx/idle activity info and energy reporting
Change-Id: I66fd83d8d59fbd93dec8886dfd313a81575e38a5
2014-07-23 18:54:46 +00:00
Wei Wang
03259472b1 Fix parcel issues with empty service uuid. Added tests.
b/16490816

Change-Id: If26a4731f22e83df4f5ded2ad76901de6c49a010
2014-07-23 10:23:10 -07:00
Wei Wang
685c175890 More API modification of BLE APIs (1/2).
Changed include:

1) Add serviceDataUuid to filter so it matches sanRecord and
AdvertiseData.
2) Add raw bytes to ScanRecord and make ScanResult take a ScanRecord
instead of raw bytes.
3) Change from setServiceUuid(List) to addServiceUuid(ParcelUuid).
4) Added include device name
5) Removed service not registered and added ADVERTISE_DATA_TOO_LARGE.
6) Fixed a few comments.

Change-Id: Ibbe07183b1293835c4a84728d1cd2d61e5d627d3
2014-07-18 18:31:00 -07:00
Andre Eisenbach
55d19e495e Reduce GATT logging output
Change-Id: Iefdf101ac849e45bf50c55ce5999364f5fbd24a4
2014-07-18 14:38:36 -07:00
Andre Eisenbach
6ce4db0acf LE: Add connection parameter update request API (4/4)
Change-Id: Ifb531a1b7ab05888817b96fcc89f85e17df7ffe2
2014-07-18 12:13:46 -07:00
Wei Wang
890b46a0d5 Remove MR2 BLE Advertising hidden API from L codebase (1/2).
Change-Id: I78bb8b89de56bddb7422da1d1d4468c88a68ea11
2014-07-14 19:31:49 -07:00
Wei Wang
af74e66e29 Unhide Bluetooth batch APIs. Deprecate BluetoothAdpater scan APIs. (1/2)
Change-Id: Ib0c4ea6c8372a15473269660355fb5ccf4284457
2014-07-11 11:06:10 -07:00
Prerepa Viswanadham
b108a6fef1 Unhide the Bluetooth(BLE) offload capability apis
Change-Id: Ice3f4f5ff4b8318bf6afe7021b253fe9ea4661d3
2014-07-09 21:23:51 +00:00
Prerepa Viswanadham
8f2e74cac2 OnFound and Onlost callback integration
Change-Id: I23473b18484f041c4dd808c85bb92545a77e20c2
2014-07-09 21:07:13 +00:00
Andre Eisenbach
45a0a1a689 LE: Un-hide new congestion control and MTU APIs
Change-Id: I5ce395481620dd7ab611b1ab0eaeb5e29c4f13fa
2014-07-08 17:09:38 -07:00
Prerepa Viswanadham
8e5270fdf5 Tie in BLE hw capabilities with api invocation and support.
Change-Id: Ic1f0b3f156cf2fdde8f04b5c4384e4fd3d79623a
2014-07-08 23:34:49 +00:00
Wei Wang
9fb1791e1a Implement batch scan API
Change-Id: Ibb527280a221fbdd0fc6b805a7527c29079294b4
2014-07-08 00:42:32 -07:00
Prerepa Viswanadham
0c116e1573 Obtain capabilities from chipset for it's support of various features
Change-Id: I01bdb31136be63e4e46fb4e054c902eddc5647ab
2014-07-02 21:24:37 +00:00
Hemant Gupta
8949bfb90c Bluetooth: Support MAP Client role on Bluedroid.
Implementation changes to support MAP client and PBAP client
role on Bluedroid stack.

Change-Id: I1733a67bf5256bd7b181bd5e68e40b476994ebfd
2014-07-01 18:01:27 +00:00
Andre Eisenbach
061cfd0049 LE: Fix GATT server documentation to reflect API updates
Change-Id: I21100dd55a7bf9e85a07742f571d5743bad5ece1
2014-07-01 17:16:11 +00:00
Mudumba Ananth
177d078d90 Add WBS support on Bluedroid (6/6)
Bug 13764086

Change-Id: I7afbddb02fc247d7799ab0fb264a467c7853cb32
2014-06-30 22:44:24 +00:00