1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 21:06:50 +01:00

Fix normal mode connection

This commit is contained in:
Damien 'Psolyca' Gaignon 2024-01-21 21:37:44 +01:00
parent 0e5545191d
commit 0ed9e5b1a8
No known key found for this signature in database
GPG Key ID: 9E9404E5D9E11843

View File

@ -400,12 +400,16 @@ public class HuaweiSupportProvider {
try { try {
createSecretKey(); createSecretKey();
GetAuthRequest authReq = new GetAuthRequest(this, linkParamsReq); GetAuthRequest authReq = new GetAuthRequest(this, linkParamsReq);
if (getHuaweiType() == HuaweiDeviceType.BLE) {
GetBondParamsRequest bondParamsReq = new GetBondParamsRequest(this); GetBondParamsRequest bondParamsReq = new GetBondParamsRequest(this);
GetBondRequest bondReq = new GetBondRequest(this); GetBondRequest bondReq = new GetBondRequest(this);
authReq.nextRequest(bondParamsReq); authReq.nextRequest(bondParamsReq);
bondParamsReq.nextRequest(bondReq); bondParamsReq.nextRequest(bondReq);
bondParamsReq.setFinalizeReq(configureReq); bondParamsReq.setFinalizeReq(configureReq);
bondReq.setFinalizeReq(configureReq); bondReq.setFinalizeReq(configureReq);
} else {
authReq.setFinalizeReq(configureReq);
}
authReq.doPerform(); authReq.doPerform();
} catch (IOException e) { } catch (IOException e) {
GB.toast(context, "init Normal Mode of Huawei device failed", Toast.LENGTH_SHORT, GB.ERROR, e); GB.toast(context, "init Normal Mode of Huawei device failed", Toast.LENGTH_SHORT, GB.ERROR, e);