diff options
| author | Miao-chen Chou <mcchou@google.com> | 2018-03-14 15:00:23 -0700 |
|---|---|---|
| committer | Miao-chen Chou <mcchou@google.com> | 2018-03-14 16:35:11 -0700 |
| commit | 5a96fe77b8727c8077f82007af1a87d4ff7aeacb (patch) | |
| tree | 77e00bb5154db65accd1e1e3f4c6796259e4dc0c /framework/java/android/bluetooth/BluetoothAdapter.java | |
| parent | 0b80e8686e31fc090f27596968c37257080fbf76 (diff) | |
Bluetooth: preserve one advertisement slot for GMS core
This brings back the check on the multiple advertisement support before
granting any Bluetooth LE advertiser. In other words, one slot is preserved
for GMS core.
Bug: 74819586
Test: Run an BLE application and verify the number of advertisements
Change-Id: Iac3b47c76c6f699018982a69e9b04a9d8c631bfb
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
| -rw-r--r-- | framework/java/android/bluetooth/BluetoothAdapter.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java index be4e207e58..6aabe18ba8 100644 --- a/framework/java/android/bluetooth/BluetoothAdapter.java +++ b/framework/java/android/bluetooth/BluetoothAdapter.java @@ -676,6 +676,10 @@ public final class BluetoothAdapter { if (!getLeAccess()) { return null; } + if (!isMultipleAdvertisementSupported()) { + Log.e(TAG, "Bluetooth LE advertising not supported"); + return null; + } synchronized (mLock) { if (sBluetoothLeAdvertiser == null) { sBluetoothLeAdvertiser = new BluetoothLeAdvertiser(mManagerService); |
