mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
miband: fix setUpdateState
This commit is contained in:
committed by
José Rebelo
parent
161c89cfcf
commit
2e8c38d255
+3
-6
@@ -1006,8 +1006,7 @@ public class MiBandSupport extends AbstractBTLESingleDeviceSupport {
|
||||
case MiBandService.NOTIFY_AUTHENTICATION_FAILED:
|
||||
// we get first FAILED, then NOTIFY_STATUS_MOTOR_AUTH (0x13)
|
||||
// which means, we need to authenticate by tapping
|
||||
getDevice().setState(State.AUTHENTICATION_REQUIRED);
|
||||
getDevice().sendDeviceUpdateIntent(getContext());
|
||||
getDevice().setUpdateState(State.AUTHENTICATION_REQUIRED, getContext());
|
||||
GB.toast(getContext(), "Band needs pairing", Toast.LENGTH_LONG, GB.ERROR);
|
||||
break;
|
||||
case MiBandService.NOTIFY_AUTHENTICATION_SUCCESS: // fall through -- not sure which one we get
|
||||
@@ -1020,8 +1019,7 @@ public class MiBandSupport extends AbstractBTLESingleDeviceSupport {
|
||||
|
||||
case MiBandService.NOTIFY_STATUS_MOTOR_AUTH:
|
||||
LOG.info("Band needs authentication (MOTOR_AUTH)");
|
||||
getDevice().setState(State.AUTHENTICATING);
|
||||
getDevice().sendDeviceUpdateIntent(getContext());
|
||||
getDevice().setUpdateState(State.AUTHENTICATING, getContext());
|
||||
break;
|
||||
|
||||
case MiBandService.NOTIFY_SET_LATENCY_SUCCESS:
|
||||
@@ -1125,8 +1123,7 @@ public class MiBandSupport extends AbstractBTLESingleDeviceSupport {
|
||||
}
|
||||
|
||||
private void setConnectionState(State newState) {
|
||||
getDevice().setState(newState);
|
||||
getDevice().sendDeviceUpdateIntent(getContext());
|
||||
getDevice().setUpdateState(newState, getContext());
|
||||
}
|
||||
|
||||
private void handlePairResult(byte[] pairResult, int status) {
|
||||
|
||||
Reference in New Issue
Block a user