OSDN Git Service

Increase device name limit in the LE advertisement
authorJakub Pawlowski <jpawlowski@google.com>
Thu, 4 May 2017 12:28:20 +0000 (05:28 -0700)
committerJacky Cheung <jackyc@google.com>
Thu, 4 May 2017 21:21:13 +0000 (14:21 -0700)
The advertise data refactor:
https://android-review.git.corp.google.com/#/q/topic:btif-ad-data-refactor
introduced a change in behaviour. Previously, the device name was
included in full, or truncated if the device name was longer than the
advertisement. After the patch, name longer than 18 chars are truncated.

Increase the allowed device name length to 26 - the maximum size it can
get for legacy connectable advertisement.

Bug: 37870615
Test: none
Change-Id: I3464ffae32e73cefa10142c2f0509d9139475ddd
(cherry picked from commit c36b2ae522ab9bf7827cfca8f6cbb8efeaf2b8fa)

src/com/android/bluetooth/gatt/AdvertiseHelper.java

index 63ec71f..9355631 100644 (file)
@@ -27,7 +27,7 @@ class AdvertiseHelper {
 
   private static final String TAG = "AdvertiseHelper";
 
-  private static final int DEVICE_NAME_MAX = 18;
+  private static final int DEVICE_NAME_MAX = 26;
 
   private static final int COMPLETE_LIST_16_BIT_SERVICE_UUIDS = 0X03;
   private static final int COMPLETE_LIST_32_BIT_SERVICE_UUIDS = 0X05;