package com.google.android.gms.internal.ads;

import android.content.Context;
import android.os.Binder;
import android.os.Bundle;
import android.os.Looper;
import android.os.Parcel;
import androidx.annotation.Nullable;

/* JADX INFO: loaded from: classes2.dex */
public final class lh1 implements com.google.android.gms.common.internal.b, com.google.android.gms.common.internal.c {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final wh1 f13694a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final th1 f13695b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final Object f13696c = new Object();

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public boolean f13697d = false;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public boolean f13698e = false;

    public lh1(Context context, Looper looper, th1 th1Var) {
        this.f13695b = th1Var;
        this.f13694a = new wh1(context, looper, this, this, 12800000);
    }

    public final void a() {
        synchronized (this.f13696c) {
            try {
                wh1 wh1Var = this.f13694a;
                if (wh1Var.isConnected() || wh1Var.isConnecting()) {
                    wh1Var.disconnect();
                }
                Binder.flushPendingCommands();
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    @Override // com.google.android.gms.common.internal.b
    public final void onConnected(@Nullable Bundle bundle) {
        synchronized (this.f13696c) {
            try {
                if (this.f13698e) {
                    return;
                }
                this.f13698e = true;
                try {
                    zh1 zh1VarC = this.f13694a.c();
                    vh1 vh1Var = new vh1(1, this.f13695b.b());
                    Parcel parcelO = zh1VarC.O();
                    aj.b(parcelO, vh1Var);
                    zh1VarC.O0(2, parcelO);
                } catch (Exception unused) {
                } catch (Throwable th) {
                    a();
                    throw th;
                }
                a();
            } catch (Throwable th2) {
                throw th2;
            }
        }
    }

    @Override // com.google.android.gms.common.internal.c
    public final void onConnectionFailed(e8.b bVar) {
    }

    @Override // com.google.android.gms.common.internal.b
    public final void onConnectionSuspended(int i10) {
    }
}
