package o;

import android.content.ComponentName;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.IInterface;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.lr0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class ServiceConnectionC1807lr0 implements ServiceConnection {
    public final String a;
    public final /* synthetic */ C1902mr0 b;

    public ServiceConnectionC1807lr0(C1902mr0 c1902mr0, String str) {
        this.b = c1902mr0;
        this.a = str;
    }

    @Override // android.content.ServiceConnection
    public final void onServiceConnected(ComponentName componentName, IBinder iBinder) {
        C1902mr0 c1902mr0 = this.b;
        if (iBinder == null) {
            Nq0 nq0 = c1902mr0.a.f;
            Kr0.l(nq0);
            nq0.i.b("Install Referrer connection returned with null binder");
            return;
        }
        try {
            int i = Wo0.d;
            IInterface iInterfaceQueryLocalInterface = iBinder.queryLocalInterface("com.google.android.finsky.externalreferrer.IGetInstallReferrerService");
            Xo0 vo0 = iInterfaceQueryLocalInterface instanceof Xo0 ? (Xo0) iInterfaceQueryLocalInterface : new Vo0(iBinder, "com.google.android.finsky.externalreferrer.IGetInstallReferrerService");
            Kr0 kr0 = c1902mr0.a;
            Nq0 nq02 = kr0.f;
            Kr0.l(nq02);
            nq02.n.b("Install Referrer Service connected");
            Fr0 fr0 = kr0.g;
            Kr0.l(fr0);
            fr0.B(new RunnableC0890cD(this, vo0, this));
        } catch (RuntimeException e) {
            Nq0 nq03 = c1902mr0.a.f;
            Kr0.l(nq03);
            nq03.i.c(e, "Exception occurred while calling Install Referrer API");
        }
    }

    @Override // android.content.ServiceConnection
    public final void onServiceDisconnected(ComponentName componentName) {
        Nq0 nq0 = this.b.a.f;
        Kr0.l(nq0);
        nq0.n.b("Install Referrer Service disconnected");
    }
}
