Pass a GBDevice instead of GBDeviceCandidate to getBondingStyle() #651
parent
60b7a73558
commit
b142add631
|
@ -584,7 +584,7 @@ public class DiscoveryActivity extends GBActivity implements AdapterView.OnItemC
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
} else {
|
} else {
|
||||||
GBDevice device = DeviceHelper.getInstance().toSupportedDevice(deviceCandidate);
|
GBDevice device = DeviceHelper.getInstance().toSupportedDevice(deviceCandidate);
|
||||||
int bondingStyle = coordinator.getBondingStyle(deviceCandidate);
|
int bondingStyle = coordinator.getBondingStyle(device);
|
||||||
if (bondingStyle == DeviceCoordinator.BONDING_STYLE_NONE) {
|
if (bondingStyle == DeviceCoordinator.BONDING_STYLE_NONE) {
|
||||||
LOG.info("No bonding needed, according to coordinator, so connecting right away");
|
LOG.info("No bonding needed, according to coordinator, so connecting right away");
|
||||||
connectAndFinish(device);
|
connectAndFinish(device);
|
||||||
|
|
|
@ -121,7 +121,7 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBondingStyle(GBDeviceCandidate deviceCandidate) {
|
public int getBondingStyle(GBDevice device) {
|
||||||
return BONDING_STYLE_ASK;
|
return BONDING_STYLE_ASK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@ import android.bluetooth.le.ScanFilter;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.support.annotation.DrawableRes;
|
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
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.
|
* 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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue