Commit Graph

1212 Commits

Author SHA1 Message Date
Stanley Tng
1f3b464471 Merge "Add function to update LE connection parameters" am: 853628db72 am: c3afcfc38c
am: a4c600cb03

Change-Id: I3bbb6c7a0f51d17690c3ae47a228758a45c155ee
2018-02-04 01:20:48 +00:00
Stanley Tng
a4c600cb03 Merge "Add function to update LE connection parameters" am: 853628db72
am: c3afcfc38c

Change-Id: Ib35d2c5314dcf6d12abf4d097b10dfc5df34bb55
2018-02-03 04:21:58 +00:00
Jeff Sharkey
ad357d1839 Pass in the user defined by Context.
The majority of Manager-style classes already use Context.getUserId()
when making calls into the OS, so clean up the remaining callers to
unify behind this strategy.

This gives @SystemApi developers a nice clean interface to interact
across user boundaries, instead of manually adding "AsUser" or
"ForUser" method variants, which would quickly become unsustainable.

Test: builds, boots
Bug: 72863821
Exempt-From-Owner-Approval: trivial changes
Change-Id: Ib772ec4438e57a2ad4950821b9432f9842998451
2018-02-03 02:11:45 +00:00
Stanley Tng
6da1ddaa53 Add function to update LE connection parameters
As part of new SL4A tests for LE CoC to measure data throughput
performance, this commit will add a function to enable the CoC Facade
to modify the LE Connection Parameters especially the Connection
Intervals.

Test: Ran the new ACTS Tests for LE CoC
Bug: 70683224
Change-Id: Ie071b09a44d68fe063198a39eb788c434b092442
2018-02-01 15:27:14 -08:00
Ricardo Loo Foronda
8e2af19744 Merge "docs: Added a missing "be" in ACTION_CONNECTION_STATE_CHANGED" into oc-mr1-dev am: 1299d4b0a9
am: d5a62bebc3

Change-Id: Ie138a98a87f9f4fb895d2b9f834d43ac04866b86
2018-01-29 02:47:50 +00:00
Ricardo Loo Foronda
d5a62bebc3 Merge "docs: Added a missing "be" in ACTION_CONNECTION_STATE_CHANGED" into oc-mr1-dev
am: 1299d4b0a9

Change-Id: Ib2911651950048305b00df5f26ca5656e205bcee
2018-01-29 02:39:30 +00:00
Pavlin Radoslavov
bc2e4a230b Merge "Add support for Multi-A2DP state machines per device" am: bb5318df8a
am: adf2239562

Change-Id: Ibe372b2ecda317e7970d6e681a4e2330e69782c1
2018-01-27 00:01:20 +00:00
Pavlin Radoslavov
080a0e781c Add support for Multi-A2DP state machines per device
* Update usage of A2dpService API calls that take BluetoothDevice
  as an additional argument
* Update the description for BluetoothA2dp.connect()

Exempt-From-Owner-Approval: De-facto owner of the relevant changes is
the Bluetooth team.
Bug: 69269748
Test: Manual
Change-Id: I190ed48ef65bbc8b88b45f84ebd6ab3d21cf0b4e
Merged-In: I190ed48ef65bbc8b88b45f84ebd6ab3d21cf0b4e
(cherry picked from commit 502af2192c)
2018-01-26 13:08:00 -08:00
Ricardo Loo Foronda
f710a2307a docs: Added a missing "be" in ACTION_CONNECTION_STATE_CHANGED
Status: Ready for writer review.
Note: This is a javadoc only change.

Test: Build the docs with "make ds-docs" and staged updated content.
Staged content:
go/dac-stage/reference/android/bluetooth/BluetoothAdapter.html#ACTION_CONNECTION_STATE_CHANGED

Bug: 69097875
Change-Id: Ibffea2373ded825558beaa669ae4daf3c0ff3d2f
2018-01-26 18:16:05 +00:00
Pavlin Radoslavov
502af2192c Add support for Multi-A2DP state machines per device
* Update usage of A2dpService API calls that take BluetoothDevice
  as an additional argument
* Update the description for BluetoothA2dp.connect()

Exempt-From-Owner-Approval: De-facto owner of the relevant changes is
the Bluetooth team.
Bug: 69269748
Test: Manual
Change-Id: I190ed48ef65bbc8b88b45f84ebd6ab3d21cf0b4e
2018-01-25 11:05:25 +00:00
Stanley Tng
518c679c1f Merge "Added APIs for Connection-oriented channels" am: e1992384e0 am: 288915bedc
am: 39f133eed2

Change-Id: I79afa5ef129790588dca91266f79a6125edefd06
2018-01-18 18:19:25 +00:00
Stanley Tng
39f133eed2 Merge "Added APIs for Connection-oriented channels" am: e1992384e0
am: 288915bedc

Change-Id: Iaf2aa40e8e6e2621c146fcabe0f46c3dd1bfedc4
2018-01-18 18:08:37 +00:00
Treehugger Robot
e1992384e0 Merge "Added APIs for Connection-oriented channels" 2018-01-18 16:42:33 +00:00
Pavlin Radoslavov
fd77635da1 Merge "Added internal API getMaxConnectedAudioDevices()" am: 877cbe1dc2 am: 18606e1601
am: 9114a49770

Change-Id: I55d0175bb715dbd28176032ace129a2c85a218f0
2018-01-18 02:25:31 +00:00
Pavlin Radoslavov
9114a49770 Merge "Added internal API getMaxConnectedAudioDevices()" am: 877cbe1dc2
am: 18606e1601

Change-Id: I58199a6c70bfa03fc515c573b936c78ec34d61ac
2018-01-18 02:18:03 +00:00
Joseph Pirozzo
a246885905 Merge "Bluetooth in band ring" am: dbfaf31357 am: 8c73ee91f5
am: 2746e9ab16

Change-Id: I2d43475d33c764b2b0951f7e4ddc969e8fce7c49
2018-01-18 01:19:19 +00:00
Joseph Pirozzo
2746e9ab16 Merge "Bluetooth in band ring" am: dbfaf31357
am: 8c73ee91f5

Change-Id: I1972da1da7bc0c001dc4525858bdb0e8bd5dd530
2018-01-18 01:09:30 +00:00
Treehugger Robot
877cbe1dc2 Merge "Added internal API getMaxConnectedAudioDevices()" 2018-01-18 00:46:57 +00:00
Pavlin Radoslavov
a513792e9e Added internal API getMaxConnectedAudioDevices()
The API can be used to obtain the maximum number of connected
devices for A2DP or HFP.

Test: Manual
Bug: 64767509
Change-Id: I80b8a1c85e33ae0b23fdc4812f8991a4202d9abc
2018-01-17 02:09:53 -08:00
Stanley Tng
e48468d8be Added APIs for Connection-oriented channels
Experimental and hidden APIs are defined for the Connection-oriented Channel
(CoC) features. The APIs using PSM are implemented.

Test: Can compile
Bug: 70683224
Change-Id: Icdb5fa190b0e21881a60437fa48cd575371ee1e4
2018-01-12 07:26:14 -08:00
Selim Gurun
d40d57562c Merge "Make Bluetooth constants used by gmscore a system api" am: ff9bc3a88c am: 6dc20d40fd
am: 54087cb8cb

Change-Id: I1a733b7f2567ff7821436d2c331a0a0cd8276e91
2018-01-11 23:16:04 +00:00
Selim Gurun
54087cb8cb Merge "Make Bluetooth constants used by gmscore a system api" am: ff9bc3a88c
am: 6dc20d40fd

Change-Id: Ic7d15fe855d7e3e6b3c9444e0641e2e141181154
2018-01-11 23:02:45 +00:00
Joseph Pirozzo
843d380cf1 Bluetooth in band ring
Add a flag to the BluetoothHeadsetClientCall indicating the current
status of in band ring on the connected phone.

Bug: 65673832
Test: runtest bluetooth -c
com.android.bluetooth.hfpclient.HeadsetClientStateMachineTest

Change-Id: I7e839f2790b1a27d336528e93bc8a4c8d8ff3036
(cherry picked from commit f780364a9a1f6171860cbdf4e1b41a01ee7d88c6)
2018-01-11 14:09:25 -08:00
Treehugger Robot
ff9bc3a88c Merge "Make Bluetooth constants used by gmscore a system api" 2018-01-11 20:22:05 +00:00
Jack He
570c270d7b Merge "HFP: Add isInbandRingingEnabled() API (1/4)" am: b1065d6995 am: 8dbfc24e5f
am: 96a01775ac

Change-Id: I3a6d80fcc6c510ceec1b4f1411344cf644093677
2018-01-10 00:36:06 +00:00
Jack He
96a01775ac Merge "HFP: Add isInbandRingingEnabled() API (1/4)" am: b1065d6995
am: 8dbfc24e5f

Change-Id: I52fce02e6a0169dff418f4dae89ae54de7fd952d
2018-01-10 00:26:33 +00:00
Selim Gurun
17a26c715f Make Bluetooth constants used by gmscore a system api
These constants are used by GMSCore car module via reflection. Make
them system API.

Bug: 67052734
Test: Manual - and using make update-api
Change-Id: I0709c0e0eb9fcb9fb29d575e9b74927a70b2a924
2018-01-09 16:04:12 -08:00
Jack He
bc9976e749 HFP: Add isInbandRingingEnabled() API (1/4)
* Use BluetoothHeadset.isInbandRingingEnabled() API to check whether
  in-band ringing is currently enabled in the system when deciding on
  audio routes for ringtone
* Add this as a hidden internal API for system components

Bug: 71646213
Test: make, toggle in-band ringing from Development Settings and observe
      whether Telecom service tries to open SCO when there is an
      incoming call

Change-Id: I1ef0dd2b54ace7649ddd1f043f0ef5847743a5c4
2018-01-09 15:17:34 -08:00
Myles Watson
efd3bab0c2 Merge "BluetoothProfile: Add Object Push Profile (OPP)" am: 37275780c0 am: 152b4f28b0
am: 96f4e49339

Change-Id: Ie321dd5d94bbc827d88855b634bc6a538d432918
2018-01-09 22:34:23 +00:00
Myles Watson
96f4e49339 Merge "BluetoothProfile: Add Object Push Profile (OPP)" am: 37275780c0
am: 152b4f28b0

Change-Id: I765260e8358d6c7f34a72b5f3ef4601579aebf03
2018-01-09 22:26:57 +00:00
Myles Watson
fa792b97a5 BluetoothProfile: Add Object Push Profile (OPP)
Test: toggle Bluetooth
Change-Id: I5aec940ba3d6c6364c2de667426d98d0b3cea0c6
2018-01-09 00:13:03 +00:00
Jack He
985cdcb88a HFP: Add APIs for set and get active device (1/3)
1. Call BluetoothHeadset.setActiveDevice(BluetoothDevice device) to set
   a connected HFP/HSP device as active.
2. Listen for BluetoothHeadset.ACTION_ACTIVE_DEVICE_CHANGED intent
   that will contain the latest active device (in EXTRA_DEVICE field).
   If the active device could not be changed, the EXTRA_DEVICE
   field could be null.
3. If setActiveDevice() is NOT in-progress, BluetoothA2dp.getActiveDevice()
   can be used. If setActiveDevice() is in-progress, the result is undefined.
4. BluetoothHeadset.setActiveDevice() could be called by some other parts of
   the system, so interested parties should always listen for
   BluetoothHeadset.ACTION_ACTIVE_DEVICE_CHANGED intents and prepared
   for active device updates.

Bug: 68951996
Test: manual
Change-Id: I22ca639a04fed7bf17df59c405ddeda90dafb8ff
(cherry picked from commit 05f4bc4074)
2018-01-08 23:37:10 +00:00
Jack He
b1ebd51c01 Merge changes from topics "bt-hfp-add-set-active-device-method", "bt-system-api-annotations" am: 25259faa27
am: d16d93361b

Change-Id: I525cbc81c450afafd3fcedaf7b1b5e4b17a4162a
2018-01-08 21:13:52 +00:00
Pavlin Radoslavov
af82f64f85 Merge "Added internal API to get/set the A2DP Active Device" am: 6efee9c079 am: e3428dae04
am: fe73dd0542

Change-Id: Ibf2e9fb0a5939f45a9d21bc06b26ef719ff9c58f
2018-01-08 21:11:35 +00:00
Pavlin Radoslavov
fe73dd0542 Merge "Added internal API to get/set the A2DP Active Device" am: 6efee9c079
am: e3428dae04

Change-Id: If220447db71398cc305eb7a702896e21959110c8
2018-01-08 21:02:01 +00:00
Jack He
05f4bc4074 HFP: Add APIs for set and get active device (1/3)
1. Call BluetoothHeadset.setActiveDevice(BluetoothDevice device) to set
   a connected HFP/HSP device as active.
2. Listen for BluetoothHeadset.ACTION_ACTIVE_DEVICE_CHANGED intent
   that will contain the latest active device (in EXTRA_DEVICE field).
   If the active device could not be changed, the EXTRA_DEVICE
   field could be null.
3. If setActiveDevice() is NOT in-progress, BluetoothA2dp.getActiveDevice()
   can be used. If setActiveDevice() is in-progress, the result is undefined.
4. BluetoothHeadset.setActiveDevice() could be called by some other parts of
   the system, so interested parties should always listen for
   BluetoothHeadset.ACTION_ACTIVE_DEVICE_CHANGED intents and prepared
   for active device updates.

Bug: 68951996
Test: manual
Change-Id: I22ca639a04fed7bf17df59c405ddeda90dafb8ff
2018-01-05 14:51:40 -08:00
Selim Gurun
4029fa6039 Add SystemApis annotations
There are some number of places where bluetooth APIs are used via
reflection from GMSCore. Add proper annotations.

Bug: 67052734
Test: Manual - and using make update-api
Change-Id: Ib6e3aa1ff5b6f9cdc78367f9be13ed00542d6f65
(cherry picked from commit 64bd35ef2c)
2018-01-05 14:50:30 -08:00
Pavlin Radoslavov
64a9435cc7 Added internal API to get/set the A2DP Active Device
1. Call BluetoothA2dp.setActiveDevice(BluetoothDevice device) to set
   a connected A2DP device as active.
   The value of "device" could be null to clear the active device
   and stop streaming audio to a Bluetooth device.
2. Listen for BluetoothA2dp.ACTION_ACTIVE_DEVICE_CHANGED intent
   that will contain the latest active device (in EXTRA_DEVICE field).
   If the active device could not be changed, the EXTRA_DEVICE
   field could be null.
3. If setActiveDevice() is NOT in-progress, BluetoothA2dp.getActiveDevice()
   can be used. If setActiveDevice() is in-progress, the result is undefined.
4. BluetoothA2dp.setActiveDevice() could be called by some other parts of
   the system, so interested parties should always listen for
   BluetoothA2dp.ACTION_ACTIVE_DEVICE_CHANGED intents and prepared
   for active device updates.

Bug: 71555243
Test: Manual
Change-Id: I661b6882e8e6b437db50210aec1dd12a10199969
2018-01-05 21:44:59 +00:00
Narayan Kamath
728c8a0874 BatteryStats: Add WorkChain support for WiFi events.
The changes are straightforward, the only change outside of BatteryStats
is to use the new WorkSource.isEmpty API to account for WorkChains in a
given WorkSource.

Bug: 62390666
Test: BatteryStatsBackgroundStatsTest, BatteryStatsNoteTest, WifiLockManagerTest
Change-Id: I1dff43b6f2a09877e3af4442bfe8a8fd80b1ba74
2018-01-04 14:18:22 +00:00
Hansong Zhang
f3caa4dc5a Merge "BluetoothHidDevice: rename onIntrData to onInterruptData (1/5)" am: 045fdae1b3
am: d6c2722094

Change-Id: I7ef265d36f4a42e7e9a74e63e8b343b28b63c8b3
2017-12-21 22:31:53 +00:00
Hansong Zhang
b06bb2186a BluetoothHidDevice: rename onIntrData to onInterruptData (1/5)
Bug: 63384609
Test: make
Merged-In: I3b55f7383d2a84162d681ebf3740ddc9e8a55bbb
Change-Id: I3b55f7383d2a84162d681ebf3740ddc9e8a55bbb
(cherry picked from commit 42324278bf)
2017-12-20 11:10:53 -08:00
Hansong Zhang
42324278bf BluetoothHidDevice: rename onIntrData to onInterruptData (1/5)
Bug: 63384609
Test: make
Change-Id: I3b55f7383d2a84162d681ebf3740ddc9e8a55bbb
2017-12-19 10:29:42 -08:00
Hansong Zhang
cab953250f Merge "Publish Bluetooth HID Device Profile Service API" am: fbd4ea125f
am: 6047c90e9b

Change-Id: Icd57d9a0d70bd4bc0dfe1396335254ccef9528b4
2017-12-18 18:06:19 +00:00
Hansong Zhang
88f3891d1e Publish Bluetooth HID Device Profile Service API
Enable the BluetoothHidDevice API in framework.

Bug: 63384609
Test: SL4A HID test; test with apps using BluetoothHidDevice
Merged-In: I52ca4674f11179f865bdff22e0289dfe893c40f5
Change-Id: I52ca4674f11179f865bdff22e0289dfe893c40f5
(cherry picked from commit 7bb587d72b)
2017-12-15 16:12:00 -08:00
Hansong Zhang
e67de60fc0 Merge "Publish Bluetooth HID Device Profile Service API" 2017-12-15 19:26:11 +00:00
Hansong Zhang
7bb587d72b Publish Bluetooth HID Device Profile Service API
Enable the BluetoothHidDevice API in framework.

Bug: 63384609
Test: SL4A HID test; test with apps using BluetoothHidDevice
Change-Id: I52ca4674f11179f865bdff22e0289dfe893c40f5
2017-12-14 20:06:12 -08:00
Jeff Sharkey
ce8db99114 Add more IntDef prefixes for auto-documenting.
Test: builds, boots
Bug: 70177949
Exempt-From-Owner-Approval: annotation-only changes
Change-Id: I76dde6054e06f52240bd4b1a0f196dcb74623608
2017-12-13 20:05:36 -07:00
Jack He
acfab62830 Merge "Bluetooth: Add convenience method to convert connection state to string" am: f7a69aeeab am: c57c5a9ba4
am: 061bc75d49

Change-Id: I6d8d75fdc686eebda4e0308168b956e1014b02d4
2017-12-13 01:08:26 +00:00
Jack He
061bc75d49 Merge "Bluetooth: Add convenience method to convert connection state to string" am: f7a69aeeab
am: c57c5a9ba4

Change-Id: Id9b238bb2493455650351d595e4c7d2dd5005f2e
2017-12-13 00:45:58 +00:00
Treehugger Robot
f7a69aeeab Merge "Bluetooth: Add convenience method to convert connection state to string" 2017-12-12 22:41:13 +00:00