Commit Graph

1314 Commits

Author SHA1 Message Date
Jovana Knezevic
6194930dae Merge "Makes bluetooth profile services bind to current (foreground) user." 2018-10-19 19:47:15 +00:00
Ajay Panicker
a42f058908 Merge "Synchronize on a static final object to lock mDeviceBusy" am: 34f9a3e9e9 am: 56d37b7c43
am: 9020cf9a48

Change-Id: Ia12ca64ff5acca55182bac2fb8bae2523c7fc06a
2018-10-18 23:44:18 -07:00
Ajay Panicker
9020cf9a48 Merge "Synchronize on a static final object to lock mDeviceBusy" am: 34f9a3e9e9
am: 56d37b7c43

Change-Id: Ic53518b0e62803bb68b60ed318d6a0825b192164
2018-10-18 23:34:44 -07:00
Ajay Panicker
6c96b70195 Synchronize on a static final object to lock mDeviceBusy
Synchronizing on a field doesn't lock the object in a predictable way.

Bug: 63389270
Test: Compile
Change-Id: Idd3111bc94d32bc4bb320a5c25da37fe68276337
2018-10-17 18:20:51 +00:00
jovanak
2a9131f768 Makes bluetooth profile services bind to current (foreground) user.
If profile services are created from a singleton process
(like SystemUI), they need to be re-bind to a new foreground user
when we switch to a secondary user.
This is achieved by binding to UserHandle.CURRENT_OR_SELF.

If the process doesn't have adequate permissions to bind to current,
it will bind to self (which is the same as the previous behavior).

Change-Id: Ib1134a1a62887d6f5b2c97301dccd3223ade9ed2
Fixes: 117517812
Test: ran the existing core bluetooth tests; manual testing on a mojave, verifying that the service correctly rebinds from sys ui after user switch.
2018-10-15 17:50:19 -07:00
Jack He
7ccf46bed5 Merge "Remove BluetoothDevice.ACTION_DISAPPEARED" am: 2ac8c8a3e2 am: 24591d2641
am: 94405bb133

Change-Id: Ie2dd54ebdd4cd71ca89d263ec738f6c4a90cfac7
2018-10-12 11:32:41 -07:00
Jack He
94405bb133 Merge "Remove BluetoothDevice.ACTION_DISAPPEARED" am: 2ac8c8a3e2
am: 24591d2641

Change-Id: Idc687ad7ea25b793f5ef12612e161e197d87679d
2018-10-12 11:18:09 -07:00
Nan Zhang
248b8391ca Merge "Fix the incorrect javadoc links" into pi-dev-plus-aosp
am: 83fb35ad23

Change-Id: I48248b92a2c9f3214c88c3045f67e153f21c826f
2018-10-11 20:13:39 -07:00
Nan Zhang
55581d99b5 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
2018-10-11 17:54:36 -07:00
Jack He
097a89513e Remove BluetoothDevice.ACTION_DISAPPEARED
This intent was never sent by the Bluetooth stack

Fixes: 112115770
Test: make
Change-Id: Iaf71aeafa21f44ec9b59c1b766c936ab7dde39f1
2018-10-11 21:06:29 +00:00
kopriva
b0353c56e0 docs: fixing errors found with lint checker am: 219f7dcb66
am: 003587b9a4

Change-Id: I056261f069ed679ed8a03bfc0791bfe59a405361
2018-10-10 19:41:15 -07:00
kopriva
003587b9a4 docs: fixing errors found with lint checker
am: 219f7dcb66

Change-Id: Id38a4b2e21285d5d5e2a2124d76885febd3441c6
2018-10-09 18:30:57 -07:00
kopriva
219f7dcb66 docs: fixing errors found with lint checker
through /bluetooth directory

amending through /content directory

Test: make ds-docs

Bug: 117494359

Change-Id: I751e15d60f0b9cc441998b27560050bf62994fef
Exempt-From-Owner-Approval: Docs-only change
2018-10-09 16:01:04 -07:00
Andrew Solovay
d10e384d6c resolve merge conflicts of a3e34fe9fe to pi-dev-plus-aosp
Bug: None
Test: Eyeballed (comment-only change).
Change-Id: Ia644cde66376b2bddeb27bb2a147b3266037aa2c
Exempt-From-Owner-Approval: Docs-only change
Merged-In: Ia06e1fffd814671289a1caebd5962aedc18a28d7
2018-10-04 22:50:39 +00:00
Andrew Solovay
a44f2c075b docs: Replacing {#link with {@link
Several java files had the typo {#link (for cross-references to other
Javadocs) instead of the proper {@link format. This was confusing the
new doc publish tool (Mivi) since that's the format used for {# Django
comments #}.

Fixed a couple of links that had other errors (which prevented building
once the {# -> {@ was done) and other typos.

Replaced throughout the frameworks/base project; I'll need a separate CL
for the AndroidX fixes.

Staged to:

go/dac-stage/reference/android/app/Instrumentation.html
go/dac-stage/reference/android/bluetooth/BluetoothAdapter.html
go/dac-stage/reference/android/bluetooth/BluetoothDevice.html
go/dac-stage/reference/android/bluetooth/BluetoothServerSocket.html
go/dac-stage/reference/android/inputmethodservice/InputMethodService.html
go/dac-stage/reference/android/view/KeyCharacterMap.html
go/dac-stage/reference/android/view/KeyEvent.html
go/dac-stage/reference/android/media/AudioManager.html
go/dac-stage/reference/android/net/wifi/WifiConfiguration.html

(Other files were not in the public Javadocs.)

Bug: 111925950
Test: make ds-docs
Exempt-From-Owner-Approval: Docs-only change
Change-Id: Ia06e1fffd814671289a1caebd5962aedc18a28d7
Merged-In: Ia06e1fffd814671289a1caebd5962aedc18a28d7
2018-10-04 18:20:51 +00:00
Andrew Solovay
5c05dedda1 cherry-pick from pi-dev docs: Replacing {#link with {@link
Several java files had the typo {#link (for cross-references to other
Javadocs) instead of the proper {@link format. This was confusing the
new doc publish tool (Mivi) since that's the format used for {# Django
comments #}.

Fixed a couple of links that had other errors (which prevented building
once the {# -> {@ was done) and other typos.

Replaced throughout the frameworks/base project; I'll need a separate CL
for the AndroidX fixes.

(Other files were not in the public Javadocs.)

Bug: 111925950
Test: make ds-docs
Change-Id: Ia06e1fffd814671289a1caebd5962aedc18a28d7
Original Change-Id: Ia06e1fffd814671289a1caebd5962aedc18a28d7
Exempt-From-Owner-Approval: Docs-only change
2018-10-04 18:17:05 +00:00
vnori
ac2c8a93f0 Merge "Add hidden API to return "Uploading" bit value from SDP record's MapSupportedFeatures." am: 51ec0ebbee am: 33c3ab90e0
am: 7eeb25c5fd

Change-Id: I4332451282d17e698e3f652e94f1b2463071e8a8
2018-09-25 16:47:37 -07:00
Vasu Nori
694752d5b9 Add hidden API to return "Uploading" bit value from SDP record's MapSupportedFeatures.
Bug: 111614861
Test: tested w/ KitchenSink App
Change-Id: I43895183d7b315f57257e1d2045f17dedcb0cfcd
2018-09-25 21:39:31 +00:00
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
Stanley Tng
009103c675 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
(cherry picked from commit 20fc9a250e)
2018-09-12 10:55:54 -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