OSDN Git Service

Make address type agnostic in mac address scan filtering.
authorWei Wang <weiwa@google.com>
Sat, 13 Jun 2015 01:27:29 +0000 (18:27 -0700)
committerWei Wang <weiwa@google.com>
Mon, 15 Jun 2015 22:23:39 +0000 (15:23 -0700)
b/20187218

Change-Id: I2349c9ca2cd1186ceff98f3eb42b6ecba9da002e

src/com/android/bluetooth/gatt/ScanFilterQueue.java
src/com/android/bluetooth/gatt/ScanManager.java

index 8933628..4b47753 100644 (file)
@@ -19,7 +19,6 @@ package com.android.bluetooth.gatt;
 import android.bluetooth.BluetoothUuid;
 import android.bluetooth.le.ScanFilter;
 import android.os.ParcelUuid;
-import android.util.Log;
 
 import java.util.Arrays;
 import java.util.HashSet;
@@ -46,7 +45,7 @@ import java.util.UUID;
     private static final int MAX_LEN_PER_FIELD = 26;
 
     // Values defined in bluedroid.
-    private static final byte DEVICE_TYPE_ALL = 0;
+    private static final byte DEVICE_TYPE_ALL = 2;
 
     class Entry {
         public String address;
index c536f16..4ddbac0 100644 (file)
@@ -826,7 +826,7 @@ public class ScanManager {
                     logd("add address " + entry.address);
                     gattClientScanFilterAddNative(clientIf, entry.type, filterIndex, 0, 0, 0, 0, 0,
                             0,
-                            "", entry.address, (byte) 0, new byte[0], new byte[0]);
+                            "", entry.address, (byte) entry.addr_type, new byte[0], new byte[0]);
                     break;
 
                 case ScanFilterQueue.TYPE_SERVICE_DATA: