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,16 +272,13 @@ public class XiaomiSppSupport extends XiaomiConnectionSupport {
payload = mXiaomiSupport.getAuthService().decrypt(payload);
}
int channel = packet.getChannel();
if (mChannelHandlers.containsKey(channel)) {
XiaomiChannelHandler handler = mChannelHandlers.get(channel);
if (handler != null)
final XiaomiChannelHandler handler = mChannelHandlers.get(packet.getChannel());
if (handler != null) {
handler.handle(payload);
}
} else {
LOG.warn("Unhandled SppPacket on channel {}", packet.getChannel());
}
}
@Override
public void sendCommand(final String taskName, final XiaomiProto.Command command) {