package com.ss.android.ugc.aweme.account.ui;

import X.0AA;
import X.0AP;
import X.8gF;
import X.Ryt;
import X.SNU;
import android.content.Intent;
import android.os.Bundle;
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.account.login.v2.base.BaseAccountFlowFragment;
import com.ss.android.ugc.aweme.account.verify.EmailConsentPageFragment;
import java.util.HashMap;
import kotlin.h.b.n;

public class EmailConsentPageActivity extends SNU {
    public HashMap LIZ;

    static {
        Covode.recordClassIndex(52194);
    }

    public void _$_clearFindViewByIdCache() {
        HashMap hashMap = this.LIZ;
        if (hashMap != null) {
            hashMap.clear();
        }
    }

    public View _$_findCachedViewById(int i) {
        if (this.LIZ == null) {
            this.LIZ = new HashMap();
        }
        View view = (View) this.LIZ.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i);
        this.LIZ.put(Integer.valueOf(i), findViewById);
        return findViewById;
    }

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

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

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

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

    public void onWindowFocusChanged(boolean z) {
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.account.ui.EmailConsentPageActivity", "onWindowFocusChanged", true);
        EmailConsentPageActivity.super.onWindowFocusChanged(z);
    }

    public void onBackPressed() {
        BaseAccountFlowFragment LIZ2 = getSupportFragmentManager().LIZ(2131364490);
        if (LIZ2 == null || !LIZ2.aA_()) {
            0AA supportFragmentManager = getSupportFragmentManager();
            n.LIZIZ(supportFragmentManager, "");
            if (supportFragmentManager.LJ() == 1) {
                finish();
            } else if (isActive()) {
                getSupportFragmentManager().LIZJ();
            }
        }
    }

    /* JADX WARNING: type inference failed for: r1v0, types: [com.ss.android.ugc.aweme.account.ui.EmailConsentPageActivity, X.SNU, android.app.Activity] */
    public void onStop() {
        8gF.LIZLLL(this);
        EmailConsentPageActivity.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: r8v0, types: [X.1hK, com.ss.android.ugc.aweme.account.ui.EmailConsentPageActivity, X.SNU, android.app.Activity] */
    public void onCreate(Bundle bundle) {
        8gF.LIZ(this, bundle);
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.account.ui.EmailConsentPageActivity", "onCreate", true);
        EmailConsentPageActivity.super.onCreate(bundle);
        setContentView(2131558483);
        String LIZ2 = LIZ(getIntent(), "enter_from");
        if (LIZ2 == null) {
            LIZ2 = "";
        }
        n.LIZIZ(LIZ2, "");
        0AP LIZ3 = getSupportFragmentManager().LIZ();
        n.LIZIZ(LIZ3, "");
        EmailConsentPageFragment emailConsentPageFragment = new EmailConsentPageFragment(new Ryt(LIZ2, this));
        Bundle bundle2 = new Bundle();
        bundle2.putString("enter_from", LIZ2);
        emailConsentPageFragment.setArguments(bundle2);
        LIZ3.LIZ(2131364490, emailConsentPageFragment);
        LIZ3.LIZIZ();
        ActivityAgent.onTrace("com.ss.android.ugc.aweme.account.ui.EmailConsentPageActivity", "onCreate", false);
    }

    public static String LIZ(Intent intent, String str) {
        try {
            return intent.getStringExtra(str);
        } catch (Exception unused) {
            return null;
        }
    }
}
