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

import android.content.Context;
import android.os.Build;
import android.view.View;
import java.util.HashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/* JADX INFO: loaded from: classes2.dex */
public final class hp1 implements bp1, cl1 {

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public static final String[] f12229g = {"android:establish_vpn_service", "android:establish_vpn_manager"};

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

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public long f12232c = 0;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public long f12233d = 0;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public long f12234e = -1;

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

    public hp1(Context context, ExecutorService executorService, String[] strArr) {
        this.f12230a = context;
        this.f12231b = executorService;
    }

    @Override // com.google.android.gms.internal.ads.bp1
    public final void a(HashMap map) {
        d();
    }

    @Override // com.google.android.gms.internal.ads.bp1
    public final void b(HashMap map) {
        long j10;
        long j11;
        d();
        synchronized (this) {
            try {
                j10 = this.f12235f ? this.f12233d - this.f12232c : -1L;
            } finally {
            }
        }
        map.put("vs", Long.valueOf(j10));
        synchronized (this) {
            j11 = this.f12234e;
            this.f12234e = -1L;
        }
        map.put("vf", Long.valueOf(j11));
    }

    @Override // com.google.android.gms.internal.ads.bp1
    public final void c(HashMap map, Context context, View view) {
        d();
    }

    public final void d() {
        synchronized (this) {
            try {
                if (this.f12235f) {
                    this.f12233d = System.currentTimeMillis();
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    @Override // com.google.android.gms.internal.ads.cl1
    public final com.google.common.util.concurrent.w zza() {
        if (Build.VERSION.SDK_INT < 30) {
            return bv1.f9665b;
        }
        ov1 ov1Var = new ov1(Executors.callable(new na1(this, 13), null));
        this.f12231b.execute(ov1Var);
        return ov1Var;
    }
}
