Commit Graph

1191 Commits

Author SHA1 Message Date
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
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
Hansong Zhang
57365515d5 Merge "Make BluetoothPbap implement BluetoothProfile (1/3)" am: 5b6b73800c am: 64d81fbf33
am: 9c6044771f

Change-Id: I0390d33d0d56b29e3632a4fe78106fcae4fcfb32
2017-12-12 19:35:42 +00:00
Hansong Zhang
9c6044771f Merge "Make BluetoothPbap implement BluetoothProfile (1/3)" am: 5b6b73800c
am: 64d81fbf33

Change-Id: I1be05324ec0134c801de08e0f60139c341261f33
2017-12-12 19:22:12 +00:00
Hansong Zhang
fef6d81156 Make BluetoothPbap implement BluetoothProfile (1/3)
* BluetoothPbap will implement BluetoothProfile to be consistent with
other profiles
* Changed the method names to match the BluetoothProfile method
signatures
* Removed doesClassMatchSink() as it is never used
* Disable default DEBUG logs

Test: test with carkits
Bug: 69417672
Change-Id: I0766188f77468808d7505780c781f5fd8608af60
2017-12-11 13:36:45 -08:00
Jack He
5252b97d6c Bluetooth: Add convenience method to convert connection state to string
* Add method to convert the following state values to string
  - BluetoothHeadset.STATE_DISCONNECTED
  - BluetoothHeadset.STATE_CONNECTING
  - BluetoothHeadset.STATE_CONNECTED
  - BluetoothHeadset.STATE_DISCONNECTING

Test: make
Change-Id: Iaa5b6e35d3214ded8edbe29d626e0869651417d1
2017-12-11 13:18:13 -08:00
Jakub Pawlowski
4609285e29 Fix bad type for txPower in PeriodicAdvertisingReport serialization
Bug: 69634768
Test: compilation
Change-Id: Icedfbaf1ba933637e935ada0fd98aea42c73f2b2
2017-12-08 18:19:29 +00:00
Jack He
deb9bd0544 Merge "BT: Remove dead code in BluetoothHeadset" am: ea7363402c am: 38ae4d2fce
am: aa9829a85a

Change-Id: I451ab8e379cc73b0c592920478e5d5a5761be795
2017-12-08 04:03:52 +00:00
Hansong Zhang
003945515c Merge "Bluetooth HID Device: format code, fix docstring, hide unplug()" am: 0d3990b235 am: c2205a8d3d
am: 3c84b37f80

Change-Id: I31ca6fb738fc840fc27e834e9c90dda7bb7d3a12
2017-12-08 02:51:25 +00:00
Jack He
aa9829a85a Merge "BT: Remove dead code in BluetoothHeadset" am: ea7363402c
am: 38ae4d2fce

Change-Id: I93ba53e4cf31e6dfc6e98d70cd73a93ec930ccb1
2017-12-08 01:48:22 +00:00
Treehugger Robot
ea7363402c Merge "BT: Remove dead code in BluetoothHeadset" 2017-12-08 01:14:59 +00:00
Hansong Zhang
3c84b37f80 Merge "Bluetooth HID Device: format code, fix docstring, hide unplug()" am: 0d3990b235
am: c2205a8d3d

Change-Id: I0ad13d152f7dbe4e9f776f831287981f6facd84f
2017-12-07 22:11:27 +00:00
Treehugger Robot
0d3990b235 Merge "Bluetooth HID Device: format code, fix docstring, hide unplug()" 2017-12-07 21:37:45 +00:00
Jack He
887e2a1e14 BT: Remove dead code in BluetoothHeadset
The following hidden API methods are not implemented by the stack and
should be removed:
 - getBatteryUsageHint()
 - acceptIncomingConnect()
 - rejectIncomingConnect()

The following hidden API methods are no longer needed due to lack of
usage and should be removed:
 - enableWBS()
 - disableWBS()
 - bindResponse()

Bug: 70336991
Test: make
Change-Id: I75bd6735573e4cbc61b5bef8722b8badac2e9170
2017-12-07 12:06:21 -08:00
Myles Watson
6f16cfb4b2 Merge "Auto-format BluetoothAdapter.java" am: 5416559d1c am: 03e1dfa444
am: 158eae223d

Change-Id: I4f703af6fbffde4287555db1eb2b03e857a50008
2017-12-07 05:07:50 +00:00
Hansong Zhang
53f5412beb Bluetooth HID Device: format code, fix docstring, hide unplug()
* Reformat code with google-java-format
* Add the note that When an application is registered, the HID Host service
will be disabled until it is unregistered
* Fix the links in docstring
* Add @hide to unplug(); this is not a public API

Bug: 63384609
Test: make
Change-Id: I5dfcaab58b02c19e5745461c16602064a0ad8b83
2017-12-06 16:34:15 -08:00
Xin Li
5364be50cd DO NOT MERGE: Merge Oreo MR1 into master
Exempt-From-Owner-Approval: Changes already landed internally
Change-Id: I727a014df2fb05a4b13cb67b1fcb760a8b387523
2017-12-06 14:24:49 -08:00
Hansong Zhang
739c7bb9cb Merge "Bluetooth HID Device: Remove BluetoothHidDeviceAppConfiguration (2/4)" am: 8ab47567b2
am: bee508cb6d

Change-Id: Ie9aad08a93924655fee5b7f3c7abd77781985ad7
2017-12-06 20:50:07 +00:00
Hansong Zhang
bee508cb6d Merge "Bluetooth HID Device: Remove BluetoothHidDeviceAppConfiguration (2/4)"
am: 8ab47567b2

Change-Id: I9ea9a2d7bd5a81816fb652b643f345459bc2fdc5
2017-12-06 20:33:29 +00:00
Myles Watson
158eae223d Merge "Auto-format BluetoothAdapter.java" am: 5416559d1c
am: 03e1dfa444

Change-Id: I03f20ed4511ffd2d5bfa55e57d8895635e9ab165
2017-12-06 20:22:01 +00:00
Myles Watson
03e1dfa444 Merge "Auto-format BluetoothAdapter.java"
am: 5416559d1c

Change-Id: Ib5aa26901a97702fb4714dd89f24a112af59895b
2017-12-06 20:04:07 +00:00
Treehugger Robot
8ab47567b2 Merge "Bluetooth HID Device: Remove BluetoothHidDeviceAppConfiguration (2/4)" 2017-12-06 19:34:22 +00:00
Myles Watson
125b5456f1 Auto-format BluetoothAdapter.java
Test: build
Change-Id: I7bfc729373a24cceee05e443195640ff7f6d43b9
2017-12-06 16:42:23 +00:00