package ed;

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

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

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

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final h f25849d;

    public u(i iVar, String str) {
        this(iVar, str, a0.f25827a, null);
    }

    @UiThread
    public void invokeMethod(@NonNull String str, @Nullable Object obj) {
        invokeMethod(str, obj, null);
    }

    @UiThread
    public void setMethodCallHandler(@Nullable s sVar) {
        int i10 = 21;
        String str = this.f25847b;
        i iVar = this.f25846a;
        h hVar = this.f25849d;
        if (hVar != null) {
            iVar.setMessageHandler(str, sVar != null ? new xyz.stream.utils.f(this, sVar, i10) : null, hVar);
        } else {
            iVar.setMessageHandler(str, sVar != null ? new xyz.stream.utils.f(this, sVar, i10) : null);
        }
    }

    @UiThread
    public void invokeMethod(@NonNull String str, @Nullable Object obj, @Nullable t tVar) {
        this.f25846a.send(this.f25847b, this.f25848c.a(new q(str, obj)), tVar == null ? null : new r(this, tVar));
    }

    public u(@NonNull i iVar, @NonNull String str, @NonNull v vVar, @Nullable h hVar) {
        this.f25846a = iVar;
        this.f25847b = str;
        this.f25848c = vVar;
        this.f25849d = hVar;
    }
}
