Commit Graph

1021 Commits

Author SHA1 Message Date
Jack He
266499d9d8 Support battery level reporting via Apple VSC (1/2)
* Add related constants to BluetoothHeadset

Bug: 35874078
Test: make, test with supporting headsets
Change-Id: I9f49ea28efdf6de0e751a377d879fe13a47655d5
Merged-In: I9f49ea28efdf6de0e751a377d879fe13a47655d5
(cherry picked from commit 679d0bc8f9)
2017-06-30 10:41:18 +00:00
Jack He
fff37da08d Support battery level reporting via Plantronics XEVENT (1/2)
* Add related constants to BluetoothHeadset

Bug: 35874078
Test: make, test with supporting headsets
Change-Id: Ied089a065bf9caa0d03f681950fefa2ea990bb3e
Merged-In: Ied089a065bf9caa0d03f681950fefa2ea990bb3e
(cherry picked from commit 0fcbba25b7)
2017-06-30 08:39:44 +00:00
Jack He
dfd8618b2d HFP: Modify comments for ACTION_HF_INDICATORS_VALUE_CHANGED (1/2)
* Per HFP 1.7.1 spec page 102 of 144
  EXTRA_HF_INDICATORS_IND_ID should be int
  EXTRA_HF_INDICATORS_IND_VALUE should be int

Bug: 35874078
Test: make, PTS test, unit tests
runtest -c com.android.bluetooth.btservice.RemoteDevicesTest bluetooth
Change-Id: Idd316a82bab164b6ea1701bb261b1cc3dee196f1
Merged-In: Idd316a82bab164b6ea1701bb261b1cc3dee196f1
(cherry picked from commit 73795440a5)
2017-06-30 06:22:46 +00:00
Jack He
2b07bbafa2 Add APIs to get remote device's battery level (1/2)
* Add BluetoothDevice.getBatteryLevel() API to retreive battery level
  information of remote device
* Add BluetoothDevice.ACTION_BATTERY_LEVEL_CHANGED intent to notify user
  that remote device's battery level has changed

Bug: 35874078
Test: make, pair with devices and use them
Change-Id: I41051ee25383f5f3a1e505aef6f8c526385f58bd
Merged-In: I41051ee25383f5f3a1e505aef6f8c526385f58bd
(cherry picked from commit 1d312bfa78)
2017-06-30 04:01:36 +00:00
Amith Yamasani
ef863368b4 Merge "Clarify startScan API on how to get results" into oc-dev
am: 78f3a0f722

Change-Id: Ibc04014f224ecbc666c8296a2b25d939fbfc9921
2017-06-22 13:48:51 +00:00
TreeHugger Robot
78f3a0f722 Merge "Clarify startScan API on how to get results" into oc-dev 2017-06-22 01:14:18 +00:00
Amith Yamasani
9622137f3f Clarify startScan API on how to get results
Make it clear in BluetoothLeScanner on how to get results
when starting a scan for a PendingIntent.

Bug: 38365430
Test: make offline-sdk-docs
Change-Id: I0bf88d751c89a8a478db985713357e153ac08595
2017-06-21 14:06:44 -07:00
Jakub Pawlowski
50bad313e4 Merge "Remove legacy advertiser from map after it's no longer used" into oc-dev
am: 271e0aa02a

Change-Id: I9e8645c808d1b1cbee242e8a953be93fbf71e4e1
2017-06-20 01:47:01 +00:00
Jakub Pawlowski
bfa502c6a6 Remove legacy advertiser from map after it's no longer used
Test: manual
Bug: 62597369
Change-Id: Ief1e1b054f29b59b1ed72514b138d4f209f9847a
2017-06-19 23:37:19 +00:00
Jakub Pawlowski
25278b0197 Merge "Bluetooth: fix connectGatt overload invocations" into oc-dev
am: 556b10a4e6

Change-Id: I9477ac6e3990a4e2db4a8254f11702b1557591f3
2017-06-09 00:03:31 +00:00
Jakub Pawlowski
dbf5a0a20b Bluetooth: fix connectGatt overload invocations
Merged-In: I726252e85e78bff2c9585332d2748a0d92a9f6d3
Test: sl4a GattOverBrEdrTest
Bug: 62387078
Change-Id: I5bfb87683e25f8862587e8000eb4c9bb6ff14f99
2017-06-08 21:01:24 +00:00
Jeff Sharkey
7a2e4a8486 Merge "Annotate @SystemApi with required permissions." into oc-dev
am: c1406978a4

Change-Id: I305967cad945a807c3f8234efabaad0ef8b591d1
2017-06-05 22:28:21 +00:00
Jeff Sharkey
d86b8fea43 Annotate @SystemApi with required permissions.
Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
2017-06-05 13:27:11 -06:00
Jack He
099328f38b Merge "HFP: Allow SCO audio to be forcibly connected" am: 93d7c84726 am: 10cb6f3b4c
am: 0998ec224c

Change-Id: I35533ed7e2b8f8deff741cb3296156e9ccf5e076
2017-06-01 07:15:13 +00:00
Jack He
1dd1e03f1f HFP: Allow SCO audio to be forcibly connected
* Normally, Android only allows SCO audio to be connected in several
  allowed cases (e.g. in call, in ringing, in virtual call state, etc)
* Sometimes, it is necessary to force a SCO audio connection (e.g.
  during PTS test)
* This change adds setForceScoAudio(boolean) hidden, system only method
  to allow such behaviour

Bug: 38040125
Test: PTS HFP tests
Change-Id: I28f295c98da5bebb837c2a5423c7acde81af73f7
2017-05-31 15:41:30 -07:00
Jakub Pawlowski
50f8f3db27 Add 32 and 128 bit Service Data parsing.
Bug: 62078132
Change-Id: I79ff75cd5ccbe346dca79693b074ff3cd09112dd
(cherry picked from commit 45033a7e57)
2017-05-26 16:24:40 -07:00
Jakub Pawlowski
bf79e36f57 Merge "Add 32 and 128 bit Service Data parsing." am: 725e212de3 am: 2acc8e28dd
am: 138f75bbc8

Change-Id: I8c821ed86a85892af7a77c4a8080a1e9fde9fdfa
2017-05-26 23:14:27 +00:00
Jakub Pawlowski
45033a7e57 Add 32 and 128 bit Service Data parsing.
Bug: 62078132
Change-Id: I79ff75cd5ccbe346dca79693b074ff3cd09112dd
2017-05-26 21:11:24 +00:00
Jakub Pawlowski
9fd4462c09 Merge "Discover primary service by UUID for PTS tests (4/4)" am: abb732fc40 am: 7e80b882b7
am: 23105d57d5

Change-Id: I764d8b206940a39906c6793fef24e6d5b19a8589
2017-05-16 20:55:37 +00:00
Jakub Pawlowski
09ad0b27bb Discover primary service by UUID for PTS tests (4/4)
Bug: 38123054
Test: manual
Change-Id: I89e088e60f4325f1ece59d22efda0c907a3b716a
(cherry picked from commit fe2bf16a2b)
2017-05-16 13:50:11 -07:00
Jakub Pawlowski
fe2bf16a2b Discover primary service by UUID for PTS tests (4/4)
Bug: 38123054
Test: manual
Change-Id: I89e088e60f4325f1ece59d22efda0c907a3b716a
2017-05-16 11:37:00 -07:00
Andre Eisenbach
1360c6227e Merge "Bluetooth: HID: Add support for Set Idle and Get Idle Commands (3/4)" am: 51876abe82 am: 9413fd9e1f
am: 01d1188a8b

Change-Id: Ie92cbd1f5795d7b9f55d0e51503e7d08b61e8732
2017-05-11 01:33:18 +00:00
Hemant Gupta
cef9ce368c Bluetooth: HID: Add support for Set Idle and Get Idle Commands (3/4)
Provides an interface for application to send Set Idle
and Get Idle commands to remote HID Device. Support for these
two commands was missing from existing code, so existing code
design is reused to add support for these two commands.

Without this support following mandatory PTS test cases for HID 1.0
cannot be passed, TC_HOS_HID_BV_05/06.

Test: Executed PTS tests TC_HOS_HID_BV_05/06 and confirmed if they can
pass

Bug: 34344715
Change-Id: I548362cc328498920b2dae740f1a76b2cc2d6a67
2017-05-10 16:23:17 +00:00
Jakub Pawlowski
168bffa039 Merge "Bluetooth: Fix Periodic Adv interval check" am: cb70647418 am: 5bd173cd93
am: 36e8f468c3

Change-Id: I400564e6ab3716c2906d53e90725a0c9ffc3b082
2017-05-10 07:56:02 +00:00
Sunny Kapdi
037d3513e0 Bluetooth: Fix Periodic Adv interval check
The MIN and MAX values need to be swapped else
the parameter check in setInterval would always
fail

Bug: 37579882
Change-Id: I48538c2a61be88caaf04abd94074b3d9eb6dde96
2017-05-10 07:23:06 +00:00
Jakub Pawlowski
fec6ef8e90 Bluetooth: Fix interval low/min values
Bug: 38175945
Test: none
Change-Id: Idf487c7aafc518f2c57be78a1fa979b2c4a383d6
(cherry picked from commit 6b1f39502c)
2017-05-10 01:30:31 +00:00
Andre Eisenbach
4246cc309d Merge "Bluetooth: Fix interval low/min values" am: 66deee2bd4 am: 0771cb13a2
am: 1655862b93

Change-Id: I32d56c5d0fca7947ac754eda100b36f2ee94ffe7
2017-05-10 00:15:32 +00:00
Jakub Pawlowski
6b1f39502c Bluetooth: Fix interval low/min values
Bug: 38175945
Test: none
Change-Id: Idf487c7aafc518f2c57be78a1fa979b2c4a383d6
2017-05-09 22:59:18 +00:00
Ajay Panicker
a43bd01bd1 Bluetooth: Move Bluetooth battery stats tracking (1/2)
Move Bluetooth battery stats tracking to AppScanStats for a more
unified tracking system.

Bug: 37720787
Test: cts-tradefed run cts-dev -m CtsIncidentHostTestCases -t com.android.server.cts.BatteryStatsValidationTest#testBleScans
      Perform BLE scan and check battery stats
Change-Id: Ie6c682374e6e258c291d3a11eede649c7747ef40
2017-05-09 17:52:36 +00:00
Ruben Brunk
c131051e28 Fix Bluetooth GATT API default handler assignment
Restores previous behaviour where GATT callbacks are invoked on the
binder thread and not the calling process main looper thread.

This fixes performance regressions as well as some
NetworkOnMainThreadException's for some applications.

Bug: 37544152
Bug: 37871717
Test: Covered by prior API tests.
Change-Id: Id8ab705dd4d7f00030e6ac29e056dde5180670e9
(cherry picked from commit 6bdc550e27)
2017-05-05 22:22:50 +00:00
Ajay Panicker
a71643e91c Bluetooth: Move Bluetooth battery stats tracking (1/2)
Move Bluetooth battery stats tracking to AppScanStats for a more
unified tracking system.

Bug: 37720787
Test: cts-tradefed run cts-dev -m CtsIncidentHostTestCases -t com.android.server.cts.BatteryStatsValidationTest#testBleScans
      Perform BLE scan and check battery stats
Change-Id: Ie6c682374e6e258c291d3a11eede649c7747ef40
2017-05-04 23:48:04 +00:00
Ajay Panicker
4d1fb218f4 Merge "Limit btsnoop file size (3/9)" into oc-dev 2017-05-04 22:56:21 +00:00
Ajay Panicker
4d71437598 Limit btsnoop file size (3/9)
Limit btsnoop file size by rotating between snoop files. The rotation occurrs
when a fixed number of packets have been logged and will start overwriting
the older file.

Bug: 35998031
Test: Enable snoop logs from developer options and let logs get large
Change-Id: I40d5da4c1b1c9b45908e5790d130f1c5e804c773
2017-05-04 09:56:50 -07:00
TreeHugger Robot
d53a71f443 Merge "Add persistent state for Bluetooth high quality audio support" into oc-dev 2017-05-04 01:37:07 +00:00
Antony Sargent
f5772c6121 Add persistent state for Bluetooth high quality audio support
Defines the flags used in code and the Settings.Global key names for
persisting the following state for Bluetooth A2DP Sink devices:
-Whether the device supports optional codecs or not
-Whether optional codecs should be turned on for the device

For each of these two properties we model the state in the code as
yes/no/unknown, so that we can tailor the UI and behavior
accordingly.

Bug=37441685
Test: manually

Change-Id: I6bcd02fd7c95bef989575f3b13d4788dab61971a
2017-05-03 04:36:51 +00:00
Ruben Brunk
6bdc550e27 Fix Bluetooth GATT API default handler assignment
Restores previous behaviour where GATT callbacks are invoked on the
binder thread and not the calling process main looper thread.

This fixes performance regressions as well as some
NetworkOnMainThreadException's for some applications.

Bug: 37544152
Bug: 37871717
Test: Covered by prior API tests.
Change-Id: Id8ab705dd4d7f00030e6ac29e056dde5180670e9
2017-05-03 00:11:10 +00:00
Jakub Pawlowski
17100948f9 Bluetooth: bluetooth.le API fixes
Fix minor spelling problems.
Throw IllegalStateException instead of IllegalArgumentException in
build().

Bug: 37532634
Test: none
Change-Id: I73b6f04aec98f5baffb06a363e2a3f71e8cec3c4
(cherry picked from commit 9d4abb5631)
2017-04-28 21:51:53 +00:00
Jakub Pawlowski
9d4abb5631 Bluetooth: bluetooth.le API fixes
Fix minor spelling problems.
Throw IllegalStateException instead of IllegalArgumentException in
build().

Bug: 37532634
Test: none
Change-Id: I73b6f04aec98f5baffb06a363e2a3f71e8cec3c4
2017-04-28 21:35:53 +00:00
Jakub Pawlowski
56d8f786a5 Bluetooth: Add constants to ScanResult
Add TX_POWER_NOT_PRESENT and PERIODIC_INTERVAL_NOT_PRESENT

Test: none
Bug: 37536707
Change-Id: Ia48a30f44a961c6e0babd17ecaed0eb93c98ecad
(cherry-picked from commit c7c01a2877)
2017-04-27 22:22:36 +00:00
Jakub Pawlowski
c7c01a2877 Bluetooth: Add constants to ScanResult
Add TX_POWER_NOT_PRESENT and PERIODIC_INTERVAL_NOT_PRESENT

Test: none
Bug: 37536707
Change-Id: Ia48a30f44a961c6e0babd17ecaed0eb93c98ecad
2017-04-27 21:03:46 +00:00
Jakub Pawlowski
0e0e75793d Fix NPE when accessing mCallback in BluetoothGatt
This issue was introduced in commit
4eab49652e.

Bug: 37710354
Test: none
Change-Id: I2d985ce97c44d4e096713e156e57437f44ea3ddb
(cherry picked from commit 0e4ac75f2e)
2017-04-27 13:16:32 -07:00
Jakub Pawlowski
348ba3da78 Expose LE advertiser address for easier PTS tests (1/6)
This patchset adds a hidden method getOwnAddress, that lets app with
BLUETOOTH_PRIVILEGED permission to lear their own addreess. This is done
exclusively for PTS tests.

Bug: 35147497
Test: manual
Change-Id: Iaf0f2fe0613de44b8430ac25e691d66a4ad44f8d
(cherry picked from commit 4bc4a44100)
2017-04-27 13:15:58 -07:00
Jakub Pawlowski
ce21cb903c Read by UUID for PTS tests (1/5)
Add a hidden api for reading characteristic by UUID for PTS.

Bug: 35150313
Test: sl4a GattReadTest.byUuid
Change-Id: Ice4076d99e4694d20374ba0fdcae74d5ae841147
(cherry picked from commit de74891d1c)
2017-04-27 13:15:43 -07:00
Jakub Pawlowski
0e4ac75f2e Fix NPE when accessing mCallback in BluetoothGatt
This issue was introduced in commit
4eab49652e.

Bug: 37710354
Test: none
Change-Id: I2d985ce97c44d4e096713e156e57437f44ea3ddb
2017-04-27 19:37:35 +00:00
Ajay Panicker
37cad12cb1 Merge "Limit btsnoop file size (3/8)" 2017-04-27 17:29:37 +00:00
Ajay Panicker
731a26666d Limit btsnoop file size (3/8)
Limit btsnoop file size by rotating between snoop files. The rotation occurrs
when a fixed number of packets have been logged and will start overwriting
the older file.

Bug: 35998031
Test: Enable snoop logs from developer options and let logs get large
Merged-In: I40d5da4c1b1c9b45908e5790d130f1c5e804c773
Change-Id: I40d5da4c1b1c9b45908e5790d130f1c5e804c773
2017-04-27 00:05:31 +00:00
Jakub Pawlowski
91fe3080e7 Bluetooth: expand comments on new PHY constants
Bug: 37544152
Test: the all-knowing eyes of the reviewers
Change-Id: I8f5a756a204fe90960700e1dc42f64824d3b844a
(cherry picked from commit 60c7dac775)
2017-04-25 13:00:52 -07:00
Jakub Pawlowski
e7c6e6ae1f Bluetooth: document status value in PHY read/update
Bug: 37544152
Test: none
Change-Id: I2bac468f833c73cd282b1dac80b6553917996604
(cherry picked from commit e55c446977)
2017-04-25 13:00:43 -07:00
Jakub Pawlowski
b0f647492f Bluetooth: Add handler parameter to connectGatt
Bug: 37544152
Test: sl4a GattReadTest GattWriteTest
Change-Id: I043dfefaafe9f3700418f2c855c52aac3644310f
(cherry picked from commit 4eab49652e)
2017-04-25 13:00:36 -07:00
Jakub Pawlowski
d2ac8b94e7 Get rid of the IAdvertiserCallabck
Bug: 30622771
Test: none
Change-Id: I2c55f96e71cd3be67f88201ab07c91730cd85971
(cherry picked from commit 89e10d3eb4)
2017-04-25 13:00:25 -07:00