Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.bluetooth.le; |
| 18 | |
| 19 | import android.annotation.Nullable; |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 20 | import android.os.Parcel; |
| 21 | import android.os.ParcelUuid; |
| 22 | import android.os.Parcelable; |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 23 | import android.util.ArrayMap; |
| 24 | import android.util.SparseArray; |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 25 | |
| 26 | import java.util.ArrayList; |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 27 | import java.util.List; |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 28 | import java.util.Map; |
Wei Wang | 0325947 | 2014-07-23 00:33:44 -0700 | [diff] [blame] | 29 | import java.util.Objects; |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 30 | |
| 31 | /** |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 32 | * Advertise data packet container for Bluetooth LE advertising. This represents the data to be |
Wei Wang | af74e66 | 2014-07-09 14:03:42 -0700 | [diff] [blame] | 33 | * advertised as well as the scan response data for active scans. |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 34 | * <p> |
| 35 | * Use {@link AdvertiseData.Builder} to create an instance of {@link AdvertiseData} to be |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 36 | * advertised. |
| 37 | * |
| 38 | * @see BluetoothLeAdvertiser |
| 39 | * @see ScanRecord |
| 40 | */ |
Wei Wang | af74e66 | 2014-07-09 14:03:42 -0700 | [diff] [blame] | 41 | public final class AdvertiseData implements Parcelable { |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 42 | |
| 43 | @Nullable |
| 44 | private final List<ParcelUuid> mServiceUuids; |
| 45 | |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 46 | private final SparseArray<byte[]> mManufacturerSpecificData; |
| 47 | private final Map<ParcelUuid, byte[]> mServiceData; |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 48 | private final boolean mIncludeTxPowerLevel; |
| 49 | private final boolean mIncludeDeviceName; |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 50 | |
Wei Wang | af74e66 | 2014-07-09 14:03:42 -0700 | [diff] [blame] | 51 | private AdvertiseData(List<ParcelUuid> serviceUuids, |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 52 | SparseArray<byte[]> manufacturerData, |
| 53 | Map<ParcelUuid, byte[]> serviceData, |
| 54 | boolean includeTxPowerLevel, |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 55 | boolean includeDeviceName) { |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 56 | mServiceUuids = serviceUuids; |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 57 | mManufacturerSpecificData = manufacturerData; |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 58 | mServiceData = serviceData; |
| 59 | mIncludeTxPowerLevel = includeTxPowerLevel; |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 60 | mIncludeDeviceName = includeDeviceName; |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 61 | } |
| 62 | |
| 63 | /** |
Wei Wang | af74e66 | 2014-07-09 14:03:42 -0700 | [diff] [blame] | 64 | * Returns a list of service UUIDs within the advertisement that are used to identify the |
| 65 | * Bluetooth GATT services. |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 66 | */ |
| 67 | public List<ParcelUuid> getServiceUuids() { |
| 68 | return mServiceUuids; |
| 69 | } |
| 70 | |
| 71 | /** |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 72 | * Returns an array of manufacturer Id and the corresponding manufacturer specific data. The |
| 73 | * manufacturer id is a non-negative number assigned by Bluetooth SIG. |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 74 | */ |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 75 | public SparseArray<byte[]> getManufacturerSpecificData() { |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 76 | return mManufacturerSpecificData; |
| 77 | } |
| 78 | |
| 79 | /** |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 80 | * Returns a map of 16-bit UUID and its corresponding service data. |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 81 | */ |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 82 | public Map<ParcelUuid, byte[]> getServiceData() { |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 83 | return mServiceData; |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Whether the transmission power level will be included in the advertisement packet. |
| 88 | */ |
| 89 | public boolean getIncludeTxPowerLevel() { |
| 90 | return mIncludeTxPowerLevel; |
| 91 | } |
| 92 | |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 93 | /** |
| 94 | * Whether the device name will be included in the advertisement packet. |
| 95 | */ |
| 96 | public boolean getIncludeDeviceName() { |
| 97 | return mIncludeDeviceName; |
| 98 | } |
| 99 | |
Wei Wang | 0325947 | 2014-07-23 00:33:44 -0700 | [diff] [blame] | 100 | /** |
| 101 | * @hide |
| 102 | */ |
| 103 | @Override |
| 104 | public int hashCode() { |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 105 | return Objects.hash(mServiceUuids, mManufacturerSpecificData, mServiceData, |
| 106 | mIncludeDeviceName, mIncludeTxPowerLevel); |
Wei Wang | 0325947 | 2014-07-23 00:33:44 -0700 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | /** |
| 110 | * @hide |
| 111 | */ |
| 112 | @Override |
| 113 | public boolean equals(Object obj) { |
| 114 | if (this == obj) { |
| 115 | return true; |
| 116 | } |
| 117 | if (obj == null || getClass() != obj.getClass()) { |
| 118 | return false; |
| 119 | } |
| 120 | AdvertiseData other = (AdvertiseData) obj; |
Jack He | 2992cd0 | 2017-08-22 21:21:23 -0700 | [diff] [blame] | 121 | return Objects.equals(mServiceUuids, other.mServiceUuids) |
| 122 | && BluetoothLeUtils.equals(mManufacturerSpecificData, |
| 123 | other.mManufacturerSpecificData) |
| 124 | && BluetoothLeUtils.equals(mServiceData, other.mServiceData) |
| 125 | && mIncludeDeviceName == other.mIncludeDeviceName |
| 126 | && mIncludeTxPowerLevel == other.mIncludeTxPowerLevel; |
Wei Wang | 0325947 | 2014-07-23 00:33:44 -0700 | [diff] [blame] | 127 | } |
| 128 | |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 129 | @Override |
| 130 | public String toString() { |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 131 | return "AdvertiseData [mServiceUuids=" + mServiceUuids + ", mManufacturerSpecificData=" |
Wei Wang | 833559d | 2014-08-29 10:26:13 -0700 | [diff] [blame] | 132 | + BluetoothLeUtils.toString(mManufacturerSpecificData) + ", mServiceData=" |
| 133 | + BluetoothLeUtils.toString(mServiceData) |
Wei Wang | 0325947 | 2014-07-23 00:33:44 -0700 | [diff] [blame] | 134 | + ", mIncludeTxPowerLevel=" + mIncludeTxPowerLevel + ", mIncludeDeviceName=" |
| 135 | + mIncludeDeviceName + "]"; |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | @Override |
| 139 | public int describeContents() { |
| 140 | return 0; |
| 141 | } |
| 142 | |
| 143 | @Override |
| 144 | public void writeToParcel(Parcel dest, int flags) { |
Jakub Pawlowski | e8c3b91 | 2017-08-08 15:47:57 -0700 | [diff] [blame] | 145 | dest.writeTypedArray(mServiceUuids.toArray(new ParcelUuid[mServiceUuids.size()]), flags); |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 146 | |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 147 | // mManufacturerSpecificData could not be null. |
| 148 | dest.writeInt(mManufacturerSpecificData.size()); |
| 149 | for (int i = 0; i < mManufacturerSpecificData.size(); ++i) { |
| 150 | dest.writeInt(mManufacturerSpecificData.keyAt(i)); |
Jakub Pawlowski | e8c3b91 | 2017-08-08 15:47:57 -0700 | [diff] [blame] | 151 | dest.writeByteArray(mManufacturerSpecificData.valueAt(i)); |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 152 | } |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 153 | dest.writeInt(mServiceData.size()); |
| 154 | for (ParcelUuid uuid : mServiceData.keySet()) { |
Jakub Pawlowski | e8c3b91 | 2017-08-08 15:47:57 -0700 | [diff] [blame] | 155 | dest.writeTypedObject(uuid, flags); |
| 156 | dest.writeByteArray(mServiceData.get(uuid)); |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 157 | } |
| 158 | dest.writeByte((byte) (getIncludeTxPowerLevel() ? 1 : 0)); |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 159 | dest.writeByte((byte) (getIncludeDeviceName() ? 1 : 0)); |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 160 | } |
| 161 | |
Jeff Sharkey | 9e8f83d | 2019-02-28 12:06:45 -0700 | [diff] [blame] | 162 | public static final @android.annotation.NonNull Parcelable.Creator<AdvertiseData> CREATOR = |
Wei Wang | af74e66 | 2014-07-09 14:03:42 -0700 | [diff] [blame] | 163 | new Creator<AdvertiseData>() { |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 164 | @Override |
Wei Wang | af74e66 | 2014-07-09 14:03:42 -0700 | [diff] [blame] | 165 | public AdvertiseData[] newArray(int size) { |
| 166 | return new AdvertiseData[size]; |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 167 | } |
| 168 | |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 169 | @Override |
Wei Wang | af74e66 | 2014-07-09 14:03:42 -0700 | [diff] [blame] | 170 | public AdvertiseData createFromParcel(Parcel in) { |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 171 | Builder builder = new Builder(); |
Jakub Pawlowski | e8c3b91 | 2017-08-08 15:47:57 -0700 | [diff] [blame] | 172 | ArrayList<ParcelUuid> uuids = in.createTypedArrayList(ParcelUuid.CREATOR); |
| 173 | for (ParcelUuid uuid : uuids) { |
| 174 | builder.addServiceUuid(uuid); |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 175 | } |
Jakub Pawlowski | e8c3b91 | 2017-08-08 15:47:57 -0700 | [diff] [blame] | 176 | |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 177 | int manufacturerSize = in.readInt(); |
| 178 | for (int i = 0; i < manufacturerSize; ++i) { |
| 179 | int manufacturerId = in.readInt(); |
Jakub Pawlowski | e8c3b91 | 2017-08-08 15:47:57 -0700 | [diff] [blame] | 180 | byte[] manufacturerData = in.createByteArray(); |
| 181 | builder.addManufacturerData(manufacturerId, manufacturerData); |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 182 | } |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 183 | int serviceDataSize = in.readInt(); |
| 184 | for (int i = 0; i < serviceDataSize; ++i) { |
Jakub Pawlowski | e8c3b91 | 2017-08-08 15:47:57 -0700 | [diff] [blame] | 185 | ParcelUuid serviceDataUuid = in.readTypedObject(ParcelUuid.CREATOR); |
| 186 | byte[] serviceData = in.createByteArray(); |
| 187 | builder.addServiceData(serviceDataUuid, serviceData); |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 188 | } |
| 189 | builder.setIncludeTxPowerLevel(in.readByte() == 1); |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 190 | builder.setIncludeDeviceName(in.readByte() == 1); |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 191 | return builder.build(); |
| 192 | } |
| 193 | }; |
| 194 | |
| 195 | /** |
Wei Wang | af74e66 | 2014-07-09 14:03:42 -0700 | [diff] [blame] | 196 | * Builder for {@link AdvertiseData}. |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 197 | */ |
| 198 | public static final class Builder { |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 199 | @Nullable |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 200 | private List<ParcelUuid> mServiceUuids = new ArrayList<ParcelUuid>(); |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 201 | private SparseArray<byte[]> mManufacturerSpecificData = new SparseArray<byte[]>(); |
| 202 | private Map<ParcelUuid, byte[]> mServiceData = new ArrayMap<ParcelUuid, byte[]>(); |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 203 | private boolean mIncludeTxPowerLevel; |
| 204 | private boolean mIncludeDeviceName; |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 205 | |
| 206 | /** |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 207 | * Add a service UUID to advertise data. |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 208 | * |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 209 | * @param serviceUuid A service UUID to be advertised. |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 210 | * @throws IllegalArgumentException If the {@code serviceUuids} are null. |
| 211 | */ |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 212 | public Builder addServiceUuid(ParcelUuid serviceUuid) { |
| 213 | if (serviceUuid == null) { |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 214 | throw new IllegalArgumentException("serivceUuids are null"); |
| 215 | } |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 216 | mServiceUuids.add(serviceUuid); |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 217 | return this; |
| 218 | } |
| 219 | |
| 220 | /** |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 221 | * Add service data to advertise data. |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 222 | * |
Wei Wang | af74e66 | 2014-07-09 14:03:42 -0700 | [diff] [blame] | 223 | * @param serviceDataUuid 16-bit UUID of the service the data is associated with |
| 224 | * @param serviceData Service data |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 225 | * @throws IllegalArgumentException If the {@code serviceDataUuid} or {@code serviceData} is |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 226 | * empty. |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 227 | */ |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 228 | public Builder addServiceData(ParcelUuid serviceDataUuid, byte[] serviceData) { |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 229 | if (serviceDataUuid == null || serviceData == null) { |
| 230 | throw new IllegalArgumentException( |
| 231 | "serviceDataUuid or serviceDataUuid is null"); |
| 232 | } |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 233 | mServiceData.put(serviceDataUuid, serviceData); |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 234 | return this; |
| 235 | } |
| 236 | |
| 237 | /** |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 238 | * Add manufacturer specific data. |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 239 | * <p> |
| 240 | * Please refer to the Bluetooth Assigned Numbers document provided by the <a |
| 241 | * href="https://www.bluetooth.org">Bluetooth SIG</a> for a list of existing company |
| 242 | * identifiers. |
Wei Wang | af74e66 | 2014-07-09 14:03:42 -0700 | [diff] [blame] | 243 | * |
| 244 | * @param manufacturerId Manufacturer ID assigned by Bluetooth SIG. |
| 245 | * @param manufacturerSpecificData Manufacturer specific data |
Jack He | a355e5e | 2017-08-22 16:06:54 -0700 | [diff] [blame] | 246 | * @throws IllegalArgumentException If the {@code manufacturerId} is negative or {@code |
| 247 | * manufacturerSpecificData} is null. |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 248 | */ |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 249 | public Builder addManufacturerData(int manufacturerId, byte[] manufacturerSpecificData) { |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 250 | if (manufacturerId < 0) { |
| 251 | throw new IllegalArgumentException( |
| 252 | "invalid manufacturerId - " + manufacturerId); |
| 253 | } |
| 254 | if (manufacturerSpecificData == null) { |
| 255 | throw new IllegalArgumentException("manufacturerSpecificData is null"); |
| 256 | } |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 257 | mManufacturerSpecificData.put(manufacturerId, manufacturerSpecificData); |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 258 | return this; |
| 259 | } |
| 260 | |
| 261 | /** |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 262 | * Whether the transmission power level should be included in the advertise packet. Tx power |
| 263 | * level field takes 3 bytes in advertise packet. |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 264 | */ |
| 265 | public Builder setIncludeTxPowerLevel(boolean includeTxPowerLevel) { |
| 266 | mIncludeTxPowerLevel = includeTxPowerLevel; |
| 267 | return this; |
| 268 | } |
| 269 | |
| 270 | /** |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 271 | * Set whether the device name should be included in advertise packet. |
| 272 | */ |
| 273 | public Builder setIncludeDeviceName(boolean includeDeviceName) { |
| 274 | mIncludeDeviceName = includeDeviceName; |
| 275 | return this; |
| 276 | } |
| 277 | |
| 278 | /** |
Wei Wang | af74e66 | 2014-07-09 14:03:42 -0700 | [diff] [blame] | 279 | * Build the {@link AdvertiseData}. |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 280 | */ |
Wei Wang | af74e66 | 2014-07-09 14:03:42 -0700 | [diff] [blame] | 281 | public AdvertiseData build() { |
Wei Wang | 6bf513d | 2014-08-01 11:12:37 -0700 | [diff] [blame] | 282 | return new AdvertiseData(mServiceUuids, mManufacturerSpecificData, mServiceData, |
Wei Wang | 685c1758 | 2014-07-16 22:02:03 -0700 | [diff] [blame] | 283 | mIncludeTxPowerLevel, mIncludeDeviceName); |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 284 | } |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 285 | } |
| 286 | } |