package androidx.lifecycle;

import android.app.Application;
import android.content.Context;
import android.os.Handler;
import java.util.HashSet;
import java.util.List;
import o.C0332Mv;
import o.C3126zm0;
import o.InterfaceC1848mH;
import o.QY;
import o.RY;
import o.UK;
import o.YK;
import o.ZK;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class ProcessLifecycleInitializer implements InterfaceC1848mH {
    @Override // o.InterfaceC1848mH
    public final List a() {
        return C0332Mv.l;
    }

    @Override // o.InterfaceC1848mH
    public final Object b(Context context) {
        if (!((HashSet) C3126zm0.B(context).n).contains(ProcessLifecycleInitializer.class)) {
            throw new IllegalStateException("ProcessLifecycleInitializer cannot be initialized lazily.\n               Please ensure that you have:\n               <meta-data\n                   android:name='androidx.lifecycle.ProcessLifecycleInitializer'\n                   android:value='androidx.startup' />\n               under InitializationProvider in your AndroidManifest.xml");
        }
        if (!ZK.a.getAndSet(true)) {
            ((Application) context.getApplicationContext()).registerActivityLifecycleCallbacks(new YK());
        }
        RY ry = RY.t;
        ry.getClass();
        ry.p = new Handler();
        ry.q.f(UK.ON_CREATE);
        ((Application) context.getApplicationContext()).registerActivityLifecycleCallbacks(new QY(ry));
        return ry;
    }
}
