Commit Graph

1438 Commits

Author SHA1 Message Date
Christian Wailes
d9bce3cfff Merge "Revert "Revert "Remove a misleading "flush" function.""" 2019-09-11 18:23:50 +00:00
Christian Wailes
647fee87dc Revert "Revert "Remove a misleading "flush" function.""
This reverts commit 47da177405.

Reason for revert: Fixed the test broken by the original commit

Bug: 139192244
Bug: 140336855

Test: m -> flash -> boot
Test: atest CtsJvmtiAttachingHostTestCases

Change-Id: I4c67ad8709652c4710ef24564e0240f74f817f8c
2019-09-04 23:37:32 +00:00
Ian Kasprzak
783313acbf Merge "Revert "Remove a misleading "flush" function.""
am: 9fcf8b7cae

Change-Id: Ic6fafd4ed9bf6dfc001120dced903b14cf907d1d
2019-09-02 08:47:30 -07:00
Ian Kasprzak
9fcf8b7cae Merge "Revert "Remove a misleading "flush" function."" 2019-09-02 15:28:20 +00:00
Dan Harms
6006a30059 Merge "Include BLE<->SPP transition states in isLeEnabled"
am: ac413db400

Change-Id: I15a67ad7b277b345b96f2a7cf852554ed6fee267
2019-09-01 14:59:54 -07:00
Treehugger Robot
ac413db400 Merge "Include BLE<->SPP transition states in isLeEnabled" 2019-09-01 21:45:21 +00:00
Ian Kasprzak
47da177405 Revert "Remove a misleading "flush" function."
This reverts commit 9d8b926859.

Reason for revert: Driodcop: aosp-master test-mapping showing multiple failures (b/140336855).

Change-Id: If44e273dd111802db8b44db1e5a67a4628c72e3c
2019-08-31 21:28:50 +00:00
Christian Wailes
932b360d45 Merge "Remove a misleading "flush" function."
am: d6f04e744d

Change-Id: I31a2c6a8b49493ea85816071874c3e08841f233f
2019-08-30 16:24:39 -07:00
Christian Wailes
d6f04e744d Merge "Remove a misleading "flush" function." 2019-08-30 22:59:41 +00:00
Mark Chien
b2d0c6357c Merge "Passing caller package name to setBluetoothTethering"
am: 751f034b82

Change-Id: I7f6b22e4b8273cbdb3b40a7dd926e838d6fa7455
2019-08-28 03:12:54 -07:00
Chris Wailes
9d8b926859 Remove a misleading "flush" function.
This patch removes LocalSocketImpl.flush().  In practice this function
was simply a wrapper around `Thread.sleep(10)`.  All direct calls to
this function have been removed.  The `flush()` function is still called
on several objects that wrap a SocketOutputStream.

This will make booting a device 20ms faster than it currently is.

Bug: 139192244
Test: Build -> flash -> boot -> launch app
Change-Id: I0a96f4bc72461670370f61e847349f32af5ac774
2019-08-27 14:51:21 -07:00
markchien
560c3ac1dc Passing caller package name to setBluetoothTethering
This is necessary to examine caller's permission. If caller's uid is not
same as passing package name, SecurityException would be throwed.
This change also clear the identity before calling
BluetoothPan#setBluetoothTethering() in Tethering#setBluetoothTethering.
This is fine because caller already pass permission check before in
ConnectivityService. See the flow below:
ConnectivityManager#startTethering -> ConnectivityService#startTethering
-> Tethering#startTethering -> Tethering#setBluetoothTethering
-> BluetoothPan#setBluetoothTethering

Bug: 134649258
Test: -build, flash, boot
      -atest FrameworkNetTests
      -manual test with bluetooth OFF/ON

Change-Id: I2140398ad3bbc8076f729c843f0515c654553aaf
2019-08-27 23:26:20 +08:00
Dan Harms
2d7e1873d1 Include BLE<->SPP transition states in isLeEnabled
Fixes: 138997297
Test: Start scan while in transition and observe no exceptions
Change-Id: Ib8b05c30c3db8e398194572a179028647e703a9f
2019-08-07 08:48:04 -07:00
Cheney Ni
af3615e586 Merge "Add helpers to check whether the BluetoothCodecConfig instance is selectable"
am: 8052fac1b1

Change-Id: I7718d3f12541bcbb005f7e1930267a1393f9b19a
2019-07-29 20:00:37 -07:00
Treehugger Robot
8052fac1b1 Merge "Add helpers to check whether the BluetoothCodecConfig instance is selectable" 2019-07-30 02:28:52 +00:00
Deqiang Chen
92485e41b8 Merge "Define intent for receive vendor specific response and define a function to send vendor AT command from Hfp client"
am: a0b2086373

Change-Id: I4101b1119d583c8d45c0bbde6d1955b97176d656
2019-07-24 14:27:52 -07:00
Cheney Ni
f1936c3423 Add helpers to check whether the BluetoothCodecConfig instance is selectable
There will be a helper in the BluetoothCodecStatus to check whether the
codec config is matched the selectable array. It uses 3 smaller helpers
to confirm the codec config has none (wildcard matching), or one and only
one value for the audio feeding parameters.

Besides, this CL also adds a helper to compare whether two codec configs
are similar or not, and uses NONE values as wildcard.

Bug: 131147224
Bug: 133719424
Test: atest -t BluetoothInstrumentationTests:com.android.bluetooth.a2dp
Change-Id: I7d8f1a16b8358c440841801d95471b2d010739ec
2019-07-23 20:32:06 +08:00
Deqiang Chen
2fec85d6f6 Define intent for receive vendor specific response and define a function to send vendor AT command from Hfp client
Bug: 132813146

Test: Local test with Kitchensink: able to send vendor command and
receive response.

Change-Id: I9a6debbacb1a5ad6445416c067d3d35849906685
2019-07-12 10:08:11 -07:00
Mathew Inwood
13ffa87a6d Merge "Restore some greylist entries." into qt-dev
am: f76bdce6e0

Change-Id: I320e33be57b8124ff7c132a67c8981d53802f8f5
2019-06-28 07:43:43 -07:00
Mathew Inwood
3a75f264a8 Restore some greylist entries.
In Q, these APIs were either:
- removed from the greylist entirely without good reason
- Moved to the restricted greylist without any public alternative
  information added

So they are being moved back to the greylist for Q.

Test: Treehugger
Bug: 136102585
Change-Id: I5ac8b8b9b23c3789d80239cf456072cc7dfa1203
2019-06-28 10:15:37 +01:00
Andrei-Valentin Onea
882defd836 Merge "Document public alternatives to greylisted APIs" am: 3647eb620b
am: 3641066567

Change-Id: Ia21d1ce57a2cbffe8b417d6f1d5535924c7ea162
2019-06-19 07:21:29 -07:00
Andrei-Valentin Onea
3647eb620b Merge "Document public alternatives to greylisted APIs" 2019-06-19 13:57:08 +00:00
Andrei Onea
f950c08b78 Document public alternatives to greylisted APIs
Add known public alternatives or recommendations for greylisted APIs in
Bluetooth.

Bug: 135171386
Test: m
Change-Id: I86e708be37eb7d1b0fafa2d64283b7f81bc02e51
2019-06-17 11:29:45 +01:00
Chienyuan
7bd8017a94 Merge "Declare STATE_AUDIO_CONNECTED in right place" am: 8fdfd917d1
am: 2235a8778b

Change-Id: Ib76c1f59d811c76a4d44c9ca172599214631610e
2019-06-14 00:31:42 -07:00
Treehugger Robot
8fdfd917d1 Merge "Declare STATE_AUDIO_CONNECTED in right place" 2019-06-14 07:12:26 +00:00
Sal Savage
26fdabb9a0 Merge "BluetoothProfileConnector: Invoke service disconnections with the correct profile ID" into qt-dev 2019-05-29 16:08:48 +00:00
Chienyuan
a669d1a198 Declare STATE_AUDIO_CONNECTED in right place
Test: build pass
Change-Id: Ia3834207756afdcc06ccfd7bdc5c91c3e651bebe
2019-05-29 10:29:30 +08:00
Sal Savage
b4b40f284f Merge "Update BluetoothProfileConnector to invoke service disconnections with correct profile ID" am: d8b457545a
am: 8b3ceb7640

Change-Id: Ia12feb3f9d86c71634bda442e07eccd092972f0e
2019-05-28 18:40:12 -07:00
Sal Savage
202ec8b71d BluetoothProfileConnector: Invoke service disconnections with the correct profile ID
Bug: b/133517229
Test: Build + Manual on automotive hardware
Change-Id: Id8dbeaf844a65020f610505f81eea20b96ec002a
Merged-In: Id8dbeaf844a65020f610505f81eea20b96ec002a
2019-05-28 16:58:57 +00:00
Sal Savage
4afdab44ab Update BluetoothProfileConnector to invoke service disconnections with correct profile ID
Bug: b/133517229
Test: Build + Manual on automotive hardware
Change-Id: Id8dbeaf844a65020f610505f81eea20b96ec002a
2019-05-28 16:56:23 +00:00
Martin Brabham
2b3b1429db DO NOT MERGE: ScanFilter: Fix argument sanitization logic.
Bug: 132888204
Test: Manual
Change-Id: Id8cadbbfac29aca97ccb83815795948b1bbf85a5
2019-05-22 05:33:19 +00:00
Sal Savage
5d145c06ea Add timestamp and read status extra constants to MAP Client
Bug: b/132455654
Test: build and run on automotive hardware. Use kitchen sink to send
and receive messages.

Change-Id: Ic0f04640f1894d6cf336ba7e641df9cf148a2bbd
Merged-In: Ic0f04640f1894d6cf336ba7e641df9cf148a2bbd
2019-05-21 08:16:47 -07:00
Sal Savage
40aa11ead0 Add timestamp and read status extra constants to MAP Client
Bug: b/132455654
Test: build and run on automotive hardware. Use kitchen sink to send
and receive messages.

Change-Id: Ic0f04640f1894d6cf336ba7e641df9cf148a2bbd
2019-05-14 11:15:14 -07:00
TreeHugger Robot
87b7e3d48d Merge "Fix binder leakage when turning off Bluetooth" into qt-dev 2019-05-03 04:04:34 +00:00
Ugo Yu
6d9cfce73a Fix binder leakage when turning off Bluetooth
* In current design, Bluetooth AdapterState stops all BR/EDR
  profiles' service and triggers onServiceDisconnected callback to
  all binder clients before BluetoothManagerService invokes
  onBluetoothStateChange(false), which means unbind service
  would never be called in framework.
* Do unbind service when onServiceDisconnected is invoked.
* Move profile binder logic to BluetoothProfileConnector except:
  - BluetoothHeadset: its binder logic is in BluetoothManagerService
  - BluetoothPbap: it has an individual ServiceListener

Bug: 129037442
Bug: 129437895
Test: Bluetooth ON/OFF stress test.
      adb shell dumpsys activity services | egrep "com.android.bluetooth"
      to check whether AppBindRecord for com.android.bluetooth grows

Change-Id: Id0d85866d386962b94d2d966f0a864b1da165d13
2019-05-02 18:06:41 +08:00
Ugo Yu
d011546a85 Fix binder leakage when turning off Bluetooth
* In current design, Bluetooth AdapterState stops all BR/EDR
  profiles' service and triggers onServiceDisconnected callback to
  all binder clients before BluetoothManagerService invokes
  onBluetoothStateChange(false), which means unbind service
  would never be called in framework.
* Do unbind service when onServiceDisconnected is invoked.
* Move profile binder logic to BluetoothProfileConnector except:
  - BluetoothHeadset: its binder logic is in BluetoothManagerService
  - BluetoothPbap: it has an individual ServiceListener

Bug: 129037442
Bug: 129437895
Test: Bluetooth ON/OFF stress test.
      adb shell dumpsys activity services | egrep "com.android.bluetooth"
      to check whether AppBindRecord for com.android.bluetooth grows

Merged-In: Id0d85866d386962b94d2d966f0a864b1da165d13
Change-Id: Id0d85866d386962b94d2d966f0a864b1da165d13
2019-05-02 17:25:52 +08:00
Stanley Tng
649e6a57f8 Add more documentation for LE CoC
Added more information into Android SDK for LE Connection-oriented
Channels (CoC) so that it matches the corresponding RFComm
documentation.

Bug: 70683224
Test: Compile
Change-Id: I40abde70a7ca6bcd194ee75bd8367c0ed9e97d05
(cherry picked from commit bcbc130235)
Merged-In: I40abde70a7ca6bcd194ee75bd8367c0ed9e97d05
2019-04-24 09:24:19 -07:00
Treehugger Robot
964f6265ad Merge "Add more documentation for LE CoC" 2019-04-22 02:05:22 +00:00
Treehugger Robot
ce5fdc042a Merge "Add nullability annotations to android.bluetooth.le.ScanFilter.Builder setServiceSolicitationUuid" 2019-04-20 02:20:04 +00:00
Stanley Tng
bcbc130235 Add more documentation for LE CoC
Added more information into Android SDK for LE Connection-oriented
Channels (CoC) so that it matches the corresponding RFComm
documentation.

Bug: 70683224
Test: Compile
Change-Id: I40abde70a7ca6bcd194ee75bd8367c0ed9e97d05
2019-04-19 15:50:42 -07:00
Zach Johnson
df512f12a1 Add nullability annotations to android.bluetooth.le.ScanFilter.Builder setServiceSolicitationUuid
Test: compilation
Fixes: 126698824
Change-Id: I4873b46a37df3e103ddc62001cc9f0bc01aea4dc
2019-04-19 22:35:13 +00:00
Zach Johnson
df588a2292 Add nullability annotations to android.bluetooth.le.ScanFilter.Builder setServiceSolicitationUuid
Test: compilation
Fixes: 126698824
Change-Id: I4873b46a37df3e103ddc62001cc9f0bc01aea4dc
2019-04-19 15:30:22 -07:00
Treehugger Robot
e5cf74326d Merge "Refine Bluetooth Metadata API" 2019-04-15 20:37:28 +00:00
Jakub Pawlowski
64307cc0b2 Bluetooth: Make ScanRecord.getServiceSolicitationUuids NonNull
Test: compilation
Bug: 115639878
Merged-In: I5f895d65a7036275ab0faa0afd2ee1eebc416476
Change-Id: I5f895d65a7036275ab0faa0afd2ee1eebc416476
2019-04-12 09:27:10 +02:00
Jakub Pawlowski
cc01027e50 Bluetooth: Make ScanRecord.getServiceSolicitationUuids NonNull
Test: compilation
Bug: 115639878
Merged-In: I5f895d65a7036275ab0faa0afd2ee1eebc416476
Change-Id: I5f895d65a7036275ab0faa0afd2ee1eebc416476
2019-04-12 09:04:22 +02:00
Ugo Yu
4741a8bd53 Refine Bluetooth Metadata API
- Modify MetadataListener to as an interface and rename
  it to OnMetadataChangedListener
- Fix typo UNTHETHERED -> UNTETHERED
- Add NonNull annotation for metadata API parameters
- Re-design metadata unregister API
- Change metadata type to byte array

Bug: 124448651
Bug: 126701203
Bug: 126699213
Test: build pass

Change-Id: I79460071c7693f648e92cf849738c24f8bc269d9
2019-04-08 20:09:53 +08:00
Jack He
fac8c40ba5 Merge "BluetoothHealth: hide auto-created default constructors" am: 463454432b am: 39a6d731bb
am: f08eadc878

Change-Id: I042170e4b06ee298c063a84c8f7aaabe58a4c0dd
2019-04-01 17:40:49 -07:00
Jack He
875ff327e0 BluetoothHealth: hide auto-created default constructors
Fixes: 123926561
Test: make
Change-Id: I388472c82eaca245285b5ecf2959c415508d7e69
2019-04-01 13:19:54 -07:00
Ugo Yu
50e3c08d4c Refine Bluetooth Metadata API
- Modify MetadataListener to as an interface and rename
  it to OnMetadataChangedListener
- Fix typo UNTHETHERED -> UNTETHERED
- Add NonNull annotation for metadata API parameters
- Re-design metadata unregister API
- Change metadata type to byte array

Bug: 124448651
Bug: 126701203
Bug: 126699213
Test: build pass

Change-Id: I79460071c7693f648e92cf849738c24f8bc269d9
Merged-In: I79460071c7693f648e92cf849738c24f8bc269d9
2019-04-01 23:16:17 +08:00
Ugo Yu
1cf619760e Merge "Refine Bluetooth silence mode API" am: c650674397 am: 0196a831b1
am: ae55a7a369

Change-Id: Ie5dfde6a063209acf61846438b6f507ef24f9716
2019-03-31 20:44:42 -07:00