package com.bytedance.hybrid.pia.bridge.protocol;

import X.C1803KiY;
import X.M12;
import com.bytedance.covode.number.Covode;
import com.bytedance.hybrid.pia.bridge.protocol.Callback;
import com.bytedance.hybrid.pia.bridge.protocol.ProtocolMessage;
import kotlin.h.b.n;

public final class MessageHandle$onPortMessage$callback$1 implements Callback {
    public final /* synthetic */ ProtocolMessage $msg;
    public final /* synthetic */ MessageHandle this$0;

    static {
        Covode.recordClassIndex(27668);
    }

    public MessageHandle$onPortMessage$callback$1(MessageHandle messageHandle, ProtocolMessage protocolMessage) {
        this.this$0 = messageHandle;
        this.$msg = protocolMessage;
    }

    public final void invoke(Callback.Status status, String str) {
        M12.LIZ((Object) status);
        C1803KiY kiY = this.this$0.mPort;
        ProtocolMessage.Companion companion = ProtocolMessage.Companion;
        Integer id = this.$msg.getId();
        if (id == null) {
            n.LIZ();
        }
        ProtocolMessage createCallback = companion.createCallback(id.intValue(), status, str);
        if (createCallback == null) {
            n.LIZ();
        }
        kiY.LIZ(createCallback.encode());
    }
}
