Bluetooth ScanFilter: Allow null in setDeviceAddress

Bug: 187076761
Test: manual scan filter test
Change-Id: I6456be4baab4b2a2b6d4607619ff92370b8b457d
This commit is contained in:
Myles Watson
2021-05-10 13:51:17 -07:00
parent 60cd2fa626
commit 025714ff33

View File

@@ -587,6 +587,10 @@ public final class ScanFilter implements Parcelable {
* @throws IllegalArgumentException If the {@code deviceAddress} is invalid.
*/
public Builder setDeviceAddress(String deviceAddress) {
if (deviceAddress == null) {
mDeviceAddress = deviceAddress;
return this;
}
return setDeviceAddress(deviceAddress, BluetoothDevice.ADDRESS_TYPE_PUBLIC);
}