package androidx.lifecycle;

import java.io.Closeable;
import java.io.IOException;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;

/* renamed from: androidx.lifecycle.c0 */
/* loaded from: classes.dex */
public abstract class AbstractC0405c0 {

    /* renamed from: a */
    public final Map<String, Object> f1616a = new HashMap();

    /* renamed from: b */
    public final Set<Closeable> f1617b = new LinkedHashSet();

    /* renamed from: c */
    public volatile boolean f1618c = false;

    /* renamed from: b */
    public static void m3722b(Object obj) {
        if (obj instanceof Closeable) {
            try {
                ((Closeable) obj).close();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }

    /* renamed from: a */
    public final void m3723a() {
        this.f1618c = true;
        Map<String, Object> map = this.f1616a;
        if (map != null) {
            synchronized (map) {
                for (Object obj : this.f1616a.values()) {
                    m3722b(obj);
                }
            }
        }
        Set<Closeable> set = this.f1617b;
        if (set != null) {
            synchronized (set) {
                for (Closeable closeable : this.f1617b) {
                    m3722b(closeable);
                }
            }
        }
        mo697d();
    }

    /* renamed from: c */
    public <T> T m3721c(String str) {
        T t;
        Map<String, Object> map = this.f1616a;
        if (map == null) {
            return null;
        }
        synchronized (map) {
            t = (T) this.f1616a.get(str);
        }
        return t;
    }

    /* renamed from: d */
    public void mo697d() {
    }
}