mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-03-13 01:30:09 +01:00
HuaweiSupportProvider: Fix reconnect on AuthFailure
When authentication times out the gadget was slightly out of range. Since communication was successfull a couple of seconds earlier try to reconnect instead of just disconnect. Fixes Huawei watches not automatically reconnecting during normal use. Signed-off-by: Patrick Rudolph <rudolphpatrick05@gmail.com>
This commit is contained in:
parent
7458c582e1
commit
033e263b6b
@ -562,10 +562,11 @@ public class HuaweiSupportProvider {
|
||||
public void timeout(Request request) {
|
||||
LOG.error("Authentication timed out");
|
||||
GB.toast(context, R.string.authentication_failed_negotiation, Toast.LENGTH_LONG, GB.ERROR);
|
||||
// Disconnect as no communication can succeed after this point
|
||||
// Reconnect as no communication can succeed after this point
|
||||
final GBDevice device = getDevice();
|
||||
if (device != null) {
|
||||
GBApplication.deviceService(device).disconnect();
|
||||
device.setState(GBDevice.State.WAITING_FOR_RECONNECT);
|
||||
device.sendDeviceUpdateIntent(getContext());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user