ScanSettings.Builder builder = new ScanSettings.Builder();
builder.setCallbackType(ScanSettings.CALLBACK_TYPE_ALL_MATCHES);
builder.setCallbackType(ScanSettings.CALLBACK_TYPE_FIRST_MATCH);
builder.setCallbackType(ScanSettings.CALLBACK_TYPE_MATCH_LOST);
builder.setCallbackType(
ScanSettings.CALLBACK_TYPE_FIRST_MATCH | ScanSettings.CALLBACK_TYPE_MATCH_LOST);
try {
builder.setCallbackType(
ScanSettings.CALLBACK_TYPE_ALL_MATCHES | ScanSettings.CALLBACK_TYPE_MATCH_LOST);
fail("should have thrown IllegalArgumentException!");
} catch (IllegalArgumentException e) {
// nothing to do
}
try {
builder.setCallbackType(
ScanSettings.CALLBACK_TYPE_ALL_MATCHES |
ScanSettings.CALLBACK_TYPE_FIRST_MATCH);
fail("should have thrown IllegalArgumentException!");
} catch (IllegalArgumentException e) {
// nothing to do
}
try {
builder.setCallbackType(
ScanSettings.CALLBACK_TYPE_ALL_MATCHES |
ScanSettings.CALLBACK_TYPE_FIRST_MATCH |
ScanSettings.CALLBACK_TYPE_MATCH_LOST);
fail("should have thrown IllegalArgumentException!");
} catch (IllegalArgumentException e) {
// nothing to do
}