package o;

import com.google.android.gms.common.internal.Preconditions;
import java.util.concurrent.ScheduledExecutorService;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class Jt0 implements Runnable {
    public final /* synthetic */ int l;
    public final /* synthetic */ InterfaceC2185pq0 m;
    public final /* synthetic */ Qt0 n;

    public /* synthetic */ Jt0(Qt0 qt0, InterfaceC2185pq0 interfaceC2185pq0, int i) {
        this.l = i;
        this.m = interfaceC2185pq0;
        this.n = qt0;
    }

    @Override // java.lang.Runnable
    public final void run() {
        switch (this.l) {
            case 0:
                Qt0 qt0 = this.n;
                synchronized (qt0) {
                    try {
                        qt0.a = false;
                        Vt0 vt0 = qt0.c;
                        if (!vt0.J()) {
                            Nq0 nq0 = ((Kr0) vt0.a).f;
                            Kr0.l(nq0);
                            nq0.n.b("Connected to service");
                            InterfaceC2185pq0 interfaceC2185pq0 = this.m;
                            vt0.r();
                            Preconditions.checkNotNull(interfaceC2185pq0);
                            vt0.d = interfaceC2185pq0;
                            vt0.F();
                            vt0.H();
                        }
                    } finally {
                    }
                }
                return;
            default:
                Qt0 qt02 = this.n;
                synchronized (qt02) {
                    try {
                        qt02.a = false;
                        Vt0 vt02 = qt02.c;
                        if (!vt02.J()) {
                            Nq0 nq02 = ((Kr0) vt02.a).f;
                            Kr0.l(nq02);
                            nq02.m.b("Connected to remote service");
                            InterfaceC2185pq0 interfaceC2185pq02 = this.m;
                            vt02.r();
                            Preconditions.checkNotNull(interfaceC2185pq02);
                            vt02.d = interfaceC2185pq02;
                            vt02.F();
                            vt02.H();
                        }
                    } finally {
                    }
                }
                Vt0 vt03 = this.n.c;
                ScheduledExecutorService scheduledExecutorService = vt03.g;
                if (scheduledExecutorService != null) {
                    scheduledExecutorService.shutdownNow();
                    vt03.g = null;
                    return;
                }
                return;
        }
    }
}
