package ed;

import androidx.annotation.Nullable;
import androidx.annotation.UiThread;

/* JADX INFO: loaded from: classes.dex */
public final class e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final i f25832a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final String f25833b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final p f25834c;

    @Nullable
    private final h taskQueue;

    public e(i iVar, String str, p pVar, h hVar) {
        this.f25832a = iVar;
        this.f25833b = str;
        this.f25834c = pVar;
        this.taskQueue = hVar;
    }

    public void send(@Nullable Object obj) {
        send(obj, null);
    }

    @UiThread
    public void setMessageHandler(@Nullable c cVar) {
        h hVar = this.taskQueue;
        String str = this.f25833b;
        i iVar = this.f25832a;
        if (hVar != null) {
            iVar.setMessageHandler(str, cVar != null ? new a(this, cVar) : null, hVar);
        } else {
            iVar.setMessageHandler(str, cVar != null ? new a(this, cVar) : null);
        }
    }

    @UiThread
    public void send(@Nullable Object obj, @Nullable d dVar) {
        this.f25832a.send(this.f25833b, this.f25834c.encodeMessage(obj), dVar == null ? null : new b(this, dVar));
    }
}
