package n5;

import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
import java.util.WeakHashMap;

/* JADX INFO: loaded from: classes.dex */
public final class a implements h {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public boolean f30850a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public boolean f30851b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final Object f30852c;

    public /* synthetic */ a(String str, boolean z10, boolean z11) {
        this.f30852c = str;
        this.f30850a = z10;
        this.f30851b = z11;
    }

    public final void a() {
        this.f30851b = true;
        Iterator it = t5.p.c((Set) this.f30852c).iterator();
        while (it.hasNext()) {
            ((i) it.next()).onDestroy();
        }
    }

    public final void b() {
        this.f30850a = true;
        Iterator it = t5.p.c((Set) this.f30852c).iterator();
        while (it.hasNext()) {
            ((i) it.next()).d();
        }
    }

    public final void c() {
        this.f30850a = false;
        Iterator it = t5.p.c((Set) this.f30852c).iterator();
        while (it.hasNext()) {
            ((i) it.next()).b();
        }
    }

    @Override // n5.h
    public final void f(i iVar) {
        ((Set) this.f30852c).add(iVar);
        if (this.f30851b) {
            iVar.onDestroy();
        } else if (this.f30850a) {
            iVar.d();
        } else {
            iVar.b();
        }
    }

    @Override // n5.h
    public final void i(i iVar) {
        ((Set) this.f30852c).remove(iVar);
    }

    public a() {
        this.f30852c = Collections.newSetFromMap(new WeakHashMap());
    }
}
