boolean (@NotNull Collection<? extends IdeaPluginDescriptor> descriptors) { @SuppressWarnings("SSBasedInspection") var aliens = descriptors.stream() .filter(descriptor -> !(descriptor.isBundled() || PluginManagerCore.isDevelopedByJetBrains(descriptor))) .collect(Collectors.toList()); 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); 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; } }