mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 21:06:50 +01:00
Pass a GBDevice instead of GBDeviceCandidate to getBondingStyle() #651
This commit is contained in:
parent
60b7a73558
commit
b142add631
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user