package P2;

import android.os.Bundle;
import android.os.IBinder;
import android.os.Parcel;
import android.util.Log;

/* JADX INFO: loaded from: classes.dex */
public final class z extends Y2.a {

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public AbstractC0248e f5445f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final int f5446g;

    public z(AbstractC0248e abstractC0248e, int i) {
        super("com.google.android.gms.common.internal.IGmsCallbacks");
        this.f5445f = abstractC0248e;
        this.f5446g = i;
    }

    @Override // Y2.a
    public final boolean K(int i, Parcel parcel, Parcel parcel2) {
        if (i == 1) {
            int i5 = parcel.readInt();
            IBinder strongBinder = parcel.readStrongBinder();
            Bundle bundle = (Bundle) Z2.b.a(parcel, Bundle.CREATOR);
            Z2.b.b(parcel);
            w.g(this.f5445f, "onPostInitComplete can be called only once per call to getRemoteService");
            AbstractC0248e abstractC0248e = this.f5445f;
            abstractC0248e.getClass();
            B b8 = new B(abstractC0248e, i5, strongBinder, bundle);
            y yVar = abstractC0248e.f5366f;
            yVar.sendMessage(yVar.obtainMessage(1, this.f5446g, -1, b8));
            this.f5445f = null;
        } else if (i == 2) {
            parcel.readInt();
            Z2.b.b(parcel);
            Log.wtf("GmsClient", "received deprecated onAccountValidationComplete callback, ignoring", new Exception());
        } else {
            if (i != 3) {
                return false;
            }
            int i8 = parcel.readInt();
            IBinder strongBinder2 = parcel.readStrongBinder();
            D d8 = (D) Z2.b.a(parcel, D.CREATOR);
            Z2.b.b(parcel);
            AbstractC0248e abstractC0248e2 = this.f5445f;
            w.g(abstractC0248e2, "onPostInitCompleteWithConnectionInfo can be called only once per call togetRemoteService");
            w.f(d8);
            abstractC0248e2.f5381v = d8;
            Bundle bundle2 = d8.f5333q;
            w.g(this.f5445f, "onPostInitComplete can be called only once per call to getRemoteService");
            AbstractC0248e abstractC0248e3 = this.f5445f;
            abstractC0248e3.getClass();
            B b9 = new B(abstractC0248e3, i8, strongBinder2, bundle2);
            y yVar2 = abstractC0248e3.f5366f;
            yVar2.sendMessage(yVar2.obtainMessage(1, this.f5446g, -1, b9));
            this.f5445f = null;
        }
        parcel2.writeNoException();
        return true;
    }
}
