diff options
author | Wei Wang <weiwa@google.com> | 2014-07-29 12:33:03 -0700 |
---|---|---|
committer | Wei Wang <weiwa@google.com> | 2014-07-31 15:43:05 -0700 |
commit | 3f7a39063ab7b3d7a38b773449ba2b37674e3458 (patch) | |
tree | 9ec4582d7c00f26b89c74155032b93b8518ff9a4 /core/tests/bluetoothtests | |
parent | 8e554924c527183962fc908c5f916f390f806c74 (diff) | |
download | frameworks_base-3f7a39063ab7b3d7a38b773449ba2b37674e3458.zip frameworks_base-3f7a39063ab7b3d7a38b773449ba2b37674e3458.tar.gz frameworks_base-3f7a39063ab7b3d7a38b773449ba2b37674e3458.tar.bz2 |
Service data and manufacturer data can be repeated fields.
b/16635899
Change-Id: I73f1f4effd3f0e38cd427297eb9d22f3ba285d61
Diffstat (limited to 'core/tests/bluetoothtests')
-rw-r--r-- | core/tests/bluetoothtests/src/android/bluetooth/le/AdvertiseDataTest.java | 8 | ||||
-rw-r--r-- | core/tests/bluetoothtests/src/android/bluetooth/le/ScanRecordTest.java | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/core/tests/bluetoothtests/src/android/bluetooth/le/AdvertiseDataTest.java b/core/tests/bluetoothtests/src/android/bluetooth/le/AdvertiseDataTest.java index 5e451ca..e58d905 100644 --- a/core/tests/bluetoothtests/src/android/bluetooth/le/AdvertiseDataTest.java +++ b/core/tests/bluetoothtests/src/android/bluetooth/le/AdvertiseDataTest.java @@ -66,7 +66,7 @@ public class AdvertiseDataTest extends TestCase { byte[] manufacturerData = new byte[0]; AdvertiseData data = mAdvertiseDataBuilder.setIncludeDeviceName(true) - .setManufacturerData(manufacturerId, manufacturerData).build(); + .addManufacturerData(manufacturerId, manufacturerData).build(); data.writeToParcel(parcel, 0); parcel.setDataPosition(0); AdvertiseData dataFromParcel = @@ -81,7 +81,7 @@ public class AdvertiseDataTest extends TestCase { byte[] serviceData = new byte[0]; AdvertiseData data = mAdvertiseDataBuilder.setIncludeDeviceName(true) - .setServiceData(uuid, serviceData).build(); + .addServiceData(uuid, serviceData).build(); data.writeToParcel(parcel, 0); parcel.setDataPosition(0); AdvertiseData dataFromParcel = @@ -117,7 +117,7 @@ public class AdvertiseDataTest extends TestCase { AdvertiseData data = mAdvertiseDataBuilder.setIncludeDeviceName(true) .addServiceUuid(uuid).addServiceUuid(uuid2) - .setManufacturerData(manufacturerId, manufacturerData).build(); + .addManufacturerData(manufacturerId, manufacturerData).build(); data.writeToParcel(parcel, 0); parcel.setDataPosition(0); @@ -134,7 +134,7 @@ public class AdvertiseDataTest extends TestCase { (byte) 0xF0, 0x00, 0x02, 0x15 }; AdvertiseData data = mAdvertiseDataBuilder.setIncludeDeviceName(true) - .setServiceData(uuid, serviceData).build(); + .addServiceData(uuid, serviceData).build(); data.writeToParcel(parcel, 0); parcel.setDataPosition(0); AdvertiseData dataFromParcel = diff --git a/core/tests/bluetoothtests/src/android/bluetooth/le/ScanRecordTest.java b/core/tests/bluetoothtests/src/android/bluetooth/le/ScanRecordTest.java index ccdd90a..8b3db7e 100644 --- a/core/tests/bluetoothtests/src/android/bluetooth/le/ScanRecordTest.java +++ b/core/tests/bluetoothtests/src/android/bluetooth/le/ScanRecordTest.java @@ -53,13 +53,13 @@ public class ScanRecordTest extends TestCase { assertEquals("Ped", data.getDeviceName()); assertEquals(-20, data.getTxPowerLevel()); - assertEquals(0x00e0, data.getManufacturerId()); + assertTrue(data.getManufacturerSpecificData().get(0x00E0) != null); assertArrayEquals(new byte[] { - 0x02, 0x15 }, data.getManufacturerSpecificData()); + 0x02, 0x15 }, data.getManufacturerSpecificData().get(0x00E0)); - assertEquals(uuid2, data.getServiceDataUuid()); + assertTrue(data.getServiceData().containsKey(uuid2)); assertArrayEquals(new byte[] { - 0x50, 0x64 }, data.getServiceData()); + 0x50, 0x64 }, data.getServiceData().get(uuid2)); } // Assert two byte arrays are equal. |