package com.ss.android.ugc.aweme.compliance.protection.digitalwellbeing.ui;

import X.8gF;
import X.AnonymousClass40F;
import X.AnonymousClass40W;
import X.C03012Pr;
import X.C30953c7;
import X.C30983cA;
import X.C31003cC;
import X.C31063cI;
import X.C45633zn;
import X.C45643zo;
import X.C45673zr;
import X.C45693zt;
import X.Ls2;
import X.OIZ;
import X.SNU;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.View;
import com.bytedance.apm.agent.v2.instrumentation.ActivityAgent;
import com.bytedance.covode.number.Covode;
import com.bytedance.sysoptimizer.EnterTransitionCrashOptimizer;
import com.ss.android.ugc.aweme.compliance.protection.familypairing.FamilyPiaringManager;
import kotlin.h.b.n;

public final class DigitalWellbeingActivity extends SNU implements View.OnClickListener {
    public static final C45673zr LIZ = new C45673zr((byte) 0);
    public C30953c7 LIZIZ;
    public OIZ LIZJ;
    public OIZ LIZLLL;
    public SparseArray LJ;

    static {
        Covode.recordClassIndex(62083);
    }

    public final void _$_clearFindViewByIdCache() {
        SparseArray sparseArray = this.LJ;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public final View _$_findCachedViewById(int i) {
        if (this.LJ == null) {
            this.LJ = new SparseArray();
        }
        View view = (View) this.LJ.get(i);
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i);
        this.LJ.put(i, findViewById);
        return findViewById;
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [X.SNU, android.app.Activity, com.ss.android.ugc.aweme.compliance.protection.digitalwellbeing.ui.DigitalWellbeingActivity] */
    public final void onDestroy() {
        8gF.LJ(this);
        DigitalWellbeingActivity.super.onDestroy();
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [X.SNU, android.app.Activity, com.ss.android.ugc.aweme.compliance.protection.digitalwellbeing.ui.DigitalWellbeingActivity] */
    public final void onPause() {
        8gF.LIZJ(this);
        DigitalWellbeingActivity.super.onPause();
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [X.SNU, android.app.Activity, com.ss.android.ugc.aweme.compliance.protection.digitalwellbeing.ui.DigitalWellbeingActivity] */
    public final void onStart() {
        8gF.LIZ(this);
        DigitalWellbeingActivity.super.onStart();
    }

    public final void onWindowFocusChanged(boolean z) {
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.compliance.protection.digitalwellbeing.ui.DigitalWellbeingActivity", "onWindowFocusChanged", true);
        DigitalWellbeingActivity.super.onWindowFocusChanged(z);
    }

    /* JADX WARNING: type inference failed for: r3v0, types: [X.SNU, android.app.Activity, com.ss.android.ugc.aweme.compliance.protection.digitalwellbeing.ui.DigitalWellbeingActivity] */
    public final void onResume() {
        8gF.LIZIZ(this);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.compliance.protection.digitalwellbeing.ui.DigitalWellbeingActivity", "onResume", true);
        DigitalWellbeingActivity.super.onResume();
        LIZ();
        LIZIZ();
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.compliance.protection.digitalwellbeing.ui.DigitalWellbeingActivity", "onResume", false);
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [X.SNU, android.app.Activity, com.ss.android.ugc.aweme.compliance.protection.digitalwellbeing.ui.DigitalWellbeingActivity] */
    public final void onStop() {
        8gF.LIZLLL(this);
        DigitalWellbeingActivity.super.onStop();
        if (EnterTransitionCrashOptimizer.getContext() != null) {
            try {
                getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
            } catch (Throwable unused) {
            }
        }
        try {
            getWindow().getDecorView().getViewTreeObserver().dispatchOnPreDraw();
        } catch (Throwable unused2) {
        }
    }

    private final void LIZ() {
        OIZ oiz;
        String string;
        String string2;
        if (FamilyPiaringManager.LIZIZ.LIZ() != AnonymousClass40W.UNLINK_LOCKED) {
            oiz = this.LIZJ;
            if (oiz == null) {
                n.LIZ("");
            }
            if (C45693zt.LIZLLL.LIZIZ()) {
                string = getString(2131823781);
            } else {
                string = getString(2131827667);
            }
        } else if (FamilyPiaringManager.LIZIZ.LIZJ()) {
            oiz = this.LIZJ;
            if (oiz == null) {
                n.LIZ("");
            }
            string = getString(2131824878);
        } else {
            OIZ oiz2 = this.LIZJ;
            if (oiz2 == null) {
                n.LIZ("");
            }
            if (C45693zt.LIZLLL.LIZIZ()) {
                string2 = getString(2131823781);
            } else {
                string2 = getString(2131827667);
            }
            oiz2.setRightText(string2);
            return;
        }
        oiz.setRightText(string);
    }

    private final void LIZIZ() {
        OIZ oiz;
        String string;
        String string2;
        if (FamilyPiaringManager.LIZIZ.LIZ() != AnonymousClass40W.UNLINK_LOCKED) {
            oiz = this.LIZLLL;
            if (oiz == null) {
                n.LIZ("");
            }
            if (AnonymousClass40F.LIZIZ.LIZIZ()) {
                string = getString(2131823785);
            } else {
                string = getString(2131827667);
            }
        } else if (FamilyPiaringManager.LIZIZ.LIZIZ()) {
            oiz = this.LIZLLL;
            if (oiz == null) {
                n.LIZ("");
            }
            string = getString(2131824878);
        } else {
            OIZ oiz2 = this.LIZLLL;
            if (oiz2 == null) {
                n.LIZ("");
            }
            if (C45693zt.LIZLLL.LIZ()) {
                string2 = getString(2131823785);
            } else {
                string2 = getString(2131827667);
            }
            oiz2.setRightText(string2);
            return;
        }
        oiz.setRightText(string);
    }

    /* JADX WARNING: type inference failed for: r0v7, types: [android.content.Context] */
    /* JADX WARNING: type inference failed for: r0v12, types: [android.content.Context] */
    /* JADX WARNING: type inference failed for: r0v19, types: [android.content.Context] */
    /* JADX WARNING: type inference failed for: r0v24, types: [android.content.Context] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void onClick(android.view.View r10) {
        /*
            r9 = this;
            if (r10 == 0) goto L_0x0018
            int r0 = r10.getId()
            java.lang.Integer r8 = java.lang.Integer.valueOf(r0)
        L_0x000a:
            java.lang.String r5 = "/template.js&dynamic=1&hide_nav_bar=1&should_full_screen=1&use_spark=1"
            java.lang.String r4 = "aweme://lynxview/?channel=fe_privacy_and_safety_lynx&bundle="
            java.lang.String r6 = "SetTimeLockActivityKeyFromParent"
            java.lang.String r3 = "SetTimeLockActivityKeyType"
            java.lang.String r7 = "//settimelock"
            r2 = 0
            if (r8 != 0) goto L_0x001a
            return
        L_0x0018:
            r8 = 0
            goto L_0x000a
        L_0x001a:
            int r1 = r8.intValue()
            r0 = 2131364092(0x7f0a08fc, float:1.8348011E38)
            if (r1 != r0) goto L_0x0071
            com.ss.android.ugc.aweme.compliance.protection.familypairing.FamilyPiaringManager r0 = com.ss.android.ugc.aweme.compliance.protection.familypairing.FamilyPiaringManager.LIZIZ
            boolean r0 = r0.LIZJ()
            if (r0 != 0) goto L_0x0070
            X.2UX r0 = new X.2UX
            r0.<init>()
            java.util.Map<java.lang.String, java.lang.String> r1 = r0.LIZ
            java.lang.String r0 = "enter_time_lock"
            X.C12422nK.LIZ((java.lang.String) r0, (java.util.Map<java.lang.String, java.lang.String>) r1)
            boolean r0 = X.C45573zh.LIZ()
            if (r0 == 0) goto L_0x0062
            X.3zt r0 = X.C45693zt.LIZLLL
            boolean r0 = r0.LIZIZ()
            if (r0 == 0) goto L_0x005f
            java.lang.String r1 = "close-screen-time-page"
        L_0x0047:
            java.lang.StringBuilder r0 = new java.lang.StringBuilder
            r0.<init>(r4)
            r0.append(r1)
            r0.append(r5)
            java.lang.String r1 = r0.toString()
            r0 = r9
            com.bytedance.router.SmartRoute r0 = com.bytedance.router.SmartRouter.buildRoute(r0, r1)
            r0.open()
            return
        L_0x005f:
            java.lang.String r1 = "open-screen-time-page"
            goto L_0x0047
        L_0x0062:
            r0 = r9
            com.bytedance.router.SmartRoute r0 = com.bytedance.router.SmartRouter.buildRoute(r0, r7)
            r0.withParam(r3, r2)
            r0.withParam(r6, r2)
            r0.open()
        L_0x0070:
            return
        L_0x0071:
            int r1 = r8.intValue()
            r0 = 2131364091(0x7f0a08fb, float:1.834801E38)
            if (r1 != r0) goto L_0x00c8
            com.ss.android.ugc.aweme.compliance.protection.familypairing.FamilyPiaringManager r0 = com.ss.android.ugc.aweme.compliance.protection.familypairing.FamilyPiaringManager.LIZIZ
            boolean r0 = r0.LIZIZ()
            if (r0 != 0) goto L_0x00c8
            X.2UX r0 = new X.2UX
            r0.<init>()
            java.util.Map<java.lang.String, java.lang.String> r1 = r0.LIZ
            java.lang.String r0 = "enter_teen_mode"
            X.C12422nK.LIZ((java.lang.String) r0, (java.util.Map<java.lang.String, java.lang.String>) r1)
            boolean r0 = X.C45573zh.LIZ()
            if (r0 == 0) goto L_0x00b9
            X.3zt r0 = X.C45693zt.LIZLLL
            boolean r0 = r0.LIZ()
            if (r0 == 0) goto L_0x00b6
            java.lang.String r1 = "close-restricted-page"
        L_0x009e:
            java.lang.StringBuilder r0 = new java.lang.StringBuilder
            r0.<init>(r4)
            r0.append(r1)
            r0.append(r5)
            java.lang.String r1 = r0.toString()
            r0 = r9
            com.bytedance.router.SmartRoute r0 = com.bytedance.router.SmartRouter.buildRoute(r0, r1)
            r0.open()
            return
        L_0x00b6:
            java.lang.String r1 = "open-restricted-page"
            goto L_0x009e
        L_0x00b9:
            r0 = r9
            com.bytedance.router.SmartRoute r1 = com.bytedance.router.SmartRouter.buildRoute(r0, r7)
            r0 = 1
            r1.withParam(r3, r0)
            r1.withParam(r6, r2)
            r1.open()
        L_0x00c8:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.compliance.protection.digitalwellbeing.ui.DigitalWellbeingActivity.onClick(android.view.View):void");
    }

    /* JADX WARNING: type inference failed for: r7v0, types: [X.1oX, X.SNU, android.app.Activity, com.ss.android.ugc.aweme.compliance.protection.digitalwellbeing.ui.DigitalWellbeingActivity] */
    public final void onCreate(Bundle bundle) {
        8gF.LIZ(this, bundle);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.compliance.protection.digitalwellbeing.ui.DigitalWellbeingActivity", "onCreate", true);
        activityConfiguration(C45633zn.LIZ);
        DigitalWellbeingActivity.super.onCreate(bundle);
        setContentView(2131559397);
        View findViewById = findViewById(2131371289);
        n.LIZIZ(findViewById, "");
        C30953c7 r2 = (C30953c7) findViewById;
        this.LIZIZ = r2;
        if (r2 == null) {
            n.LIZ("");
        }
        C31003cC r1 = new C31003cC();
        String string = getString(2131833551);
        n.LIZIZ(string, "");
        r1.LIZ(string);
        r2.LIZ(r1);
        C30953c7 r22 = this.LIZIZ;
        if (r22 == null) {
            n.LIZ("");
        }
        C30983cA r12 = new C30983cA();
        r12.LIZ(2131755170);
        r12.LIZ((Ls2<C03012Pr>) new C45643zo(this));
        r22.LIZ((C31063cI) r12);
        C30953c7 r0 = this.LIZIZ;
        if (r0 == null) {
            n.LIZ("");
        }
        r0.LIZ(true);
        OIZ findViewById2 = findViewById(2131364092);
        n.LIZIZ(findViewById2, "");
        OIZ oiz = findViewById2;
        this.LIZJ = oiz;
        if (oiz == null) {
            n.LIZ("");
        }
        oiz.setLeftText(getString(2131823778));
        OIZ oiz2 = this.LIZJ;
        if (oiz2 == null) {
            n.LIZ("");
        }
        oiz2.setRightIconRes(0);
        OIZ oiz3 = this.LIZJ;
        if (oiz3 == null) {
            n.LIZ("");
        }
        oiz3.setOnClickListener(this);
        OIZ findViewById3 = findViewById(2131364091);
        n.LIZIZ(findViewById3, "");
        OIZ oiz4 = findViewById3;
        this.LIZLLL = oiz4;
        if (oiz4 == null) {
            n.LIZ("");
        }
        oiz4.setLeftText(getString(2131823777));
        OIZ oiz5 = this.LIZLLL;
        if (oiz5 == null) {
            n.LIZ("");
        }
        oiz5.setRightIconRes(0);
        OIZ oiz6 = this.LIZLLL;
        if (oiz6 == null) {
            n.LIZ("");
        }
        oiz6.setOnClickListener(this);
        LIZ();
        LIZIZ();
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.compliance.protection.digitalwellbeing.ui.DigitalWellbeingActivity", "onCreate", false);
    }
}
