package com.ss.android.ugc.aweme.compliance.protection.serviceimpl;

import X.AnonymousClass3BB;
import X.AnonymousClass40F;
import X.AnonymousClass40M;
import X.AnonymousClass40P;
import X.AnonymousClass40S;
import X.AnonymousClass40W;
import X.C45493zZ;
import X.C45623zm;
import X.C45693zt;
import X.C45713zv;
import X.C457640a;
import X.C474046i;
import X.Epg;
import X.Epj;
import X.KCq;
import X.KT7;
import X.Lnj;
import X.M12;
import android.content.Context;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.ss.android.ugc.aweme.IAccountUserService;
import com.ss.android.ugc.aweme.compliance.api.services.teenmode.IProtectionService;
import com.ss.android.ugc.aweme.compliance.protection.familypairing.FamilyPiaringManager;
import com.ss.android.ugc.aweme.compliance.protection.jsb.GetDigitalWellbeingStatusMethod;
import com.ss.android.ugc.aweme.compliance.protection.jsb.PopDigitalWellbeingVerifyViewMethod;
import com.ss.android.ugc.aweme.compliance.protection.jsb.SetDigitalWellbeingStatusMethod;
import java.util.ArrayList;
import java.util.List;
import kotlin.h.b.n;

public final class ProtectionServiceImpl implements IProtectionService {
    static {
        Covode.recordClassIndex(62128);
    }

    public final void LJI() {
        C45693zt.LIZJ = false;
    }

    public final boolean LJFF() {
        return C45693zt.LIZJ;
    }

    public final int LIZIZ() {
        return AnonymousClass40F.LIZIZ.LIZLLL();
    }

    public final boolean LIZJ() {
        return AnonymousClass40F.LIZIZ.LIZ();
    }

    public final void LJIIIIZZ() {
        AnonymousClass40F.LIZIZ.LJ();
    }

    public final Epj LJIIIZ() {
        return new Epg();
    }

    public final void LJIIJ() {
        C457640a.LIZIZ.LIZ(4);
    }

    public final boolean LIZ() {
        return AnonymousClass40F.LIZIZ.LIZIZ();
    }

    public final int LJII() {
        if (C45693zt.LIZLLL.LIZ()) {
            return 1;
        }
        return 0;
    }

    public final boolean LIZLLL() {
        AnonymousClass40W LIZ = FamilyPiaringManager.LIZIZ.LIZ();
        if (LIZ == AnonymousClass40W.CHILD || LIZ == AnonymousClass40W.UNLINK_LOCKED) {
            IAccountUserService LJFF = C474046i.LJFF();
            n.LIZIZ(LJFF, "");
            if (LJFF.isLogin()) {
                return true;
            }
        }
        return C45693zt.LIZLLL.LJ();
    }

    public final void LJ() {
        C45693zt r2 = C45693zt.LIZLLL;
        C45713zv r0 = C45693zt.LIZ;
        if (r0 != null) {
            r0.setRestrictModeSelf(false);
        }
        C45713zv r02 = C45693zt.LIZ;
        if (r02 != null) {
            r02.setTimeLockSelfInMin(0);
        }
        C45713zv r03 = C45693zt.LIZ;
        if (r03 != null) {
            r03.setWeeklyUpdate(false);
        }
        C45713zv r04 = C45693zt.LIZ;
        if (r04 != null) {
            r04.setScreenTimeBreaks(0);
        }
        C45713zv r05 = C45693zt.LIZ;
        if (r05 != null) {
            r05.setScreenTimeType(0);
        }
        r2.LIZ(C45693zt.LIZ);
        FamilyPiaringManager.LIZIZ.LIZ((AnonymousClass40M) null);
    }

    public static IProtectionService LJIIJJI() {
        MethodCollector.i(18493);
        IProtectionService iProtectionService = (IProtectionService) Lnj.LIZ(IProtectionService.class, false);
        if (iProtectionService != null) {
            MethodCollector.o(18493);
            return iProtectionService;
        }
        Object LIZIZ = Lnj.LIZIZ(IProtectionService.class, false);
        if (LIZIZ != null) {
            IProtectionService iProtectionService2 = (IProtectionService) LIZIZ;
            MethodCollector.o(18493);
            return iProtectionService2;
        }
        if (Lnj.LLILII == null) {
            synchronized (IProtectionService.class) {
                try {
                    if (Lnj.LLILII == null) {
                        Lnj.LLILII = new ProtectionServiceImpl();
                    }
                } catch (Throwable th) {
                    MethodCollector.o(18493);
                    throw th;
                }
            }
        }
        ProtectionServiceImpl protectionServiceImpl = (ProtectionServiceImpl) Lnj.LLILII;
        MethodCollector.o(18493);
        return protectionServiceImpl;
    }

    public final void LIZ(AnonymousClass40S r2) {
        AnonymousClass40F.LIZIZ.LIZ(r2);
    }

    public final List<KCq> LIZ(KT7 kt7) {
        M12.LIZ(kt7);
        ArrayList arrayList = new ArrayList();
        arrayList.add(new GetDigitalWellbeingStatusMethod(kt7));
        arrayList.add(new PopDigitalWellbeingVerifyViewMethod(kt7));
        arrayList.add(new SetDigitalWellbeingStatusMethod(kt7));
        return arrayList;
    }

    public final boolean LIZ(C45623zm<Boolean> r2, String str) {
        M12.LIZ(str);
        return C45493zZ.LIZ(r2, str);
    }

    public final void LIZ(Context context, String str, Runnable runnable) {
        int i;
        if (FamilyPiaringManager.LIZIZ.LIZ() == AnonymousClass40W.CHILD || FamilyPiaringManager.LIZIZ.LIZ() == AnonymousClass40W.UNLINK_LOCKED) {
            if (FamilyPiaringManager.LIZIZ.LIZJ() || FamilyPiaringManager.LIZIZ.LIZIZ()) {
                if (FamilyPiaringManager.LIZIZ.LIZJ()) {
                    i = 2131822333;
                } else {
                    i = 2131824860;
                }
                AnonymousClass3BB r0 = new AnonymousClass3BB(context);
                r0.LIZIZ(i);
                r0.LIZIZ();
                return;
            }
        } else if (C45693zt.LIZLLL.LJ()) {
            C45493zZ.LIZ((C45623zm<Boolean>) new AnonymousClass40P(runnable), str);
            return;
        }
        runnable.run();
    }
}
