content: package androidx.activity;
  
  import android.app.Dialog;
  import android.content.Context;
  import android.os.Bundle;
  import android.view.View;
  import android.view.ViewGroup;
  import android.view.Window;
  import androidx.lifecycle.Lifecycle;
  import androidx.lifecycle.LifecycleOwner;
  import androidx.lifecycle.LifecycleRegistry;
  import androidx.lifecycle.ViewTreeLifecycleOwner;
  import kotlin.Metadata;
  import kotlin.jvm.internal.DefaultConstructorMarker;
  import kotlin.jvm.internal.Intrinsics;
  
  @Metadata(d1 = {"\u0000P\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0016\u0018\u00002\u00020\u00012\u00020\u00022\u00020\u0003B\u0019\b\u0007\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\b\b\u0003\u0010\u0006\u001a\u00020\u0007¢\u0006\u0002\u0010\bJ\u001a\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u00132\b\u0010\u0014\u001a\u0004\u0018\u00010\u0015H\u0016J\u0006\u0010\u0016\u001a\u00020\u0017J\u0006\u0010\u0018\u001a\u00020\u000fJ\b\u0010\u0019\u001a\u00020\u0011H\u0002J\b\u0010\u001a\u001a\u00020\u0011H\u0017J\u0012\u0010\u001b\u001a\u00020\u00112\b\u0010\u001c\u001a\u0004\u0018\u00010\u001dH\u0015J\b\u0010\u001e\u001a\u00020\u0011H\u0015J\b\u0010\u001f\u001a\u00020\u0011H\u0015J\u0010\u0010 \u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u0013H\u0016J\u001a\u0010 \u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u00132\b\u0010\u0014\u001a\u0004\u0018\u00010\u0015H\u0016J\u0010\u0010 \u001a\u00020\u00112\u0006\u0010!\u001a\u00020\u0007H\u0016R\u0010\u0010\t\u001a\u0004\u0018\u00010\nX\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\u000b\u001a\u00020\n8BX\u0004¢\u0006\u0006\u001a\u0004\b\f\u0010\rR\u000e\u0010\u000e\u001a\u00020\u000fX\u0004¢\u0006\u0002\n\u0000¨\u0006\""}, d2 = {"Landroidx/activity/ComponentDialog;", "Landroid/app/Dialog;", "Landroidx/lifecycle/LifecycleOwner;", "Landroidx/activity/OnBackPressedDispatcherOwner;", "context", "Landroid/content/Context;", "themeResId", "", "(Landroid/content/Context;I)V", "_lifecycleRegistry", "Landroidx/lifecycle/LifecycleRegistry;", "lifecycleRegistry", "getLifecycleRegistry", "()Landroidx/lifecycle/LifecycleRegistry;", "onBackPressedDispatcher", "Landroidx/activity/OnBackPressedDispatcher;", "addContentView", "", "view", "Landroid/view/View;", "params", "Landroid/view/ViewGroup$LayoutParams;", "getLifecycle", "Landroidx/lifecycle/Lifecycle;", "getOnBackPressedDispatcher", "initViewTreeOwners", "onBackPressed", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onStart", "onStop", "setContentView", "layoutResID", "activity_release"}, k = 1, mv = {1, 6, 0}, xi = 48)
  /* compiled from: ComponentDialog.kt */
  public class ComponentDialog extends Dialog implements LifecycleOwner, OnBackPressedDispatcherOwner {
      private LifecycleRegistry _lifecycleRegistry;
      private final OnBackPressedDispatcher onBackPressedDispatcher;
  
      /* JADX INFO: this call moved to the top of the method (can break code semantics) */
      public ComponentDialog(Context context) {
          this(context, 0, 2, (DefaultConstructorMarker) null);
          Intrinsics.checkNotNullParameter(context, "context");
      }
  
      /* JADX INFO: super call moved to the top of the method (can break code semantics) */
      public ComponentDialog(Context context, int themeResId) {
          super(context, themeResId);
          Intrinsics.checkNotNullParameter(context, "context");
          this.onBackPressedDispatcher = new OnBackPressedDispatcher(new ComponentDialog$$ExternalSyntheticLambda0(this));
      }
  
      /* JADX INFO: this call moved to the top of the method (can break code semantics) */
      public /* synthetic */ ComponentDialog(Context context, int i, int i2, DefaultConstructorMarker defaultConstructorMarker) {
          this(context, (i2 & 2) != 0 ? 0 : i);
      }
  
      private final LifecycleRegistry getLifecycleRegistry() {
          LifecycleRegistry lifecycleRegistry = this._lifecycleRegistry;
          if (lifecycleRegistry != null) {
              return lifecycleRegistry;
          }
          LifecycleRegistry lifecycleRegistry2 = new LifecycleRegistry(this);
          this._lifecycleRegistry = lifecycleRegistry2;
          return lifecycleRegistry2;
      }
  
      private final void initViewTreeOwners() {
          Window window = getWindow();
          Intrinsics.checkNotNull(window);
          ViewTreeLifecycleOwner.set(window.getDecorView(), this);
          Window window2 = getWindow();
          Intrinsics.checkNotNull(window2);
          View decorView = window2.getDecorView();
          Intrinsics.checkNotNullExpressionValue(decorView, "window!!.decorView");
          ViewTreeOnBackPressedDispatcherOwner.set(decorView, this);
      }
  
      /* access modifiers changed from: private */
      /* renamed from: onBackPressedDispatcher$lambda-1  reason: not valid java name */
      public static final void m2onBackPressedDispatcher$lambda1(ComponentDialog this$0) {
          Intrinsics.checkNotNullParameter(this$0, "this$0");
          super.onBackPressed();
      }
  
      public void addContentView(View view, ViewGroup.LayoutParams params) {
          Intrinsics.checkNotNullParameter(view, "view");
          initViewTreeOwners();
          super.addContentView(view, params);
      }
  
      public final Lifecycle getLifecycle() {
          return getLifecycleRegistry();
      }
  
      public final OnBackPressedDispatcher getOnBackPressedDispatcher() {
          return this.onBackPressedDispatcher;
      }
  
      public void onBackPressed() {
          this.onBackPressedDispatcher.onBackPressed();
      }
  
      /* access modifiers changed from: protected */
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          getLifecycleRegistry().handleLifecycleEvent(Lifecycle.Event.ON_CREATE);
      }
  
      /* access modifiers changed from: protected */
      public void onStart() {
          super.onStart();
          getLifecycleRegistry().handleLifecycleEvent(Lifecycle.Event.ON_RESUME);
      }
  
      /* access modifiers changed from: protected */
      public void onStop() {
          getLifecycleRegistry().handleLifecycleEvent(Lifecycle.Event.ON_DESTROY);
          this._lifecycleRegistry = null;
          super.onStop();
      }
  
      public void setContentView(int layoutResID) {
          initViewTreeOwners();
          super.setContentView(layoutResID);
      }
  
      public void setContentView(View view) {
          Intrinsics.checkNotNullParameter(view, "view");
          initViewTreeOwners();
          super.setContentView(view);
      }
  
      public void setContentView(View view, ViewGroup.LayoutParams params) {
          Intrinsics.checkNotNullParameter(view, "view");
          initViewTreeOwners();
          super.setContentView(view, params);
      }
  }
  