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

import android.os.RemoteException;
import android.text.TextUtils;
import java.util.Collections;
import java.util.concurrent.atomic.AtomicReference;

/* JADX INFO: loaded from: classes2.dex */
public final class f3 implements Runnable {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ AtomicReference f21576a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ String f21577b = null;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ String f21578c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ String f21579d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ d4 f21580e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final /* synthetic */ boolean f21581f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final /* synthetic */ a3 f21582g;

    public f3(a3 a3Var, AtomicReference atomicReference, String str, String str2, d4 d4Var, boolean z10) {
        this.f21576a = atomicReference;
        this.f21578c = str;
        this.f21579d = str2;
        this.f21580e = d4Var;
        this.f21581f = z10;
        this.f21582g = a3Var;
    }

    @Override // java.lang.Runnable
    public final void run() {
        a3 a3Var;
        h0 h0Var;
        synchronized (this.f21576a) {
            try {
                a3Var = this.f21582g;
                h0Var = a3Var.f21472d;
            } catch (RemoteException e10) {
                this.f21582g.zzj().f21834f.d("(legacy) Failed to get user properties; remote exception", p0.A(this.f21577b), this.f21578c, e10);
                this.f21576a.set(Collections.emptyList());
            } finally {
                this.f21576a.notify();
            }
            if (h0Var == null) {
                a3Var.zzj().f21834f.d("(legacy) Failed to get user properties; not connected to service", p0.A(this.f21577b), this.f21578c, this.f21579d);
                this.f21576a.set(Collections.emptyList());
                return;
            }
            if (TextUtils.isEmpty(this.f21577b)) {
                com.google.android.gms.common.internal.w.checkNotNull(this.f21580e);
                this.f21576a.set(h0Var.zza(this.f21578c, this.f21579d, this.f21581f, this.f21580e));
            } else {
                this.f21576a.set(h0Var.zza(this.f21577b, this.f21578c, this.f21579d, this.f21581f));
            }
            this.f21582g.R();
        }
    }
}
