package com.ss.android.ugc.aweme.compliance.business.phl;

import X.0AP;
import X.7he;
import X.8gF;
import X.AnonymousClass39H;
import X.AnonymousClass39I;
import X.AnonymousClass39L;
import X.Crj;
import X.SNU;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.View;
import androidx.fragment.app.Fragment;
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.api.phl.vm.PhlViewModel;
import kotlin.h.b.n;

public final class PhlActivity extends SNU {
    public static final AnonymousClass39L LIZ = new AnonymousClass39L((byte) 0);
    public Fragment LIZIZ;
    public final Crj LIZJ = 7he.LIZ(new AnonymousClass39H(this));
    public SparseArray LIZLLL;

    static {
        Covode.recordClassIndex(61052);
    }

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

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

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

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

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

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

    public final void onWindowFocusChanged(boolean z) {
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.compliance.business.phl.PhlActivity", "onWindowFocusChanged", true);
        PhlActivity.super.onWindowFocusChanged(z);
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [X.4Qh, com.ss.android.ugc.aweme.compliance.business.phl.PhlActivity] */
    public final void onBackPressed() {
        Fragment fragment = this.LIZIZ;
        if (!(fragment instanceof PhlFragment)) {
            fragment = null;
        }
        PhlFragment phlFragment = (PhlFragment) fragment;
        if (phlFragment != null) {
            phlFragment.LIZ("close");
        }
        PhlActivity.super.onBackPressed();
    }

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

    /* JADX WARNING: type inference failed for: r6v0, types: [X.1hK, X.SNU, com.ss.android.ugc.aweme.compliance.business.phl.PhlActivity, android.app.Activity] */
    public final void onCreate(Bundle bundle) {
        8gF.LIZ(this, bundle);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.compliance.business.phl.PhlActivity", "onCreate", true);
        activityConfiguration(AnonymousClass39I.LIZ);
        PhlActivity.super.onCreate(bundle);
        setContentView(2131559402);
        Fragment LIZ2 = getSupportFragmentManager().LIZ("phl_fragment");
        this.LIZIZ = LIZ2;
        if (LIZ2 == null) {
            Fragment LIZ3 = PhlFragment.LJIILJJIL.LIZ("privacy_highlight_popup");
            this.LIZIZ = LIZ3;
            if (LIZ3 != null) {
                0AP LIZ4 = getSupportFragmentManager().LIZ();
                n.LIZIZ(LIZ4, "");
                LIZ4.LIZIZ(2131365158, LIZ3, "phl_fragment");
                LIZ4.LIZJ(LIZ3);
                LIZ4.LIZJ();
            }
        }
        ((PhlViewModel) this.LIZJ.getValue()).LIZ();
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.compliance.business.phl.PhlActivity", "onCreate", false);
    }
}
