class AsyncDevicesGetter {

  @VisibleForTesting
  final void initChecker(@Nullable RunnerAndConfigurationSettings configurationAndSettings,
                         @NotNull Function<Module, AndroidFacet> facetGetter) {
    if (configurationAndSettings == null) {
      myChecker = null;
      return;
    }

    Object configuration = configurationAndSettings.getConfiguration();

    if (!(configuration instanceof ModuleBasedConfiguration)) {
      myChecker = null;
      return;
    }

    Module module = ((ModuleBasedConfiguration)configuration).getConfigurationModule().getModule();

    if (module == null) {
      myChecker = null;
      return;
    }

    AndroidFacet facet = facetGetter.apply(module);

    if (facet == null || Disposer.isDisposed(facet)) {
      myChecker = null;
      return;
    }

    Object platform = AndroidPlatform.getInstance(facet.getModule());

    if (platform == null) {
      myChecker = null;
      return;
    }

    myChecker = LaunchCompatibilityCheckerImpl.create(facet, null, null);
  }

  @SuppressWarnings("unused") private  AsyncDevicesGetter(@NotNull Project project);
  @NonInjectable @VisibleForTesting  AsyncDevicesGetter(@NotNull Project project,
                     @NotNull BooleanSupplier selectDeviceSnapshotComboBoxSnapshotsEnabled,
                     @NotNull KeyToConnectionTimeMap map,
                     @NotNull Function<ConnectedDevice, String> getName);

}