package defpackage;

import android.content.ComponentName;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.IInterface;
import android.os.RemoteException;
import android.util.Log;
import j$.util.Objects;

/* renamed from: ᵖᵲˀ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class ServiceConnectionC2401 implements ServiceConnection {

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final /* synthetic */ Object f9356;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final /* synthetic */ int f9357;

    public /* synthetic */ ServiceConnectionC2401(int i, Object obj) {
        this.f9357 = i;
        this.f9356 = obj;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r4v8, types: [ːᵛ] */
    @Override // android.content.ServiceConnection
    public final void onServiceConnected(ComponentName componentName, IBinder iBinder) {
        C5421 c5421;
        InterfaceC2876 c4223;
        switch (this.f9357) {
            case 0:
                C1153 c1153 = (C1153) this.f9356;
                int i = BinderC0984.f4368;
                IInterface iInterfaceQueryLocalInterface = iBinder.queryLocalInterface(InterfaceC1969.f7931);
                if (iInterfaceQueryLocalInterface == null || !(iInterfaceQueryLocalInterface instanceof InterfaceC1969)) {
                    C5421 c54212 = new C5421();
                    c54212.f20319 = iBinder;
                    c5421 = c54212;
                } else {
                    c5421 = (InterfaceC1969) iInterfaceQueryLocalInterface;
                }
                c1153.f4925 = c5421;
                try {
                    c1153.f4926 = c5421.mo3345(c1153.f4931, c1153.f4929);
                    break;
                } catch (RemoteException unused) {
                    return;
                }
                break;
            default:
                AbstractC1845.m5207("BillingClientTesting", "Billing Override Service connected.");
                C0405 c0405 = (C0405) this.f9356;
                int i2 = AbstractBinderC4502.f16781;
                if (iBinder == null) {
                    c4223 = null;
                } else {
                    IInterface iInterfaceQueryLocalInterface2 = iBinder.queryLocalInterface("com.google.android.apps.play.billingtestcompanion.aidl.IBillingOverrideService");
                    c4223 = iInterfaceQueryLocalInterface2 instanceof InterfaceC2876 ? (InterfaceC2876) iInterfaceQueryLocalInterface2 : new C4223(iBinder, "com.google.android.apps.play.billingtestcompanion.aidl.IBillingOverrideService", 2);
                }
                c0405.f2294 = c4223;
                c0405.f2295 = 2;
                int i3 = AbstractC4993.f18532;
                C3659 c3659M10444 = AbstractC4993.m10444(26, EnumC2590.f10054);
                Objects.requireNonNull(c3659M10444, "ApiSuccess should not be null");
                C0553 c0553 = c0405.f14075;
                c0553.getClass();
                try {
                    c0553.m2365(c3659M10444, (C4559) c0553.f2892);
                    break;
                } catch (Throwable unused2) {
                    AbstractC1845.m5213("BillingLogger");
                }
        }
    }

    @Override // android.content.ServiceConnection
    public final void onServiceDisconnected(ComponentName componentName) {
        switch (this.f9357) {
            case 0:
                ((C1153) this.f9356).f4925 = null;
                break;
            default:
                int i = AbstractC1845.f7462;
                Log.isLoggable("BillingClientTesting", 5);
                C0405 c0405 = (C0405) this.f9356;
                c0405.f2294 = null;
                c0405.f2295 = 0;
                break;
        }
    }
}
