package o;

import com.google.android.gms.common.api.internal.BackgroundDetector;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.concurrent.atomic.AtomicReference;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.Ay, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C0024Ay implements BackgroundDetector.BackgroundStateChangeListener {
    public static final AtomicReference a = new AtomicReference();

    @Override // com.google.android.gms.common.api.internal.BackgroundDetector.BackgroundStateChangeListener
    public final void onBackgroundStateChanged(boolean z) {
        synchronized (C0076Cy.k) {
            try {
                ArrayList arrayList = new ArrayList(C0076Cy.l.values());
                int size = arrayList.size();
                int i = 0;
                while (i < size) {
                    Object obj = arrayList.get(i);
                    i++;
                    C0076Cy c0076Cy = (C0076Cy) obj;
                    if (c0076Cy.e.get()) {
                        Iterator it = c0076Cy.i.iterator();
                        while (it.hasNext()) {
                            C0076Cy c0076Cy2 = ((C3147zy) it.next()).a;
                            if (!z) {
                                ((C0945cq) c0076Cy2.h.get()).b();
                            }
                        }
                    }
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }
}
