package androidx.appcompat.app;

import X6FRs_4.IMuAHx_6.Mqv2r_3.Nm6q_10;
import X6FRs_4.KQgRr5e_0.LGe8pk_15.JXypC6_34;
import X6FRs_4.KQgRr5e_0.Nm6q_10.KQgRr5e_0;
import X6FRs_4.KQgRr5e_0.Nm6q_10.Mqv2r_3;
import X6FRs_4.KQgRr5e_0.Nm6q_10.PGPF6hQ_2;
import X6FRs_4.KQgRr5e_0.YghfZG_14.QxJ9d_1;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.FragmentActivity;
/* loaded from: classes.dex */
public class AppCompatActivity extends FragmentActivity implements PGPF6hQ_2, Nm6q_10.KQgRr5e_0 {
    public Mqv2r_3 KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public Resources f1898KQgRr5e_0;
    public int QxJ9d_1 = 0;

    public final boolean KQgRr5e_0(int i, KeyEvent keyEvent) {
        Window window;
        return (Build.VERSION.SDK_INT >= 26 || keyEvent.isCtrlPressed() || KeyEvent.metaStateHasNoModifiers(keyEvent.getMetaState()) || keyEvent.getRepeatCount() != 0 || KeyEvent.isModifierKey(keyEvent.getKeyCode()) || (window = getWindow()) == null || window.getDecorView() == null || !window.getDecorView().dispatchKeyShortcutEvent(keyEvent)) ? false : true;
    }

    @Override // android.app.Activity
    public void addContentView(View view, ViewGroup.LayoutParams layoutParams) {
        getDelegate().KQgRr5e_0(view, layoutParams);
    }

    @Override // android.app.Activity
    public void closeOptionsMenu() {
        ActionBar supportActionBar = getSupportActionBar();
        if (getWindow().hasFeature(0)) {
            if (supportActionBar == null || !supportActionBar.m821KQgRr5e_0()) {
                super.closeOptionsMenu();
            }
        }
    }

    @Override // androidx.core.app.ComponentActivity, android.app.Activity, android.view.Window.Callback
    public boolean dispatchKeyEvent(KeyEvent keyEvent) {
        int keyCode = keyEvent.getKeyCode();
        ActionBar supportActionBar = getSupportActionBar();
        if (keyCode == 82 && supportActionBar != null && supportActionBar.KQgRr5e_0(keyEvent)) {
            return true;
        }
        return super.dispatchKeyEvent(keyEvent);
    }

    @Override // android.app.Activity
    public <T extends View> T findViewById(int i) {
        return (T) getDelegate().KQgRr5e_0(i);
    }

    public Mqv2r_3 getDelegate() {
        if (this.KQgRr5e_0 == null) {
            this.KQgRr5e_0 = Mqv2r_3.KQgRr5e_0(this, this);
        }
        return this.KQgRr5e_0;
    }

    public KQgRr5e_0 getDrawerToggleDelegate() {
        return getDelegate().mo448KQgRr5e_0();
    }

    @Override // android.app.Activity
    public MenuInflater getMenuInflater() {
        return getDelegate().m449KQgRr5e_0();
    }

    @Override // android.view.ContextThemeWrapper, android.content.ContextWrapper, android.content.Context
    public Resources getResources() {
        if (this.f1898KQgRr5e_0 == null && JXypC6_34.QxJ9d_1()) {
            this.f1898KQgRr5e_0 = new JXypC6_34(this, super.getResources());
        }
        Resources resources = this.f1898KQgRr5e_0;
        return resources == null ? super.getResources() : resources;
    }

    public ActionBar getSupportActionBar() {
        return getDelegate().m450KQgRr5e_0();
    }

    @Override // X6FRs_4.IMuAHx_6.Mqv2r_3.Nm6q_10.KQgRr5e_0
    public Intent getSupportParentActivityIntent() {
        return X6FRs_4.IMuAHx_6.Mqv2r_3.Mqv2r_3.KQgRr5e_0((Activity) this);
    }

    @Override // android.app.Activity
    public void invalidateOptionsMenu() {
        getDelegate().QxJ9d_1();
    }

    @Override // androidx.fragment.app.FragmentActivity, android.app.Activity, android.content.ComponentCallbacks
    public void onConfigurationChanged(Configuration configuration) {
        super.onConfigurationChanged(configuration);
        getDelegate().KQgRr5e_0(configuration);
        if (this.f1898KQgRr5e_0 != null) {
            this.f1898KQgRr5e_0.updateConfiguration(configuration, super.getResources().getDisplayMetrics());
        }
    }

    @Override // android.app.Activity, android.view.Window.Callback
    public void onContentChanged() {
        onSupportContentChanged();
    }

    @Override // androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
    public void onCreate(Bundle bundle) {
        int i;
        Mqv2r_3 delegate = getDelegate();
        delegate.m451KQgRr5e_0();
        delegate.KQgRr5e_0(bundle);
        if (delegate.m453KQgRr5e_0() && (i = this.QxJ9d_1) != 0) {
            if (Build.VERSION.SDK_INT >= 23) {
                onApplyThemeResource(getTheme(), this.QxJ9d_1, false);
            } else {
                setTheme(i);
            }
        }
        super.onCreate(bundle);
    }

    public void onCreateSupportNavigateUpTaskStack(Nm6q_10 nm6q_10) {
        nm6q_10.KQgRr5e_0((Activity) this);
    }

    @Override // androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onDestroy() {
        super.onDestroy();
        getDelegate().PGPF6hQ_2();
    }

    @Override // android.app.Activity, android.view.KeyEvent.Callback
    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (KQgRr5e_0(i, keyEvent)) {
            return true;
        }
        return super.onKeyDown(i, keyEvent);
    }

    @Override // androidx.fragment.app.FragmentActivity, android.app.Activity, android.view.Window.Callback
    public final boolean onMenuItemSelected(int i, MenuItem menuItem) {
        if (super.onMenuItemSelected(i, menuItem)) {
            return true;
        }
        ActionBar supportActionBar = getSupportActionBar();
        if (menuItem.getItemId() != 16908332 || supportActionBar == null || (supportActionBar.KQgRr5e_0() & 4) == 0) {
            return false;
        }
        return onSupportNavigateUp();
    }

    @Override // android.app.Activity, android.view.Window.Callback
    public boolean onMenuOpened(int i, Menu menu) {
        return super.onMenuOpened(i, menu);
    }

    @Override // androidx.fragment.app.FragmentActivity, android.app.Activity, android.view.Window.Callback
    public void onPanelClosed(int i, Menu menu) {
        super.onPanelClosed(i, menu);
    }

    @Override // android.app.Activity
    public void onPostCreate(Bundle bundle) {
        super.onPostCreate(bundle);
        getDelegate().QxJ9d_1(bundle);
    }

    @Override // androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onPostResume() {
        super.onPostResume();
        getDelegate().Mqv2r_3();
    }

    public void onPrepareSupportNavigateUpTaskStack(Nm6q_10 nm6q_10) {
    }

    @Override // androidx.fragment.app.FragmentActivity, androidx.core.app.ComponentActivity, android.app.Activity
    public void onSaveInstanceState(Bundle bundle) {
        super.onSaveInstanceState(bundle);
        getDelegate().PGPF6hQ_2(bundle);
    }

    @Override // androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onStart() {
        super.onStart();
        getDelegate().X6FRs_4();
    }

    @Override // androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onStop() {
        super.onStop();
        getDelegate().IFxWkV_5();
    }

    @Override // X6FRs_4.KQgRr5e_0.Nm6q_10.PGPF6hQ_2
    public void onSupportActionModeFinished(QxJ9d_1 qxJ9d_1) {
    }

    @Override // X6FRs_4.KQgRr5e_0.Nm6q_10.PGPF6hQ_2
    public void onSupportActionModeStarted(QxJ9d_1 qxJ9d_1) {
    }

    @Deprecated
    public void onSupportContentChanged() {
    }

    public boolean onSupportNavigateUp() {
        Intent supportParentActivityIntent = getSupportParentActivityIntent();
        if (supportParentActivityIntent != null) {
            if (supportShouldUpRecreateTask(supportParentActivityIntent)) {
                Nm6q_10 KQgRr5e_0 = Nm6q_10.KQgRr5e_0((Context) this);
                onCreateSupportNavigateUpTaskStack(KQgRr5e_0);
                onPrepareSupportNavigateUpTaskStack(KQgRr5e_0);
                KQgRr5e_0.KQgRr5e_0();
                try {
                    X6FRs_4.IMuAHx_6.Mqv2r_3.KQgRr5e_0.KQgRr5e_0((Activity) this);
                    return true;
                } catch (IllegalStateException unused) {
                    finish();
                    return true;
                }
            }
            supportNavigateUpTo(supportParentActivityIntent);
            return true;
        }
        return false;
    }

    @Override // android.app.Activity
    public void onTitleChanged(CharSequence charSequence, int i) {
        super.onTitleChanged(charSequence, i);
        getDelegate().KQgRr5e_0(charSequence);
    }

    @Override // X6FRs_4.KQgRr5e_0.Nm6q_10.PGPF6hQ_2
    public QxJ9d_1 onWindowStartingSupportActionMode(QxJ9d_1.KQgRr5e_0 kQgRr5e_0) {
        return null;
    }

    @Override // android.app.Activity
    public void openOptionsMenu() {
        ActionBar supportActionBar = getSupportActionBar();
        if (getWindow().hasFeature(0)) {
            if (supportActionBar == null || !supportActionBar.Mqv2r_3()) {
                super.openOptionsMenu();
            }
        }
    }

    @Override // android.app.Activity
    public void setContentView(int i) {
        getDelegate().m452KQgRr5e_0(i);
    }

    public void setSupportActionBar(Toolbar toolbar) {
        getDelegate().KQgRr5e_0(toolbar);
    }

    @Deprecated
    public void setSupportProgress(int i) {
    }

    @Deprecated
    public void setSupportProgressBarIndeterminate(boolean z) {
    }

    @Deprecated
    public void setSupportProgressBarIndeterminateVisibility(boolean z) {
    }

    @Deprecated
    public void setSupportProgressBarVisibility(boolean z) {
    }

    @Override // android.app.Activity, android.view.ContextThemeWrapper, android.content.ContextWrapper, android.content.Context
    public void setTheme(int i) {
        super.setTheme(i);
        this.QxJ9d_1 = i;
    }

    public QxJ9d_1 startSupportActionMode(QxJ9d_1.KQgRr5e_0 kQgRr5e_0) {
        return getDelegate().KQgRr5e_0(kQgRr5e_0);
    }

    @Override // androidx.fragment.app.FragmentActivity
    public void supportInvalidateOptionsMenu() {
        getDelegate().QxJ9d_1();
    }

    public void supportNavigateUpTo(Intent intent) {
        X6FRs_4.IMuAHx_6.Mqv2r_3.Mqv2r_3.KQgRr5e_0((Activity) this, intent);
    }

    public boolean supportRequestWindowFeature(int i) {
        return getDelegate().m454KQgRr5e_0(i);
    }

    public boolean supportShouldUpRecreateTask(Intent intent) {
        return X6FRs_4.IMuAHx_6.Mqv2r_3.Mqv2r_3.m310KQgRr5e_0((Activity) this, intent);
    }

    @Override // android.app.Activity
    public void setContentView(View view) {
        getDelegate().KQgRr5e_0(view);
    }

    @Override // android.app.Activity
    public void setContentView(View view, ViewGroup.LayoutParams layoutParams) {
        getDelegate().QxJ9d_1(view, layoutParams);
    }
}
