Commit Graph

1295 Commits

Author SHA1 Message Date
Stanley Tng
ef31c4a72a Merge "Unhide the LE CoC APIs" am: 0677766615 am: ac723d7d62
am: af4189b8fa

Change-Id: I56f67e9e381c2ebe009405cf32bb78ed0ee50acd
2018-09-18 13:42:51 -07:00
Treehugger Robot
0677766615 Merge "Unhide the LE CoC APIs" 2018-09-18 18:31:26 +00:00
Mathew Inwood
8c854f86a4 Move some members to the "Q blacklist".
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
2018-09-14 13:18:34 +01:00
Stanley Tng
1bff4bab9a Unhide the LE CoC APIs
Expose the LE Connection-oriented Channels APIs for applications to use.

Test: Run the SL4A ACTS test: BleCocTest
Bug: 70683224
Change-Id: I68128bc7154966ec065091c973351f8892da9b4d
2018-09-13 13:46:39 -07:00
Jakub Pawlowski
844f1387d3 Merge "BLE: Add service solicitation uuid feature in scan filter" am: 13d6540956 am: 253403081a
am: 76bb514c78

Change-Id: I303fbf653865158f31de98b7b0d640c92ba896f6
2018-08-29 04:54:45 -07:00
Nitin Shivpure
1555eae7fa BLE: Add service solicitation uuid feature in scan filter
Adding service solicitation uuid feature in
scan filter, So BLE Scanner can set scan filter for
advertising packets that includes the Service Solicitation
uuid, which can be one of the below types.
 - List of 16 bit Service UUIDs
 - List of 32 bit Service UUIDs
 - List of 128 bit Service UUIDs

Test: BLE Scanner can do filter scan for advertising packets that
includes the Service Solicitation uuid.

Bug: 78483310
Change-Id: I3d83c50e446fca06a76db002dad716759c145d6e
2018-08-29 07:40:29 +00:00
Cheney Ni
da28fa37e8 Merge "Be the current user to get A2DP proxy" am: c3824e5d57 am: 280efb289b
am: ffb6f109a3

Change-Id: Ia4ecd35123fe0964b80482e072e327748bbc2fe1
2018-08-22 08:01:31 -07:00
Treehugger Robot
c3824e5d57 Merge "Be the current user to get A2DP proxy" 2018-08-22 05:40:11 +00:00
Stanley Tng
3ec282771f Merge "Add note for FLAG_CANCEL_CURRENT when stopping scan" am: 041eb388de am: d63c1209ed
am: cf825b33a0

Change-Id: I9d7ade22e528dac625debb580b0ebc54022b83a1
2018-08-21 13:50:49 -07:00
Treehugger Robot
041eb388de Merge "Add note for FLAG_CANCEL_CURRENT when stopping scan" 2018-08-21 17:01:00 +00:00
Pulkit Bhuwalka
229474ec38 Merge "Add IntDef to BluetoothAdapter IO_CAP constants" am: c1fd61b302 am: 84384d5980
am: 44dfe29e61

Change-Id: If99923316742dbc18ce2c66bc529971ededba485
2018-08-21 03:36:21 -07:00
Cheney Ni
4b6d6c202b Be the current user to get A2DP proxy
After user switched, Bluetooth process will be restarted to run as
secondary user and some system process like AudioService keeps as
primary user. When BluetoothA2dp did rebind, it still used primary UID
for those system process and caused they could not invoke A2DP APIs.

This changes to use current user ID when rebinding to A2dpService and
system process can get correct A2DP proxy after user switched.

Bug: 112469503
Test: manual
Change-Id: If5ee945b0dcf2044ef2baedd762751fa6ef3d09a
2018-08-21 14:08:00 +08:00
Stanley Tng
20fc9a250e Add note for FLAG_CANCEL_CURRENT when stopping scan
Added a note in the Android API documentation for stopScan to make sure
that the flag FLAG_CANCEL_CURRENT is not used when creating the
PendingIntent parameter.

Bug: 77658091
Test: Just compile since not logic is changed
Change-Id: I55f33ae68679310ba4899708a2072a40fea0b3b4
2018-08-20 16:15:58 -07:00
Treehugger Robot
c1fd61b302 Merge "Add IntDef to BluetoothAdapter IO_CAP constants" 2018-08-20 21:43:24 +00:00
Jakub Pawlowski
ca20c61506 Merge "Fix NPE when starting advertising with null GATT" am: 4d98474f2a am: cff1ab6210 am: 5eaffc9ed7
am: f2c63d34b5

Change-Id: I43aa543e5ca87482f2973fac342d9b43c25b67e7
2018-08-09 02:19:48 -07:00
Treehugger Robot
4d98474f2a Merge "Fix NPE when starting advertising with null GATT" 2018-08-09 06:48:17 +00:00
Ralph Nathan
3de75f42da Merge "Mark BluetoothClass#getClassOfDevice as TestApi" am: d5eff002eb am: 045247ec3a am: b9edd4fbc4
am: 07fe5664c5

Change-Id: I79e8943ff3ec4791b40eebdf991e71a0935e377b
2018-08-08 21:20:37 -07:00
Treehugger Robot
d5eff002eb Merge "Mark BluetoothClass#getClassOfDevice as TestApi" 2018-08-09 00:58:44 +00:00
Jakub Pawlowski
1f014f4010 Fix NPE when starting advertising with null GATT
Bug: 112164168
Change-Id: I82be0e06e990cc116d3ab48de80b5bb170d69892
2018-08-08 12:14:17 +00:00
Ralph Nathan
29335fdc9b Mark BluetoothClass#getClassOfDevice as TestApi
This method is being used the Android Things instrumentation test apk.

Bug: 111654175
Test: tests pass
Change-Id: Id3fcd2d89789868e50048542fd1dfe25d9986103
2018-08-06 15:21:30 -07:00
Mathew Inwood
4a8c67bbe8 Merge "Add @UnsupportedAppUsage annotations"
am: b40b37910d

Change-Id: Ic3de9e4c6d17687d4a1f64c02026e5c0711e8fd1
2018-08-06 03:59:41 -07:00
Mathew Inwood
7acad5ec2d Add @UnsupportedAppUsage annotations
For packages:
  android.bluetooth.le
  android.bluetooth

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I88a1311e27c5f9a5f9d1035db76034f86f650efc
2018-08-02 14:36:57 +01:00
Mathew Inwood
4dc66d3c58 Add @UnsupportedAppUsage annotations
For packages:
  android.bluetooth.le
  android.bluetooth

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: Ifcf24c0617acd7facc0e03f30a95c3a6b09b205c
Merged-In: I88a1311e27c5f9a5f9d1035db76034f86f650efc
2018-08-01 15:07:20 +01:00
Claire Treyz
4e15605b5b Fix unregisterScanner call in BluetoothLeScanner.
LE scanners were originally part of the GATT client, but were seperated
out and have their own registration API, so the BluetoothLeScanner call
to unregisterClient should be updated to call unregisterScanner.

Bug:75984723
Change-Id: I4c0543beb6d7b706cf75e78fcfb58480a6efd1d8
2018-07-26 10:17:53 -07:00
Pulkit Bhuwalka
80238145a3 Add IntDef to BluetoothAdapter IO_CAP constants
Bug: None
Test: Builds
Change-Id: I04f8f6cdcc1a552ae2f2a358308b9a5c862989d3
2018-07-23 17:49:28 -07:00
Jakub Pawlowski
8d0eb01843 Merge "ScanRecord.getServiceData NPE fix"
am: d62f74e806

Change-Id: I11a254cf633dc5cf9a7c53c992bf49b00f3d274e
2018-06-11 09:07:31 -07:00
Jakub Pawlowski
59880123d7 ScanRecord.getServiceData NPE fix
Bug: 109662587
Change-Id: I0e9653d9cd7e4b748870bacb6fbcecae535ebb2a
2018-06-11 14:43:42 +00:00
Jack He
896e129f5f Bluetooth: Fix HFP SCO logic and documentation
AudioService:
* Call setBtScoActiveDevice and setBluetoothScoOn both in AudioService's
  broadcast receiver so that these two methods must be triggerred in
  the same sequence as ACTIVE_DEVICE_CHANGED and AUDIO_STATE_CHANGED
  intents are sent and we no longer need to handle race condition by
  synchronously checking active device in setBluetoothScoOn
* Default sco audio mode when no headset is active should be virtual
  voice call, as many HFP devices do not accept SCO audio without an
  ongoing call
* Synchronize checkScoAudioState() method with mScoClients
* Add helper functions connectBluetoothScoHelper and
  disconnectBluetoothScoHelper to call various SCO setup and tear down
  methods based on sco audio mode
* Try raw, virtual call, and voice recognition mode when disconnecting
  externally started SCO
* Add new sco state SCO_STATE_DEACTIVATING to allow back to back calling
  of startBluetoothSco and stopBluetoothSco

Audio Manager:
* Modified AudioManager logic so that removed devices callback is called
  before newly added devices

BluetoothHeadset:
* Modified BluetoothHeadset so that start and stop SCO using virtual
  voice call no longer need a parameter and will use active device by
  default
* Modified documentation around various sco mangement APIs to match
  their expected behaviors

Bug: 76114959
Test: VoIP calls sanity test cases
Change-Id: Id50db88f4ff36069b0f392c81dd9d90c24cd2206
(cherry picked from commit 89f979849a)
2018-05-07 12:57:26 -07:00
android-build-team Robot
e3e55b865b Merge "Bluetooth: Fix HFP SCO logic and documentation" into pi-dev
am: 1ae21127da

Change-Id: I9b4fcac73a283aac1794e13cce464728612fd0dc
2018-05-07 12:56:06 -07:00
Jack He
89f979849a Bluetooth: Fix HFP SCO logic and documentation
AudioService:
* Call setBtScoActiveDevice and setBluetoothScoOn both in AudioService's
  broadcast receiver so that these two methods must be triggerred in
  the same sequence as ACTIVE_DEVICE_CHANGED and AUDIO_STATE_CHANGED
  intents are sent and we no longer need to handle race condition by
  synchronously checking active device in setBluetoothScoOn
* Default sco audio mode when no headset is active should be virtual
  voice call, as many HFP devices do not accept SCO audio without an
  ongoing call
* Synchronize checkScoAudioState() method with mScoClients
* Add helper functions connectBluetoothScoHelper and
  disconnectBluetoothScoHelper to call various SCO setup and tear down
  methods based on sco audio mode
* Try raw, virtual call, and voice recognition mode when disconnecting
  externally started SCO
* Add new sco state SCO_STATE_DEACTIVATING to allow back to back calling
  of startBluetoothSco and stopBluetoothSco

Audio Manager:
* Modified AudioManager logic so that removed devices callback is called
  before newly added devices

BluetoothHeadset:
* Modified BluetoothHeadset so that start and stop SCO using virtual
  voice call no longer need a parameter and will use active device by
  default
* Modified documentation around various sco mangement APIs to match
  their expected behaviors

Bug: 76114959
Test: VoIP calls sanity test cases
Change-Id: Id50db88f4ff36069b0f392c81dd9d90c24cd2206
2018-05-04 19:49:49 -07:00
Stanley Tng
c87223b718 Fix spelling errors in BluetoothGatt documentation
Correct "paramter" to "parameter". Correct "connectoin" to connection.

Bug: 79198797
Test: Compile
Change-Id: I98646eec66da2aaa6f74ae2db35ea914c6a105a1
(cherry picked from commit 505c05839b)
2018-05-04 23:20:46 +00:00
android-build-prod (mdb)
fe1ad15da1 Merge "Fix spelling errors in BluetoothGatt documentation" am: e7b05b8797
am: ea18806cb7

Change-Id: I5fcb0f3506a4e8856c2971302c98f4ba5b9ffffc
2018-05-03 15:16:49 -07:00
Stanley Tng
505c05839b Fix spelling errors in BluetoothGatt documentation
Correct "paramter" to "parameter". Correct "connectoin" to connection.

Bug: 79198797
Test: Compile
Change-Id: I98646eec66da2aaa6f74ae2db35ea914c6a105a1
2018-05-03 20:43:40 +00:00
android-build-prod (mdb)
97ca124998 Merge "Get/Set IO capability of Bluetooth device" am: d1ed784438
am: badce3de08

Change-Id: I112edc1bb98d4dea7c5d166c4858685bb0a40a00
2018-04-30 16:03:40 -07:00
android-build-team Robot
69b1fce562 Merge "Truncate newline and tab characters in BluetoothDevice name" into pi-dev 2018-04-30 18:54:34 +00:00
Pulkit Bhuwalka
979698bc2c Get/Set IO capability of Bluetooth device
Creates the hidden BluetoothAdapter APIs which can be used to
control IO capability settings on the local Bluetooth device.

Bug: 36015413
Test: Used a test activity to control getting/setting the value and
attempting pairing.

Change-Id: Ibbfdc5ae5a1d56c6e3d003ab3bf5d095dcb583e4
(cherry picked from commit 6043b7b90a27a836241bfc05e71eb46ce04c66cf)
2018-04-28 13:45:44 -07:00
Hansong Zhang
2e3bf46039 Truncate newline and tab characters in BluetoothDevice name
Test: manual
Bug: 73173182
Change-Id: I7f2201cab36adf7f01d1a794d783cb78a536811f
2018-04-26 14:22:39 -07:00
TreeHugger Robot
1c75189a0a Merge "Fix the implementation of BluetoothCodecStatus.equals()" into pi-dev 2018-04-20 02:12:09 +00:00
Pavlin Radoslavov
a291ce625a Fix the implementation of BluetoothCodecStatus.equals()
Previously, the BluetoothCodecStatus.equals() implementation
was incorrect when comparing arrays of capabilities.
In the new implementation, the arrays are compared correctly,
and also the ordering of the capabilities in each array is ignored.

Also, added unit tests for class BluetoothCodecConfig and class
BluetoothCodecStatus.

Bug: 73404858
Bug: 73379307
Test: Unit tests (in frameworks/base)
  runtest --path core/tests/bluetoothtests/src/android/bluetooth/BluetoothCodecConfigTest.java
  runtest --path core/tests/bluetoothtests/src/android/bluetooth/BluetoothCodecStatusTest.java

Change-Id: If22087465397b7c4175c33f7d1909a15d957fb24
Merged-In: If22087465397b7c4175c33f7d1909a15d957fb24
(cherry picked from commit 9d36e6babc)
2018-04-19 17:26:31 -07:00
Stanley Tng
0d5aa574d6 Cleanup documentation for LE CoC in BluetoothAdapter
Test: Compile
Bug: 77631591
Change-Id: Ic3c7f13e560534a048bf5c8b274fe62190c214c7
(cherry picked from commit dac8e14018)
2018-04-19 21:57:09 +00:00
Pavlin Radoslavov
9d36e6babc Fix the implementation of BluetoothCodecStatus.equals()
Previously, the BluetoothCodecStatus.equals() implementation
was incorrect when comparing arrays of capabilities.
In the new implementation, the arrays are compared correctly,
and also the ordering of the capabilities in each array is ignored.

Also, added unit tests for class BluetoothCodecConfig and class
BluetoothCodecStatus.

Bug: 73404858
Bug: 73379307
Test: Unit tests (in frameworks/base)
  runtest --path core/tests/bluetoothtests/src/android/bluetooth/BluetoothCodecConfigTest.java
  runtest --path core/tests/bluetoothtests/src/android/bluetooth/BluetoothCodecStatusTest.java

Change-Id: If22087465397b7c4175c33f7d1909a15d957fb24
2018-04-19 14:36:18 -07:00
Stanley Tng
d0c1b23e06 Clarify API doc for BluetoothGattServer::addService
Clarify that the caller has to wait for onServiceAdded callback before
calling BluetoothGattServer::addService again.

Bug: 72717069
Test: Compile
Change-Id: I20b031c724ba64bfd71cf10e58e587f69e4a2555
(cherry picked from commit 4b5cf48560)
2018-04-18 16:10:11 -07:00
Treehugger Robot
f493c66f39 Merge "Clarify API doc for BluetoothGattServer::addService" 2018-04-17 00:07:38 +00:00
Stanley Tng
dac8e14018 Cleanup documentation for LE CoC in BluetoothAdapter
Test: Compile
Bug: 77631591
Change-Id: Ic3c7f13e560534a048bf5c8b274fe62190c214c7
2018-04-16 22:33:31 +00:00
Stanley Tng
4b5cf48560 Clarify API doc for BluetoothGattServer::addService
Clarify that the caller has to wait for onServiceAdded callback before
calling BluetoothGattServer::addService again.

Bug: 72717069
Test: Compile
Change-Id: I20b031c724ba64bfd71cf10e58e587f69e4a2555
2018-04-16 13:12:52 -07:00
Stanley Tng
bbb35c0ba6 Add min_ce/max_ce parameters to requestLeConnectionUpdate()
Add new test parameters, min_ce and max_ce, to the SL4A tests for LE
Connection-oriented Channel (CoC) feature. This CL passes these 2
parameters to native stack.

Test: Run cmd: act.py -c $MY_SL4A_CONFIG -tc BleCoc2ConnTest
Bug: 77528723

Change-Id: I9d3d74f671772014209f8114c2d1b8ba606c54d5
(cherry picked from commit 148dd5bf86)
2018-04-12 09:00:05 -07:00
Stanley Tng
0980006a2a Merge "Add min_ce/max_ce parameters to requestLeConnectionUpdate()" 2018-04-12 14:36:12 +00:00
TreeHugger Robot
06d4cda1ac Merge changes from topic "hid-device-app-name" into pi-dev
* changes:
  Show Bluetooth HID Device connection status in Settings
  Bluetooth: Add hidden API to get current user of HID Device (1/3)
2018-04-06 22:23:39 +00:00
Treehugger Robot
d61e87ad08 Merge "Bluetooth: Add hidden API to get current user of HID Device (1/3)" 2018-04-06 21:54:06 +00:00
Hansong Zhang
3b8f09b3c5 Hearing Aid: change get/set active device (3/3)
* setActiveDevice() returns false in error case, e.g. when the device is
not connected
* add getActiveDevices() instead of isActiveDevice(), which returns a list
that must have two elements: left and right, or empty list on error

Test: manual
Bug: 69623109
Change-Id: I48f3388c56434d0c21e09bd8b794e58848cd8794
(cherry picked from commit 8d799f8340)
2018-04-04 14:54:07 -07:00