Loading android/app/src/com/android/bluetooth/gatt/AdvertiseManager.java +1 −8 Original line number Original line Diff line number Diff line Loading @@ -213,13 +213,6 @@ class AdvertiseManager { return numOfAdvtInstances - 1; return numOfAdvtInstances - 1; } } // Check whether all service uuids have been registered to GATT server. private boolean isAllServiceRegistered(AdvertiseClient client) { List<ParcelUuid> registeredUuids = mService.getRegisteredServiceUuids(); return containsAll(registeredUuids, client.advertiseData) && containsAll(registeredUuids, client.scanResponse); } // Check whether the registeredUuids contains all uuids in advertiseData. // Check whether the registeredUuids contains all uuids in advertiseData. private boolean containsAll(List<ParcelUuid> registeredUuids, AdvertiseData advertiseData) { private boolean containsAll(List<ParcelUuid> registeredUuids, AdvertiseData advertiseData) { if (advertiseData == null) { if (advertiseData == null) { Loading Loading @@ -321,7 +314,7 @@ class AdvertiseManager { if (data == null) { if (data == null) { return; return; } } boolean includeName = true; boolean includeName = data.getIncludeDeviceName(); boolean includeTxPower = data.getIncludeTxPowerLevel(); boolean includeTxPower = data.getIncludeTxPowerLevel(); int appearance = 0; int appearance = 0; byte[] manufacturerData = data.getManufacturerSpecificData() == null ? new byte[0] byte[] manufacturerData = data.getManufacturerSpecificData() == null ? new byte[0] Loading android/app/src/com/android/bluetooth/gatt/GattService.java +3 −34 Original line number Original line Diff line number Diff line Loading @@ -285,28 +285,12 @@ public class GattService extends ProfileService { service.unregisterClient(clientIf); service.unregisterClient(clientIf); } } public void startScan(int appIf, boolean isServer) { GattService service = getService(); if (service == null) return; service.startScan(appIf, isServer); } public void startScanWithUuids(int appIf, boolean isServer, ParcelUuid[] ids) { GattService service = getService(); if (service == null) return; UUID[] uuids = new UUID[ids.length]; for(int i = 0; i != ids.length; ++i) { uuids[i] = ids[i].getUuid(); } service.startScanWithUuids(appIf, isServer, uuids); } @Override @Override public void startScanWithFilters(int appIf, boolean isServer, ScanSettings settings, public void startScan(int appIf, boolean isServer, ScanSettings settings, List<ScanFilter> filters) { List<ScanFilter> filters) { GattService service = getService(); GattService service = getService(); if (service == null) return; if (service == null) return; service.startScanWithFilters(appIf, isServer, settings, filters); service.startScan(appIf, isServer, settings, filters); } } public void stopScan(int appIf, boolean isServer) { public void stopScan(int appIf, boolean isServer) { Loading Loading @@ -1207,22 +1191,7 @@ public class GattService extends ProfileService { return deviceList; return deviceList; } } // TODO: Remove this and implement legacy scan using new logic. void startScan(int appIf, boolean isServer, ScanSettings settings, void startScan(int appIf, boolean isServer) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH_ADMIN permission"); configureScanParams(appIf); mScanManager.startScan(new ScanClient(appIf, false)); } // TODO: Remove this and implement legacy scan using new logic. void startScanWithUuids(int appIf, boolean isServer, UUID[] uuids) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH_ADMIN permission"); configureScanParams(appIf); mScanManager.startScan(new ScanClient(appIf, false, uuids)); } void startScanWithFilters(int appIf, boolean isServer, ScanSettings settings, List<ScanFilter> filters) { List<ScanFilter> filters) { if (DBG) Log.d(TAG, "start scan with filters "); if (DBG) Log.d(TAG, "start scan with filters "); enforceAdminPermission(); enforceAdminPermission(); Loading android/app/src/com/android/bluetooth/gatt/ScanManager.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.os.Handler; import android.os.HandlerThread; import android.os.HandlerThread; import android.os.Looper; import android.os.Looper; import android.os.Message; import android.os.Message; import android.os.RemoteException; import android.util.Log; import android.util.Log; import com.android.bluetooth.Utils; import com.android.bluetooth.Utils; Loading Loading @@ -356,6 +355,7 @@ public class ScanManager { } } private void removeScanFilters(int clientIf) { private void removeScanFilters(int clientIf) { logd("removeScanFilters, clientIf - " + clientIf); Deque<Integer> filterIndices = mClientFilterIndexMap.remove(clientIf); Deque<Integer> filterIndices = mClientFilterIndexMap.remove(clientIf); if (filterIndices != null) { if (filterIndices != null) { mFilterIndexStack.addAll(filterIndices); mFilterIndexStack.addAll(filterIndices); Loading Loading
android/app/src/com/android/bluetooth/gatt/AdvertiseManager.java +1 −8 Original line number Original line Diff line number Diff line Loading @@ -213,13 +213,6 @@ class AdvertiseManager { return numOfAdvtInstances - 1; return numOfAdvtInstances - 1; } } // Check whether all service uuids have been registered to GATT server. private boolean isAllServiceRegistered(AdvertiseClient client) { List<ParcelUuid> registeredUuids = mService.getRegisteredServiceUuids(); return containsAll(registeredUuids, client.advertiseData) && containsAll(registeredUuids, client.scanResponse); } // Check whether the registeredUuids contains all uuids in advertiseData. // Check whether the registeredUuids contains all uuids in advertiseData. private boolean containsAll(List<ParcelUuid> registeredUuids, AdvertiseData advertiseData) { private boolean containsAll(List<ParcelUuid> registeredUuids, AdvertiseData advertiseData) { if (advertiseData == null) { if (advertiseData == null) { Loading Loading @@ -321,7 +314,7 @@ class AdvertiseManager { if (data == null) { if (data == null) { return; return; } } boolean includeName = true; boolean includeName = data.getIncludeDeviceName(); boolean includeTxPower = data.getIncludeTxPowerLevel(); boolean includeTxPower = data.getIncludeTxPowerLevel(); int appearance = 0; int appearance = 0; byte[] manufacturerData = data.getManufacturerSpecificData() == null ? new byte[0] byte[] manufacturerData = data.getManufacturerSpecificData() == null ? new byte[0] Loading
android/app/src/com/android/bluetooth/gatt/GattService.java +3 −34 Original line number Original line Diff line number Diff line Loading @@ -285,28 +285,12 @@ public class GattService extends ProfileService { service.unregisterClient(clientIf); service.unregisterClient(clientIf); } } public void startScan(int appIf, boolean isServer) { GattService service = getService(); if (service == null) return; service.startScan(appIf, isServer); } public void startScanWithUuids(int appIf, boolean isServer, ParcelUuid[] ids) { GattService service = getService(); if (service == null) return; UUID[] uuids = new UUID[ids.length]; for(int i = 0; i != ids.length; ++i) { uuids[i] = ids[i].getUuid(); } service.startScanWithUuids(appIf, isServer, uuids); } @Override @Override public void startScanWithFilters(int appIf, boolean isServer, ScanSettings settings, public void startScan(int appIf, boolean isServer, ScanSettings settings, List<ScanFilter> filters) { List<ScanFilter> filters) { GattService service = getService(); GattService service = getService(); if (service == null) return; if (service == null) return; service.startScanWithFilters(appIf, isServer, settings, filters); service.startScan(appIf, isServer, settings, filters); } } public void stopScan(int appIf, boolean isServer) { public void stopScan(int appIf, boolean isServer) { Loading Loading @@ -1207,22 +1191,7 @@ public class GattService extends ProfileService { return deviceList; return deviceList; } } // TODO: Remove this and implement legacy scan using new logic. void startScan(int appIf, boolean isServer, ScanSettings settings, void startScan(int appIf, boolean isServer) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH_ADMIN permission"); configureScanParams(appIf); mScanManager.startScan(new ScanClient(appIf, false)); } // TODO: Remove this and implement legacy scan using new logic. void startScanWithUuids(int appIf, boolean isServer, UUID[] uuids) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH_ADMIN permission"); configureScanParams(appIf); mScanManager.startScan(new ScanClient(appIf, false, uuids)); } void startScanWithFilters(int appIf, boolean isServer, ScanSettings settings, List<ScanFilter> filters) { List<ScanFilter> filters) { if (DBG) Log.d(TAG, "start scan with filters "); if (DBG) Log.d(TAG, "start scan with filters "); enforceAdminPermission(); enforceAdminPermission(); Loading
android/app/src/com/android/bluetooth/gatt/ScanManager.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.os.Handler; import android.os.HandlerThread; import android.os.HandlerThread; import android.os.Looper; import android.os.Looper; import android.os.Message; import android.os.Message; import android.os.RemoteException; import android.util.Log; import android.util.Log; import com.android.bluetooth.Utils; import com.android.bluetooth.Utils; Loading Loading @@ -356,6 +355,7 @@ public class ScanManager { } } private void removeScanFilters(int clientIf) { private void removeScanFilters(int clientIf) { logd("removeScanFilters, clientIf - " + clientIf); Deque<Integer> filterIndices = mClientFilterIndexMap.remove(clientIf); Deque<Integer> filterIndices = mClientFilterIndexMap.remove(clientIf); if (filterIndices != null) { if (filterIndices != null) { mFilterIndexStack.addAll(filterIndices); mFilterIndexStack.addAll(filterIndices); Loading