Pass a GBDevice instead of GBDeviceCandidate to getBondingStyle() #651

master
cpfeiffer 2017-04-17 23:00:16 +02:00
parent 60b7a73558
commit b142add631
3 changed files with 4 additions and 5 deletions

View File

@ -584,7 +584,7 @@ public class DiscoveryActivity extends GBActivity implements AdapterView.OnItemC
startActivity(intent);
} else {
GBDevice device = DeviceHelper.getInstance().toSupportedDevice(deviceCandidate);
int bondingStyle = coordinator.getBondingStyle(deviceCandidate);
int bondingStyle = coordinator.getBondingStyle(device);
if (bondingStyle == DeviceCoordinator.BONDING_STYLE_NONE) {
LOG.info("No bonding needed, according to coordinator, so connecting right away");
connectAndFinish(device);

View File

@ -121,7 +121,7 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
}
@Override
public int getBondingStyle(GBDeviceCandidate deviceCandidate) {
public int getBondingStyle(GBDevice device) {
return BONDING_STYLE_ASK;
}
}

View File

@ -23,7 +23,6 @@ import android.bluetooth.le.ScanFilter;
import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@ -225,7 +224,7 @@ public interface DeviceCoordinator {
/**
* Returns how/if the given device should be bonded before connecting to it.
* @param deviceCandidate
* @param device
*/
int getBondingStyle(GBDeviceCandidate deviceCandidate);
int getBondingStyle(GBDevice device);
}