mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-25 03:16:51 +01:00
Xiaomi: temporary fix for database errors when reconnecting
This commit is contained in:
parent
7f68dc5449
commit
b395e889c3
@ -113,8 +113,10 @@ public class XiaomiBleSupport extends XiaomiConnectionSupport {
|
||||
}
|
||||
|
||||
// FIXME unsetDynamicState unsets the fw version, which causes problems..
|
||||
if (getDevice().getFirmwareVersion() == null && mXiaomiSupport.getCachedFirmwareVersion() != null) {
|
||||
getDevice().setFirmwareVersion(mXiaomiSupport.getCachedFirmwareVersion());
|
||||
if (getDevice().getFirmwareVersion() == null) {
|
||||
getDevice().setFirmwareVersion(mXiaomiSupport.getCachedFirmwareVersion() != null ?
|
||||
mXiaomiSupport.getCachedFirmwareVersion() :
|
||||
"N/A");
|
||||
}
|
||||
|
||||
if (btCharacteristicCommandRead == null || btCharacteristicCommandWrite == null) {
|
||||
|
@ -71,8 +71,10 @@ public class XiaomiSppSupport extends XiaomiConnectionSupport {
|
||||
@Override
|
||||
protected TransactionBuilder initializeDevice(TransactionBuilder builder) {
|
||||
// FIXME unsetDynamicState unsets the fw version, which causes problems..
|
||||
if (getDevice().getFirmwareVersion() == null && mXiaomiSupport.getCachedFirmwareVersion() != null) {
|
||||
getDevice().setFirmwareVersion(mXiaomiSupport.getCachedFirmwareVersion());
|
||||
if (getDevice().getFirmwareVersion() == null) {
|
||||
getDevice().setFirmwareVersion(mXiaomiSupport.getCachedFirmwareVersion() != null ?
|
||||
mXiaomiSupport.getCachedFirmwareVersion() :
|
||||
"N/A");
|
||||
}
|
||||
|
||||
builder.add(new SetDeviceStateAction(getDevice(), GBDevice.State.INITIALIZING, getContext()));
|
||||
|
@ -178,7 +178,7 @@ public class XiaomiSupport extends AbstractDeviceSupport {
|
||||
|
||||
public void setContext(final GBDevice device, final BluetoothAdapter adapter, final Context context) {
|
||||
// FIXME unsetDynamicState unsets the fw version, which causes problems..
|
||||
if (getCachedFirmwareVersion() == null && device.getFirmwareVersion() != null) {
|
||||
if (device.getFirmwareVersion() != null) {
|
||||
setCachedFirmwareVersion(device.getFirmwareVersion());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user