content: package androidx.appcompat.app;
  
  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.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 androidx.activity.contextaware.OnContextAvailableListener;
  import androidx.appcompat.app.ActionBarDrawerToggle;
  import androidx.appcompat.view.ActionMode;
  import androidx.appcompat.widget.Toolbar;
  import androidx.appcompat.widget.VectorEnabledTintResources;
  import androidx.core.app.ActivityCompat;
  import androidx.core.app.NavUtils;
  import androidx.core.app.TaskStackBuilder;
  import androidx.fragment.app.FragmentActivity;
  import androidx.lifecycle.ViewTreeLifecycleOwner;
  import androidx.lifecycle.ViewTreeViewModelStoreOwner;
  import androidx.savedstate.SavedStateRegistry;
  import androidx.savedstate.ViewTreeSavedStateRegistryOwner;
  
  public class AppCompatActivity extends FragmentActivity implements AppCompatCallback, TaskStackBuilder.SupportParentable, ActionBarDrawerToggle.DelegateProvider {
      private static final String DELEGATE_TAG = "androidx:appcompat";
      private AppCompatDelegate mDelegate;
      private Resources mResources;
  
      public AppCompatActivity() {
          initDelegate();
      }
  
      public AppCompatActivity(int contentLayoutId) {
          super(contentLayoutId);
          initDelegate();
      }
  
      private void initDelegate() {
          getSavedStateRegistry().registerSavedStateProvider(DELEGATE_TAG, new SavedStateRegistry.SavedStateProvider() {
              public Bundle saveState() {
                  Bundle bundle = new Bundle();
                  AppCompatActivity.this.getDelegate().onSaveInstanceState(bundle);
                  return bundle;
              }
          });
          addOnContextAvailableListener(new OnContextAvailableListener() {
              public void onContextAvailable(Context context) {
                  AppCompatDelegate delegate = AppCompatActivity.this.getDelegate();
                  delegate.installViewFactory();
                  delegate.onCreate(AppCompatActivity.this.getSavedStateRegistry().consumeRestoredStateForKey(AppCompatActivity.DELEGATE_TAG));
              }
          });
      }
  
      private void initViewTreeOwners() {
          ViewTreeLifecycleOwner.set(getWindow().getDecorView(), this);
          ViewTreeViewModelStoreOwner.set(getWindow().getDecorView(), this);
          ViewTreeSavedStateRegistryOwner.set(getWindow().getDecorView(), this);
      }
  
      /* JADX WARNING: Code restructure failed: missing block: B:10:0x0026, code lost:
          r0 = getWindow();
       */
      /* Code decompiled incorrectly, please refer to instructions dump. */
      private boolean performMenuItemShortcut(android.view.KeyEvent r4) {
          /*
              r3 = this;
              int r0 = android.os.Build.VERSION.SDK_INT
              r1 = 26
              if (r0 >= r1) goto L_0x003e
              boolean r0 = r4.isCtrlPressed()
              if (r0 != 0) goto L_0x003e
              int r0 = r4.getMetaState()
              boolean r0 = android.view.KeyEvent.metaStateHasNoModifiers(r0)
              if (r0 != 0) goto L_0x003e
              int r0 = r4.getRepeatCount()
              if (r0 != 0) goto L_0x003e
              int r0 = r4.getKeyCode()
              boolean r0 = android.view.KeyEvent.isModifierKey(r0)
              if (r0 != 0) goto L_0x003e
              android.view.Window r0 = r3.getWindow()
              if (r0 == 0) goto L_0x003e
              android.view.View r1 = r0.getDecorView()
              if (r1 == 0) goto L_0x003e
              android.view.View r1 = r0.getDecorView()
              boolean r2 = r1.dispatchKeyShortcutEvent(r4)
              if (r2 == 0) goto L_0x003e
              r2 = 1
              return r2
          L_0x003e:
              r0 = 0
              return r0
          */
          throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.app.AppCompatActivity.performMenuItemShortcut(android.view.KeyEvent):boolean");
      }
  
      public void addContentView(View view, ViewGroup.LayoutParams params) {
          initViewTreeOwners();
          getDelegate().addContentView(view, params);
      }
  
      /* access modifiers changed from: protected */
      public void attachBaseContext(Context newBase) {
          super.attachBaseContext(getDelegate().attachBaseContext2(newBase));
      }
  
      public void closeOptionsMenu() {
          ActionBar supportActionBar = getSupportActionBar();
          if (!getWindow().hasFeature(0)) {
              return;
          }
          if (supportActionBar == null || !supportActionBar.closeOptionsMenu()) {
              super.closeOptionsMenu();
          }
      }
  
      public boolean dispatchKeyEvent(KeyEvent event) {
          int keyCode = event.getKeyCode();
          ActionBar supportActionBar = getSupportActionBar();
          if (keyCode != 82 || supportActionBar == null || !supportActionBar.onMenuKeyEvent(event)) {
              return super.dispatchKeyEvent(event);
          }
          return true;
      }
  
      public <T extends View> T findViewById(int id) {
          return getDelegate().findViewById(id);
      }
  
      public AppCompatDelegate getDelegate() {
          if (this.mDelegate == null) {
              this.mDelegate = AppCompatDelegate.create((Activity) this, (AppCompatCallback) this);
          }
          return this.mDelegate;
      }
  
      public ActionBarDrawerToggle.Delegate getDrawerToggleDelegate() {
          return getDelegate().getDrawerToggleDelegate();
      }
  
      public MenuInflater getMenuInflater() {
          return getDelegate().getMenuInflater();
      }
  
      public Resources getResources() {
          if (this.mResources == null && VectorEnabledTintResources.shouldBeUsed()) {
              this.mResources = new VectorEnabledTintResources(this, super.getResources());
          }
          Resources resources = this.mResources;
          return resources == null ? super.getResources() : resources;
      }
  
      public ActionBar getSupportActionBar() {
          return getDelegate().getSupportActionBar();
      }
  
      public Intent getSupportParentActivityIntent() {
          return NavUtils.getParentActivityIntent(this);
      }
  
      public void invalidateOptionsMenu() {
          getDelegate().invalidateOptionsMenu();
      }
  
      public void onConfigurationChanged(Configuration newConfig) {
          super.onConfigurationChanged(newConfig);
          getDelegate().onConfigurationChanged(newConfig);
          if (this.mResources != null) {
              this.mResources.updateConfiguration(super.getResources().getConfiguration(), super.getResources().getDisplayMetrics());
          }
      }
  
      public void onContentChanged() {
          onSupportContentChanged();
      }
  
      public void onCreateSupportNavigateUpTaskStack(TaskStackBuilder builder) {
          builder.addParentStack((Activity) this);
      }
  
      /* access modifiers changed from: protected */
      public void onDestroy() {
          super.onDestroy();
          getDelegate().onDestroy();
      }
  
      public boolean onKeyDown(int keyCode, KeyEvent event) {
          if (performMenuItemShortcut(event)) {
              return true;
          }
          return super.onKeyDown(keyCode, event);
      }
  
      public final boolean onMenuItemSelected(int featureId, MenuItem item) {
          if (super.onMenuItemSelected(featureId, item)) {
              return true;
          }
          ActionBar supportActionBar = getSupportActionBar();
          if (item.getItemId() != 16908332 || supportActionBar == null || (supportActionBar.getDisplayOptions() & 4) == 0) {
              return false;
          }
          return onSupportNavigateUp();
      }
  
      public boolean onMenuOpened(int featureId, Menu menu) {
          return super.onMenuOpened(featureId, menu);
      }
  
      /* access modifiers changed from: protected */
      public void onNightModeChanged(int mode) {
      }
  
      public void onPanelClosed(int featureId, Menu menu) {
          super.onPanelClosed(featureId, menu);
      }
  
      /* access modifiers changed from: protected */
      public void onPostCreate(Bundle savedInstanceState) {
          super.onPostCreate(savedInstanceState);
          getDelegate().onPostCreate(savedInstanceState);
      }
  
      /* access modifiers changed from: protected */
      public void onPostResume() {
          super.onPostResume();
          getDelegate().onPostResume();
      }
  
      public void onPrepareSupportNavigateUpTaskStack(TaskStackBuilder builder) {
      }
  
      /* access modifiers changed from: protected */
      public void onStart() {
          super.onStart();
          getDelegate().onStart();
      }
  
      /* access modifiers changed from: protected */
      public void onStop() {
          super.onStop();
          getDelegate().onStop();
      }
  
      public void onSupportActionModeFinished(ActionMode mode) {
      }
  
      public void onSupportActionModeStarted(ActionMode mode) {
      }
  
      @Deprecated
      public void onSupportContentChanged() {
      }
  
      public boolean onSupportNavigateUp() {
          Intent supportParentActivityIntent = getSupportParentActivityIntent();
          if (supportParentActivityIntent == null) {
              return false;
          }
          if (supportShouldUpRecreateTask(supportParentActivityIntent)) {
              TaskStackBuilder create = TaskStackBuilder.create(this);
              onCreateSupportNavigateUpTaskStack(create);
              onPrepareSupportNavigateUpTaskStack(create);
              create.startActivities();
              try {
                  ActivityCompat.finishAffinity(this);
                  return true;
              } catch (IllegalStateException e) {
                  finish();
                  return true;
              }
          } else {
              supportNavigateUpTo(supportParentActivityIntent);
              return true;
          }
      }
  
      /* access modifiers changed from: protected */
      public void onTitleChanged(CharSequence title, int color) {
          super.onTitleChanged(title, color);
          getDelegate().setTitle(title);
      }
  
      public ActionMode onWindowStartingSupportActionMode(ActionMode.Callback callback) {
          return null;
      }
  
      public void openOptionsMenu() {
          ActionBar supportActionBar = getSupportActionBar();
          if (!getWindow().hasFeature(0)) {
              return;
          }
          if (supportActionBar == null || !supportActionBar.openOptionsMenu()) {
              super.openOptionsMenu();
          }
      }
  
      public void setContentView(int layoutResID) {
          initViewTreeOwners();
          getDelegate().setContentView(layoutResID);
      }
  
      public void setContentView(View view) {
          initViewTreeOwners();
          getDelegate().setContentView(view);
      }
  
      public void setContentView(View view, ViewGroup.LayoutParams params) {
          initViewTreeOwners();
          getDelegate().setContentView(view, params);
      }
  
      public void setSupportActionBar(Toolbar toolbar) {
          getDelegate().setSupportActionBar(toolbar);
      }
  
      @Deprecated
      public void setSupportProgress(int progress) {
      }
  
      @Deprecated
      public void setSupportProgressBarIndeterminate(boolean indeterminate) {
      }
  
      @Deprecated
      public void setSupportProgressBarIndeterminateVisibility(boolean visible) {
      }
  
      @Deprecated
      public void setSupportProgressBarVisibility(boolean visible) {
      }
  
      public void setTheme(int resId) {
          super.setTheme(resId);
          getDelegate().setTheme(resId);
      }
  
      public ActionMode startSupportActionMode(ActionMode.Callback callback) {
          return getDelegate().startSupportActionMode(callback);
      }
  
      public void supportInvalidateOptionsMenu() {
          getDelegate().invalidateOptionsMenu();
      }
  
      public void supportNavigateUpTo(Intent upIntent) {
          NavUtils.navigateUpTo(this, upIntent);
      }
  
      public boolean supportRequestWindowFeature(int featureId) {
          return getDelegate().requestWindowFeature(featureId);
      }
  
      public boolean supportShouldUpRecreateTask(Intent targetIntent) {
          return NavUtils.shouldUpRecreateTask(this, targetIntent);
      }
  }
  