summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Prerepa Viswanadham <dham@google.com> 2015-01-23 17:56:28 +0000
committer Android Git Automerger <android-git-automerger@android.com> 2015-01-23 17:56:28 +0000
commit76552bb96398e03b21c7d88a302a6ffb59641c16 (patch)
tree87a2ba33b26628efcd52b968c28fbc1febca2995
parent9e9885e1c0b34a6284235e61b023013c1ded6468 (diff)
parente77adabeafa16f9b401a6ad67405205bd96f2219 (diff)
am e77adabe: Don\'t compute flags length for scan response
* commit 'e77adabeafa16f9b401a6ad67405205bd96f2219': Don't compute flags length for scan response
-rw-r--r--core/java/android/bluetooth/le/BluetoothLeAdvertiser.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java b/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java
index e76c23b97a7c..67d9de594090 100644
--- a/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java
+++ b/core/java/android/bluetooth/le/BluetoothLeAdvertiser.java
@@ -119,7 +119,7 @@ public final class BluetoothLeAdvertiser {
}
boolean isConnectable = settings.isConnectable();
if (totalBytes(advertiseData, isConnectable) > MAX_ADVERTISING_DATA_BYTES ||
- totalBytes(scanResponse, isConnectable) > MAX_ADVERTISING_DATA_BYTES) {
+ totalBytes(scanResponse, false) > MAX_ADVERTISING_DATA_BYTES) {
postStartFailure(callback, AdvertiseCallback.ADVERTISE_FAILED_DATA_TOO_LARGE);
return;
}
@@ -171,11 +171,11 @@ public final class BluetoothLeAdvertiser {
mLeAdvertisers.clear();
}
- // Compute the size of the advertise data.
- private int totalBytes(AdvertiseData data, boolean isConnectable) {
+ // Compute the size of advertisement data or scan resp
+ private int totalBytes(AdvertiseData data, boolean isFlagsIncluded) {
if (data == null) return 0;
// Flags field is omitted if the advertising is not connectable.
- int size = isConnectable ? FLAGS_FIELD_BYTES : 0;
+ int size = (isFlagsIncluded) ? FLAGS_FIELD_BYTES : 0;
if (data.getServiceUuids() != null) {
int num16BitUuids = 0;
int num32BitUuids = 0;