public static boolean checkThirdPartyPluginsAllowed(@NotNull Collection<? extends IdeaPluginDescriptor> descriptors) {
    var aliens = ContainerUtil.filter(descriptors, descriptor -> !(descriptor.isBundled() || PluginManagerCore.isVendorTrusted(descriptor)));
    if (aliens.isEmpty()) return true;

    var updateSettings = UpdateSettings.getInstance();
    if (updateSettings.isThirdPartyPluginsAllowed()) {
      PluginManagerUsageCollector.thirdPartyAcceptanceCheck(DialogAcceptanceResultEnum.AUTO_ACCEPTED);
      return true;
    }

    if (AppMode.isHeadless()) {
      // postponing the dialog till the next start
      PluginManagerCore.INSTANCE.write3rdPartyPlugins(aliens);
      return true;
    }

    var title = CoreBundle.message("third.party.plugins.privacy.note.title");
    var pluginList = aliens.stream()
      .map(descriptor -> "&nbsp;&nbsp;&nbsp;" + PluginManagerCore.getPluginNameAndVendor(descriptor))
      .collect(Collectors.joining("<br>"));
    var message = CoreBundle.message("third.party.plugins.privacy.note.text", pluginList, ApplicationInfo.getInstance().getShortCompanyName());
    var yesText = CoreBundle.message("third.party.plugins.privacy.note.accept");
    var noText = CommonBundle.getCancelButtonText();
    if (Messages.showYesNoDialog(message, title, yesText, noText, Messages.getWarningIcon()) == Messages.YES) {
      updateSettings.setThirdPartyPluginsAllowed(true);
      PluginManagerUsageCollector.thirdPartyAcceptanceCheck(DialogAcceptanceResultEnum.ACCEPTED);
      return true;
    }
    else {
      PluginManagerUsageCollector.thirdPartyAcceptanceCheck(DialogAcceptanceResultEnum.DECLINED);
      return false;
    }
  }
public static boolean checkThirdPartyPluginsAllowed(@NotNull Collection<? extends IdeaPluginDescriptor> descriptors)