From 269865c45741e9f118cffb04d3d74062bd4a092a Mon Sep 17 00:00:00 2001 From: Suzy Kostumyan Date: Mon, 10 Aug 2026 14:27:58 +0400 Subject: [PATCH] DO-4699 Enable Feature Usage Statistics Reporting for Custom CLI ApplicationStarter in Headless Mode Update shouldReportStatistics to use !isHeadless Update KDoc GitOrigin-RevId: 1099d3dd36c74b5b34ac40a1b6cdcc7a46846d94 --- .../openapi/application/ApplicationStarter.kt | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/platform/ide-core/src/com/intellij/openapi/application/ApplicationStarter.kt b/platform/ide-core/src/com/intellij/openapi/application/ApplicationStarter.kt index 52a7ec1a8054..d7f108418de0 100644 --- a/platform/ide-core/src/com/intellij/openapi/application/ApplicationStarter.kt +++ b/platform/ide-core/src/com/intellij/openapi/application/ApplicationStarter.kt @@ -74,16 +74,22 @@ interface ApplicationStarter { val isHeadless: Boolean get() = true /** - * Starters representing a user-facing product feature should override the method and return `true` - * to let the platform collect feature usage statistics while they run. + * Controls whether the platform may collect and report feature usage statistics while this starter runs. * - * Statistics are suppressed in a headless mode by default, so that runs on CI, in tests and in other - * automated environments do not pollute the collected data. Opting in does not bypass the user consent: - * the platform still checks it, see `StatisticsUploadAssistant.isCollectAllowed`. + * The flag is only consulted when the application runs in a headless environment. In non-headless mode + * (when [isHeadless] returns `false`) statistics are always governed by the normal user-consent flow, + * and overriding this property to `false` has no effect. + * + * In headless mode statistics are suppressed by default (the default value is `!isHeadless`), so that + * runs on CI, in tests, and in other automated environments do not pollute the collected data. + * Starters representing a user-facing product feature should override and return `true` to opt in. + * + * Opting in does not bypass user consent: the platform still checks it, + * see `StatisticsUploadAssistant.isCollectAllowed`. * * Keep the default for starters used by CI jobs, tests or build tooling. */ - val shouldReportStatistics: Boolean get() = false + val shouldReportStatistics: Boolean get() = !isHeadless /** * Applications that are capable of processing command-line arguments within a running IDE instance