content: package androidx.lifecycle;
  
  import android.app.Activity;
  import android.app.Application;
  import android.app.Fragment;
  import android.app.FragmentManager;
  import android.os.Build;
  import android.os.Bundle;
  import androidx.lifecycle.Lifecycle;
  
  public class ReportFragment extends Fragment {
      private static final String REPORT_FRAGMENT_TAG = "androidx.lifecycle.LifecycleDispatcher.report_fragment_tag";
      private ActivityInitializationListener mProcessListener;
  
      interface ActivityInitializationListener {
          void onCreate();
  
          void onResume();
  
          void onStart();
      }
  
      static class LifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
          LifecycleCallbacks() {
          }
  
          static void registerIn(Activity activity) {
              activity.registerActivityLifecycleCallbacks(new LifecycleCallbacks());
          }
  
          public void onActivityCreated(Activity activity, Bundle bundle) {
          }
  
          public void onActivityDestroyed(Activity activity) {
          }
  
          public void onActivityPaused(Activity activity) {
          }
  
          public void onActivityPostCreated(Activity activity, Bundle savedInstanceState) {
              ReportFragment.dispatch(activity, Lifecycle.Event.ON_CREATE);
          }
  
          public void onActivityPostResumed(Activity activity) {
              ReportFragment.dispatch(activity, Lifecycle.Event.ON_RESUME);
          }
  
          public void onActivityPostStarted(Activity activity) {
              ReportFragment.dispatch(activity, Lifecycle.Event.ON_START);
          }
  
          public void onActivityPreDestroyed(Activity activity) {
              ReportFragment.dispatch(activity, Lifecycle.Event.ON_DESTROY);
          }
  
          public void onActivityPrePaused(Activity activity) {
              ReportFragment.dispatch(activity, Lifecycle.Event.ON_PAUSE);
          }
  
          public void onActivityPreStopped(Activity activity) {
              ReportFragment.dispatch(activity, Lifecycle.Event.ON_STOP);
          }
  
          public void onActivityResumed(Activity activity) {
          }
  
          public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
          }
  
          public void onActivityStarted(Activity activity) {
          }
  
          public void onActivityStopped(Activity activity) {
          }
      }
  
      static void dispatch(Activity activity, Lifecycle.Event event) {
          if (activity instanceof LifecycleRegistryOwner) {
              ((LifecycleRegistryOwner) activity).getLifecycle().handleLifecycleEvent(event);
          } else if (activity instanceof LifecycleOwner) {
              Lifecycle lifecycle = ((LifecycleOwner) activity).getLifecycle();
              if (lifecycle instanceof LifecycleRegistry) {
                  ((LifecycleRegistry) lifecycle).handleLifecycleEvent(event);
              }
          }
      }
  
      private void dispatch(Lifecycle.Event event) {
          if (Build.VERSION.SDK_INT < 29) {
              dispatch(getActivity(), event);
          }
      }
  
      private void dispatchCreate(ActivityInitializationListener listener) {
          if (listener != null) {
              listener.onCreate();
          }
      }
  
      private void dispatchResume(ActivityInitializationListener listener) {
          if (listener != null) {
              listener.onResume();
          }
      }
  
      private void dispatchStart(ActivityInitializationListener listener) {
          if (listener != null) {
              listener.onStart();
          }
      }
  
      static ReportFragment get(Activity activity) {
          return (ReportFragment) activity.getFragmentManager().findFragmentByTag(REPORT_FRAGMENT_TAG);
      }
  
      public static void injectIfNeededIn(Activity activity) {
          if (Build.VERSION.SDK_INT >= 29) {
              LifecycleCallbacks.registerIn(activity);
          }
          FragmentManager fragmentManager = activity.getFragmentManager();
          if (fragmentManager.findFragmentByTag(REPORT_FRAGMENT_TAG) == null) {
              fragmentManager.beginTransaction().add(new ReportFragment(), REPORT_FRAGMENT_TAG).commit();
              fragmentManager.executePendingTransactions();
          }
      }
  
      public void onActivityCreated(Bundle savedInstanceState) {
          super.onActivityCreated(savedInstanceState);
          dispatchCreate(this.mProcessListener);
          dispatch(Lifecycle.Event.ON_CREATE);
      }
  
      public void onDestroy() {
          super.onDestroy();
          dispatch(Lifecycle.Event.ON_DESTROY);
          this.mProcessListener = null;
      }
  
      public void onPause() {
          super.onPause();
          dispatch(Lifecycle.Event.ON_PAUSE);
      }
  
      public void onResume() {
          super.onResume();
          dispatchResume(this.mProcessListener);
          dispatch(Lifecycle.Event.ON_RESUME);
      }
  
      public void onStart() {
          super.onStart();
          dispatchStart(this.mProcessListener);
          dispatch(Lifecycle.Event.ON_START);
      }
  
      public void onStop() {
          super.onStop();
          dispatch(Lifecycle.Event.ON_STOP);
      }
  
      /* access modifiers changed from: package-private */
      public void setProcessListener(ActivityInitializationListener processListener) {
          this.mProcessListener = processListener;
      }
  }
  