1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-09 03:37:03 +01:00

Xiaomi Spp: Fix logging of unhandled packets

This commit is contained in:
José Rebelo 2024-06-30 09:11:45 +01:00
parent 16018879ba
commit f2d935bfc1

View File

@ -272,15 +272,12 @@ public class XiaomiSppSupport extends XiaomiConnectionSupport {
payload = mXiaomiSupport.getAuthService().decrypt(payload); payload = mXiaomiSupport.getAuthService().decrypt(payload);
} }
int channel = packet.getChannel(); final XiaomiChannelHandler handler = mChannelHandlers.get(packet.getChannel());
if (mChannelHandlers.containsKey(channel)) { if (handler != null) {
XiaomiChannelHandler handler = mChannelHandlers.get(channel); handler.handle(payload);
} else {
if (handler != null) LOG.warn("Unhandled SppPacket on channel {}", packet.getChannel());
handler.handle(payload);
} }
LOG.warn("Unhandled SppPacket on channel {}", packet.getChannel());
} }
@Override @Override