package com.google.android.gms.common.api;

import android.accounts.Account;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.os.Looper;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.google.android.gms.common.Feature;
import com.google.android.gms.common.annotation.KeepForSdk;
import com.google.android.gms.common.api.Api.ApiOptions;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.internal.ConnectionCallbacks;
import com.google.android.gms.common.api.internal.OnConnectionFailedListener;
import com.google.android.gms.common.internal.BaseGmsClient;
import com.google.android.gms.common.internal.ClientSettings;
import com.google.android.gms.common.internal.IAccountAccessor;
import com.google.android.gms.common.internal.Preconditions;
import defpackage.rq6;
import defpackage.sma;
import defpackage.vo6;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.Collections;
import java.util.List;
import java.util.Set;

/* JADX INFO: loaded from: classes2.dex */
public final class Api<O extends ApiOptions> {
    private final AbstractClientBuilder zaa;
    private final ClientKey zab;
    private final String zac;

    @KeepForSdk
    public static abstract class AbstractClientBuilder<T extends Client, O> extends BaseClientBuilder<T, O> {
        @vo6
        @KeepForSdk
        @Deprecated
        public T buildClient(@vo6 Context context, @vo6 Looper looper, @vo6 ClientSettings clientSettings, @vo6 O o, @vo6 GoogleApiClient.ConnectionCallbacks connectionCallbacks, @vo6 GoogleApiClient.OnConnectionFailedListener onConnectionFailedListener) {
            return (T) buildClient(context, looper, clientSettings, (Object) o, (ConnectionCallbacks) connectionCallbacks, (OnConnectionFailedListener) onConnectionFailedListener);
        }

        @vo6
        @KeepForSdk
        public T buildClient(@vo6 Context context, @vo6 Looper looper, @vo6 ClientSettings clientSettings, @vo6 O o, @vo6 ConnectionCallbacks connectionCallbacks, @vo6 OnConnectionFailedListener onConnectionFailedListener) {
            throw new UnsupportedOperationException("buildClient must be implemented");
        }
    }

    @KeepForSdk
    public interface AnyClient {
    }

    @KeepForSdk
    public static class AnyClientKey<C extends AnyClient> {
    }

    public interface ApiOptions {

        @vo6
        public static final NoOptions NO_OPTIONS = new NoOptions(null);

        public interface HasAccountOptions extends HasOptions, NotRequiredOptions {
            @vo6
            Account getAccount();
        }

        public interface HasGoogleSignInAccountOptions extends HasOptions {
            @rq6
            GoogleSignInAccount getGoogleSignInAccount();
        }

        public interface HasOptions extends ApiOptions {
        }

        public static final class NoOptions implements NotRequiredOptions {
            private NoOptions() {
            }

            public /* synthetic */ NoOptions(zaa zaaVar) {
            }
        }

        public interface NotRequiredOptions extends ApiOptions {
        }

        public interface Optional extends HasOptions, NotRequiredOptions {
        }
    }

    @sma
    @KeepForSdk
    public static abstract class BaseClientBuilder<T extends AnyClient, O> {

        @KeepForSdk
        public static final int API_PRIORITY_GAMES = 1;

        @KeepForSdk
        public static final int API_PRIORITY_OTHER = Integer.MAX_VALUE;

        @KeepForSdk
        public static final int API_PRIORITY_PLUS = 2;

        @vo6
        @KeepForSdk
        public List<Scope> getImpliedScopes(@rq6 O o) {
            return Collections.EMPTY_LIST;
        }

        @KeepForSdk
        public int getPriority() {
            return Integer.MAX_VALUE;
        }
    }

    @KeepForSdk
    public interface Client extends AnyClient {
        @KeepForSdk
        void connect(@vo6 BaseGmsClient.ConnectionProgressReportCallbacks connectionProgressReportCallbacks);

        @KeepForSdk
        void disconnect();

        @KeepForSdk
        void disconnect(@vo6 String str);

        @KeepForSdk
        void dump(@vo6 String str, @rq6 FileDescriptor fileDescriptor, @vo6 PrintWriter printWriter, @rq6 String[] strArr);

        @vo6
        @KeepForSdk
        Feature[] getAvailableFeatures();

        @vo6
        @KeepForSdk
        String getEndpointPackageName();

        @rq6
        @KeepForSdk
        String getLastDisconnectMessage();

        @KeepForSdk
        int getMinApkVersion();

        @KeepForSdk
        void getRemoteService(@rq6 IAccountAccessor iAccountAccessor, @rq6 Set<Scope> set);

        @vo6
        @KeepForSdk
        Feature[] getRequiredFeatures();

        @vo6
        @KeepForSdk
        Set<Scope> getScopesForConnectionlessNonSignIn();

        @rq6
        @KeepForSdk
        IBinder getServiceBrokerBinder();

        @vo6
        @KeepForSdk
        Intent getSignInIntent();

        @KeepForSdk
        boolean isConnected();

        @KeepForSdk
        boolean isConnecting();

        @KeepForSdk
        void onUserSignOut(@vo6 BaseGmsClient.SignOutCallbacks signOutCallbacks);

        @KeepForSdk
        boolean providesSignIn();

        @KeepForSdk
        boolean requiresAccount();

        @KeepForSdk
        boolean requiresGooglePlayServices();

        @KeepForSdk
        boolean requiresSignIn();
    }

    @KeepForSdk
    public static final class ClientKey<C extends Client> extends AnyClientKey<C> {
    }

    @KeepForSdk
    public <C extends Client> Api(@vo6 String str, @vo6 AbstractClientBuilder<C, O> abstractClientBuilder, @vo6 ClientKey<C> clientKey) {
        Preconditions.checkNotNull(abstractClientBuilder, "Cannot construct an Api with a null ClientBuilder");
        Preconditions.checkNotNull(clientKey, "Cannot construct an Api with a null ClientKey");
        this.zac = str;
        this.zaa = abstractClientBuilder;
        this.zab = clientKey;
    }

    @vo6
    public final AbstractClientBuilder zaa() {
        return this.zaa;
    }

    @vo6
    public final AnyClientKey zab() {
        return this.zab;
    }

    @vo6
    public final BaseClientBuilder zac() {
        return this.zaa;
    }

    @vo6
    public final String zad() {
        return this.zac;
    }
}
