Commit Graph

512 Commits

Author SHA1 Message Date
Prerepa Viswanadham
fd5e847cb6 am 12120998: am e21aafab: am ff5e5db3: Fix BT crash due to unset value for BluetoothGattDescriptor from API user
* commit '12120998f8b34c809d8f29790a8f74e624b26e38':
  Fix BT crash due to unset value for BluetoothGattDescriptor from API user
2014-12-05 21:19:53 +00:00
Prerepa Viswanadham
12120998f8 am e21aafab: am ff5e5db3: Fix BT crash due to unset value for BluetoothGattDescriptor from API user
* commit 'e21aafab0d735935155860bd16dcc3ece81ce546':
  Fix BT crash due to unset value for BluetoothGattDescriptor from API user
2014-12-05 20:18:38 +00:00
Mike Lockwood
6d37adf83d am a6e14c82: am 75b25577: am 448403b7: Merge "Dont call close in in BluetoothA2dp finalize"
* commit 'a6e14c8293ef470e29541500506de15d61ab6bf0':
  Dont call close in in BluetoothA2dp finalize
2014-12-05 00:15:42 +00:00
Mike Lockwood
a6e14c8293 am 75b25577: am 448403b7: Merge "Dont call close in in BluetoothA2dp finalize"
* commit '75b2557725430e768cc3b21bb9c2aef92b887538':
  Dont call close in in BluetoothA2dp finalize
2014-12-04 22:45:07 +00:00
Prerepa Viswanadham
ff5e5db319 Fix BT crash due to unset value for BluetoothGattDescriptor from API user
Validate writeDescriptor and writeCharacteristic methods at API invocation
for non null initialisation.

Bug 18395071

Change-Id: I411a57b77981310d8db1f98c67e03b4327c93339
2014-12-04 18:30:03 +00:00
Andre Eisenbach
2b5f59d524 am b45c38ac: am fcb94852: am a1a6c300: Merge "Add server-side callback for change in MTU (4/4)" into lmp-mr1-dev
* commit 'b45c38acc7c4ea0eaa79209e0d6de7c4f0f34c52':
  Add server-side callback for change in MTU (4/4)
2014-12-02 08:24:19 +00:00
Andre Eisenbach
16bf846990 Add server-side callback for change in MTU (4/4)
When a client requests to update the LE transport MTU, the server
currently does not get notified and can therefor not properly size
notifications appropriate to the current MTU.

Bug: 18388114
Change-Id: I515bfc2cc9846490d57de71860f41ea9a61fa243
2014-11-26 12:58:44 -08:00
Tom Turney
dfd827e424 am e9f8d1dd: am 2a46722f: Merge "Feature request: Increasing advertise data size on non-connectable adv. When the advertisement is non-connectable, give back the bytes to the advertiser where the adv flags would have been. This increases the non-connectable advertisem
* commit 'e9f8d1ddbdfe6bf9d4b4a9cb1fca8703febff742':
  Feature request: Increasing advertise data size on non-connectable adv. When the advertisement is non-connectable, give back the bytes to the advertiser where the adv flags would have been. This increases the non-connectable advertisement's advertise data from 24 to 27 bytes.
2014-11-15 03:38:12 +00:00
Tom Turney
29230ceab9 Feature request: Increasing advertise data size on
non-connectable adv.
When the advertisement is non-connectable, give back the
bytes to the advertiser where the adv flags would have been.
This increases the non-connectable advertisement's advertise
data from 24 to 27 bytes.

Bug:18359570
Change-Id: Ia3cc48dca50cc3c51095ee92a489f143f6d350b1
2014-11-15 02:25:05 +00:00
Mike Lockwood
7c2b60ed37 am d73463c6: Merge "Add dumpsys support for bluetooth" into lmp-mr1-dev automerge: 95c05a5
automerge: 5a880e72

* commit '5a880e72024882d1a4ad5a04a4cb4a6aa5e6d426':
  Add dumpsys support for bluetooth
2014-11-08 03:09:13 +00:00
Mike Lockwood
95c05a590f Merge "Add dumpsys support for bluetooth" into lmp-mr1-dev 2014-11-08 02:15:28 +00:00
Mathias Jeppsson
2d2d8c2854 Dont call close in in BluetoothA2dp finalize
The close in finalize() is pointless, as finalize() will only be called
if there are no references to BluetoothA2dp. Until close() is called,
BluetoothManagerService will have a reference to BluetoothA2dp,
preventing garbage collection and finalize() to be called. This means
finalize() is not serving its purpose of cleaning up in cases close()
is not called, as finalize() is only called if close() has already
been called.

Actually calling close in finalize here means unregistering the already
unregistered mBluetoothStateChangeCallback which can lead to crashes
when pairing/unpairing BTH. A typical crash would look like:

*** FATAL EXCEPTION IN SYSTEM PROCESS: BluetoothManager
java.lang.NullPointerException
at android.os.RemoteCallbackList.unregister(RemoteCallbackList.java:143)
at com.android.server.BluetoothManagerService$BluetoothHandler.handleMessage(BluetoothManagerService.java:780)
at android.os.Handler.dispatchMessage(Handler.java:99)

Change-Id: Ib65962917ecbacf7900d7fe540057e6915f0532d
2014-11-07 07:02:50 +00:00
Mike Lockwood
ddbfc9ada1 Add BluetoothDevice field to BluetoothHeadsetClientCall
Change-Id: I9bc70eb289fdfb64e315e3508ddeef1cb009cc54
2014-11-04 11:37:24 -08:00
Andre Eisenbach
178d3b54cd Fix crash during Bluetooth on/off stress test
Bug: 18106938
Change-Id: Icdeb736d89d5926264f2043455ccbc3760fd5d29
2014-10-29 12:13:38 -07:00
Mike Lockwood
726d4de780 Add dumpsys support for bluetooth
Bug: 18159457
Change-Id: I8d3f7084a7b089c111fd622ff526630bfdfa7300
2014-10-28 14:06:28 -07:00
Wei Wang
020bd7b861 Remove spammy log information for BLE scan.
Bug:17574681
Change-Id: Ic5761ad7262200f38f2b67659c37f8a3f01d80d5
2014-10-18 00:29:57 +00:00
Prerepa Viswanadham
56302744c4 am 248edc3e: Update javadoc comments for getBluetoothLeAdvertiser()
* commit '248edc3e969217aec1fcce7f324cbae6c46da0a3':
  Update javadoc comments for getBluetoothLeAdvertiser()
2014-10-16 16:11:26 +00:00
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
Wei Wang
35cd4c853f Add support of advertising through standard instance.(1/4)
Use config overlay to check whether peripheral mode is supported.

Bug: 17552672
Change-Id: I1081bc84da9fe033426f82ece2ec74c2d663e3aa
2014-10-09 18:01:39 +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