Commit Graph

1399 Commits

Author SHA1 Message Date
Martin Brabham
2b3b1429db DO NOT MERGE: ScanFilter: Fix argument sanitization logic.
Bug: 132888204
Test: Manual
Change-Id: Id8cadbbfac29aca97ccb83815795948b1bbf85a5
2019-05-22 05:33:19 +00:00
Sal Savage
40aa11ead0 Add timestamp and read status extra constants to MAP Client
Bug: b/132455654
Test: build and run on automotive hardware. Use kitchen sink to send
and receive messages.

Change-Id: Ic0f04640f1894d6cf336ba7e641df9cf148a2bbd
2019-05-14 11:15:14 -07:00
TreeHugger Robot
87b7e3d48d Merge "Fix binder leakage when turning off Bluetooth" into qt-dev 2019-05-03 04:04:34 +00:00
Ugo Yu
6d9cfce73a Fix binder leakage when turning off Bluetooth
* In current design, Bluetooth AdapterState stops all BR/EDR
  profiles' service and triggers onServiceDisconnected callback to
  all binder clients before BluetoothManagerService invokes
  onBluetoothStateChange(false), which means unbind service
  would never be called in framework.
* Do unbind service when onServiceDisconnected is invoked.
* Move profile binder logic to BluetoothProfileConnector except:
  - BluetoothHeadset: its binder logic is in BluetoothManagerService
  - BluetoothPbap: it has an individual ServiceListener

Bug: 129037442
Bug: 129437895
Test: Bluetooth ON/OFF stress test.
      adb shell dumpsys activity services | egrep "com.android.bluetooth"
      to check whether AppBindRecord for com.android.bluetooth grows

Change-Id: Id0d85866d386962b94d2d966f0a864b1da165d13
2019-05-02 18:06:41 +08:00
Stanley Tng
649e6a57f8 Add more documentation for LE CoC
Added more information into Android SDK for LE Connection-oriented
Channels (CoC) so that it matches the corresponding RFComm
documentation.

Bug: 70683224
Test: Compile
Change-Id: I40abde70a7ca6bcd194ee75bd8367c0ed9e97d05
(cherry picked from commit bcbc130235)
Merged-In: I40abde70a7ca6bcd194ee75bd8367c0ed9e97d05
2019-04-24 09:24:19 -07:00
Zach Johnson
df512f12a1 Add nullability annotations to android.bluetooth.le.ScanFilter.Builder setServiceSolicitationUuid
Test: compilation
Fixes: 126698824
Change-Id: I4873b46a37df3e103ddc62001cc9f0bc01aea4dc
2019-04-19 22:35:13 +00:00
Jakub Pawlowski
cc01027e50 Bluetooth: Make ScanRecord.getServiceSolicitationUuids NonNull
Test: compilation
Bug: 115639878
Merged-In: I5f895d65a7036275ab0faa0afd2ee1eebc416476
Change-Id: I5f895d65a7036275ab0faa0afd2ee1eebc416476
2019-04-12 09:04:22 +02:00
Ugo Yu
4741a8bd53 Refine Bluetooth Metadata API
- Modify MetadataListener to as an interface and rename
  it to OnMetadataChangedListener
- Fix typo UNTHETHERED -> UNTETHERED
- Add NonNull annotation for metadata API parameters
- Re-design metadata unregister API
- Change metadata type to byte array

Bug: 124448651
Bug: 126701203
Bug: 126699213
Test: build pass

Change-Id: I79460071c7693f648e92cf849738c24f8bc269d9
2019-04-08 20:09:53 +08:00
Jack He
fac8c40ba5 Merge "BluetoothHealth: hide auto-created default constructors" am: 463454432b am: 39a6d731bb
am: f08eadc878

Change-Id: I042170e4b06ee298c063a84c8f7aaabe58a4c0dd
2019-04-01 17:40:49 -07:00
Jack He
875ff327e0 BluetoothHealth: hide auto-created default constructors
Fixes: 123926561
Test: make
Change-Id: I388472c82eaca245285b5ecf2959c415508d7e69
2019-04-01 13:19:54 -07:00
Ugo Yu
1cf619760e Merge "Refine Bluetooth silence mode API" am: c650674397 am: 0196a831b1
am: ae55a7a369

Change-Id: Ie5dfde6a063209acf61846438b6f507ef24f9716
2019-03-31 20:44:42 -07:00
Ugo Yu
1d2e68cf4b Refine Bluetooth silence mode API
- Remove silence state extra data from ACTION_SILENCE_MODE_CHANGED
  intent
- Rename getSilenceMode -> isInSilenceMode
- Throw IllegalStateException if Bluetooth is not enabled

Bug: 124448652
Test: runtest bluetooth

Change-Id: I6a8d8d848249faaac34e87408dcf750073b03584
2019-03-22 14:30:59 +08:00
Stanley Tng
5c85ed092a Merge "Cleanup annontations for Hearing Aids Profile API" am: f6b3f6a8d8 am: 73f7fd85cb
am: 72f589aafd

Change-Id: I1bc62eb19c3d1bd3fd6d959163aaf9e44ab0d217
2019-03-18 14:36:27 -07:00
Stanley Tng
7f3b781bfa Cleanup annontations for Hearing Aids Profile API
Remove the @UnsupportedAppUsage and add the @IntDef for the Profile
Connection States in the Hearing Aids Profile API. Also, the parent
class BluetoothProfile has its Profile Connection States annontated.

Bug: 128523382
Test: Compile only
Change-Id: Ibd02516fa637ddb48d70a8dfacf607f047aec282
2019-03-16 00:22:34 +00:00
Deqiang Chen
e00f6c33e1 Merge "Avoid IllegalArgumentException when bluetooth is disabled" am: 2a1bdd2429 am: 787e52045f
am: 8a4e2f3aeb

Change-Id: Idb94b41924023ba3fab9694c93f17ed4ce4d01b4
2019-03-14 16:04:41 -07:00
Deqiang Chen
2a1bdd2429 Merge "Avoid IllegalArgumentException when bluetooth is disabled" 2019-03-14 22:23:18 +00:00
Stanley Tng
db74e56e22 Merge "Add @NonNull annotations to LE CoC APIs" am: 8b57ab7989 am: 68e00291e0
am: f36e4f26a4

Change-Id: I674f926ff2822d311fd6f6a0cbf061a2e815b093
2019-03-12 23:37:09 -07:00
Stanley Tng
97341da063 Add @NonNull annotations to LE CoC APIs
Added NonNull annotations to the 4 LE Connection-oriented channel API in
BluetoothDevice and BluetoothAdapter.

Bug: 126701988
Bug: 126701989
Test: Compile only
Change-Id: I2d4dc8fbd06e30c782123e01f8481d249e40ee02
2019-03-13 02:27:38 +00:00
Deqiang Chen
da9f738c0c Avoid IllegalArgumentException when bluetooth is disabled
When the corresponding profile service is not available on device,
bluetoothA2dp, bluetoothHidHost and bluetoothPbap will report
IllegalArgumentException when bluetooth is disabled. This change avoid
that exception.

Bug: 127359897
Test: local test and observe there is no IllegalArgumentException when
bluetooth is disabled

Change-Id: I457e5225b8710dd5d02c405ef558892e99d1736f
(cherry picked from commit ee8371007b82ff8c6d26e8ac90c6e3d3cf6bf2a8)
2019-03-12 14:53:45 -07:00
Ugo Yu
cf592009e3 Merge "Change BluetoothCodecStatus.sameCapabilities() to public" am: 27a6501a19 am: 8db54f6563
am: 99c86ecda5

Change-Id: Id4006e0be9eca624d52a313fc6e492483cc53dbb
2019-03-09 05:49:31 -08:00
Stanley Tng
0c7376b588 Merge "Add @NonNull annotations to Hearing Aids Profile APIs" am: 6fa52c9b25 am: 1c5a742cb8
am: 4929093ff7

Change-Id: Ib1388c480e135f56063da0fe26063ef9e31a6807
2019-03-08 07:38:20 -08:00
Treehugger Robot
27a6501a19 Merge "Change BluetoothCodecStatus.sameCapabilities() to public" 2019-03-08 10:38:47 +00:00
Stanley Tng
9d37667fdc Add @NonNull annotations to Hearing Aids Profile APIs
Bug: 126699327
Bug: 119617521
Test: Ran with CTS tests for Hearing Aids Profile, android.bluetooth.cts.HearingAidProfileTest
Change-Id: If83052a68c867d839e263f490592b80bef513a01
2019-03-06 17:17:40 +00:00
Jeff Sharkey
9e8f83db6d All Parcelable CREATOR fields are @NonNull.
If they were null, then the Parcelable would fail to work.

Bug: 126726802
Test: manual
Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014
Exempt-From-Owner-Approval: Trivial API annotations
2019-02-28 23:29:04 -07:00
Ugo Yu
87f8ec4965 Change BluetoothCodecStatus.sameCapabilities() to public
- Public this API to help A2DP state machine check selectable
  codec capabilities status.

Bug: 124254557
Bug: 125551347
Test: runtest bluetooth

Change-Id: If44887f756d2e8348e8f76dfb67b77b993ffd8db
2019-02-27 19:49:13 +08:00
Nan Zhang
944f18371b Fix the incorrect javadoc links
A lot of unresolved link errors showing up after go/ag/5172152.

Test: m -j docs with -lerror enabled
Bug: b/116163454
Change-Id: I74d1f75e0f00015410a63e13103c28a9c84b4fe0
2019-02-15 14:39:24 -08:00
Xin Li
0e71b4f19b DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into
stage-aosp-master

Bug: 124234733
Change-Id: Ic4f67fde0835da0b1c363906cccef0d244e38393
2019-02-14 09:48:06 -08:00
Jean-Michel Trivi
103a678ac3 Merge "AudioDeviceBroker in audio service" 2019-01-25 22:31:09 +00:00
Jean-Michel Trivi
5885037c88 AudioDeviceBroker in audio service
New AudioDeviceBroker class running in audio service.
Has dedicated message loop for handling audio device
   connections and disconnections.
New helper classes for AudioDeviceBroker:
 - BtHelper for Bluetooth
 - AudioDeviceInventory to manage list of devices

Bug: 112863932
Test: media CTS + audio CTS Verifier
Change-Id: I3e8f662a9d82fa7245695888e14fac7f4fc6e728
2019-01-25 11:03:50 -08:00
Ugo Yu
d02a78bd95 Merge "Introduce system APIs for Bluetooth silence mode." am: d17b284bdb am: 5a5217d2b8
am: 26b4283a13

Change-Id: I07f8019e748495b05ea09bab69ec72c0ab9f271b
2019-01-24 11:21:36 -08:00
Ugo Yu
26b4283a13 Merge "Introduce system APIs for Bluetooth silence mode." am: d17b284bdb
am: 5a5217d2b8

Change-Id: Icdc5720da633f3cba7e1acb730b4ca21475d6f4b
2019-01-24 10:37:47 -08:00
Treehugger Robot
d17b284bdb Merge "Introduce system APIs for Bluetooth silence mode." 2019-01-24 18:08:05 +00:00
Ugo Yu
f3b120041d Merge "Change MetadataListener to a abstract static class" am: 9d3ce3e55e am: 745c6de6eb
am: f2d656b438

Change-Id: I68915d6190faa22e20b03321dc5895a37e6de5f8
2019-01-23 23:43:29 -08:00
Ugo Yu
f2d656b438 Merge "Change MetadataListener to a abstract static class" am: 9d3ce3e55e
am: 745c6de6eb

Change-Id: I796dfccf741a1ef6c45d804772415ed198e8e8d1
2019-01-23 23:30:18 -08:00
Treehugger Robot
9d3ce3e55e Merge "Change MetadataListener to a abstract static class" 2019-01-24 07:07:49 +00:00
Stanley Tng
38acb197cf Merge "Add Android APIs for Hearing Aids Profile" am: a53fc20213 am: 62a2308550
am: 31b70c2868

Change-Id: Iac7fe414ddc1fbc04e8bbe3c2e96d3d57d364995
2019-01-23 19:10:10 -08:00
Stanley Tng
7b85a217b2 Merge "Add 2 new ways to check for Support for Hearing Aids Profile" am: 7982e6f346 am: c144c329ab
am: 61c1afaa45

Change-Id: Ib2808f47c6df08b68a35c4cc7da269e8fbf009d4
2019-01-23 19:01:19 -08:00
Stanley Tng
31b70c2868 Merge "Add Android APIs for Hearing Aids Profile" am: a53fc20213
am: 62a2308550

Change-Id: Id9eccff5eb088f8c2638f242ff1ec6260093c1d4
2019-01-23 18:46:08 -08:00
Stanley Tng
61c1afaa45 Merge "Add 2 new ways to check for Support for Hearing Aids Profile" am: 7982e6f346
am: c144c329ab

Change-Id: If877f5b24f5201efa9448723be90d62f194bf2d6
2019-01-23 18:39:31 -08:00
Ugo Yu
d9a0a7fd55 Change MetadataListener to a abstract static class
Bug: 121051445
Test: build pass
Change-Id: I8148d13d2eb0899d54817197ae0be236e2914e47
2019-01-24 09:48:20 +08:00
Treehugger Robot
a53fc20213 Merge "Add Android APIs for Hearing Aids Profile" 2019-01-24 01:37:05 +00:00
Treehugger Robot
7982e6f346 Merge "Add 2 new ways to check for Support for Hearing Aids Profile" 2019-01-24 01:34:24 +00:00
Ugo Yu
bfbe0ee89d Introduce system APIs for Bluetooth silence mode.
Policies of silence mode:
1) If an active device (for A2DP or HFP) enters silence mode,
   the active device for that profile will be set to null.
2) If a device exits silence mode while the A2DP or HFP active
   device is null, the device will be set as the active device
   for that profile.
3) If a device is disconnected, it exits silence mode.
4) If a device is set as the active device for A2DP or HFP,
   while silence mode is enabled, then the device will exit
   silence mode.
5) If a device is in silence mode, AVRCP position change event
   and HFP AG indicators will be disabled.
6) If a device is not connected with A2DP or HFP, it cannot
   enter silence mode.

Bug: 112323989
Test: Manual, runtest bluetooth
Change-Id: If7f340de38c350f17c37f00a3a2e871876baa20d
2019-01-24 08:40:51 +08:00
Ugo Yu
250227d18b Merge "Skeleton implementation of Bluetooth metadata APIs" am: 625a1f4461 am: 2f1cba20a5
am: 716eb586ac

Change-Id: I0ac4ea988598a190d4c14378c072def122f4257e
2019-01-23 00:24:02 -08:00
Ugo Yu
716eb586ac Merge "Skeleton implementation of Bluetooth metadata APIs" am: 625a1f4461
am: 2f1cba20a5

Change-Id: If532d6e87a7d863f0802084f945b12406152d666
2019-01-23 00:12:42 -08:00
Stanley Tng
1f5ea66a39 Add Android APIs for Hearing Aids Profile
Add the new public Android APIs for the ASHA Hearing Aids Profile.

Bug: 119617521
Bug: 120222233
Test: Run with the new HearingAidProfileTest CTS test
Change-Id: I05fc3d565bd22b5000765122da7714d961dbc15b
2019-01-22 16:50:12 -08:00
Stanley Tng
61dbd81f6a Add 2 new ways to check for Support for Hearing Aids Profile
The getProfileProxy will return false if Hearing Aids Profile is not
supported. Also the getSupportedProfiles will return the correct support
for Hearing Aids even when Bluetooth is disabled.

Test: Manual testing with configuration enabled and disabled.
Bug: 119617521
Change-Id: I146bd3bc36d4c474f7bca18a05b679fb8e70ca63
2019-01-22 16:46:06 -08:00
Ugo Yu
4a33b88761 Skeleton implementation of Bluetooth metadata APIs
Bug: 121051445
Test: Build pass
Change-Id: I5e80210205b37294b1eb8356502ebf242e627ce4
2019-01-23 07:01:47 +08:00
Arun Mirpuri
cb102fa366 audio: Add API for BT to query offload A2DP encoding formats
Add API in AudioManager to query offload A2DP encoding formats
supported on primary HAL. This can be used instead of reading
from property

Bug: 111812273
Test: make
Change-Id: I168f288d0bf32d6c9733c9b57934084667e794ee
2019-01-17 14:48:27 -08:00
Jack He
17d71033ab Merge "Deprecate BluetoothHealth APIs" am: c792b78f71
am: 672b984fa6

Change-Id: I60d6429fc07cf4a2dccf5773a5c18016523d2762
2019-01-09 21:05:45 -08:00