From 0f15e6ba60acef2b9aedc4aee87f4fc855fe84d2 Mon Sep 17 00:00:00 2001 From: Nikita Iarychenko Date: Wed, 12 Feb 2025 18:43:22 +0400 Subject: [PATCH] OPENIDE #83 Fix DataSharing policy (the first thing that meets the user) (cherry picked from commit 172f6f84ec15413460cd40f65df064c6d9526ec5) (cherry picked from commit e99734f5479dfd77619b7971278ea4ac44b053a1) (cherry picked from commit 9c99ee035e08570f352684d8b94771e81f14c183) (cherry picked from commit 17515b30923951dad38f079ed408221372281300) (cherry picked from commit e41d2a70622959149cd380b5549a127131310a4e) --- .../src/com/intellij/platform/ide/bootstrap/eua.kt | 7 ++----- .../src/com/intellij/ide/gdpr/OpenIdeAgreements.kt | 10 ++++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 platform/platform-impl/src/com/intellij/ide/gdpr/OpenIdeAgreements.kt diff --git a/platform/platform-impl/bootstrap/src/com/intellij/platform/ide/bootstrap/eua.kt b/platform/platform-impl/bootstrap/src/com/intellij/platform/ide/bootstrap/eua.kt index 4ce12d40d206..045de2a4f222 100644 --- a/platform/platform-impl/bootstrap/src/com/intellij/platform/ide/bootstrap/eua.kt +++ b/platform/platform-impl/bootstrap/src/com/intellij/platform/ide/bootstrap/eua.kt @@ -1,10 +1,7 @@ // Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.platform.ide.bootstrap -import com.intellij.ide.gdpr.ConsentOptions -import com.intellij.ide.gdpr.EndUserAgreement -import com.intellij.ide.gdpr.showDataSharingAgreement -import com.intellij.ide.gdpr.showEndUserAndDataSharingAgreements +import com.intellij.ide.gdpr.* import com.intellij.idea.AppMode import com.intellij.openapi.application.ex.ApplicationInfoEx import com.intellij.platform.diagnostic.telemetry.impl.span @@ -81,7 +78,7 @@ internal suspend fun prepareShowEuaIfNeededTask( if (ConsentOptions.needToShowUsageStatsConsent()) { return { prepareAndExecuteInEdt { - showDataSharingAgreement() + acceptOpenIdeDataSharingAgreement() } false } diff --git a/platform/platform-impl/src/com/intellij/ide/gdpr/OpenIdeAgreements.kt b/platform/platform-impl/src/com/intellij/ide/gdpr/OpenIdeAgreements.kt new file mode 100644 index 000000000000..feef8bddeb0a --- /dev/null +++ b/platform/platform-impl/src/com/intellij/ide/gdpr/OpenIdeAgreements.kt @@ -0,0 +1,10 @@ +// Copyright (c) Haulmont 2025. All Rights Reserved. +// Use is subject to license terms. +package com.intellij.ide.gdpr + +import com.intellij.ui.AppUIUtil + +fun acceptOpenIdeDataSharingAgreement() { + val dataSharingConsent = ConsentOptions.getInstance().getConsents(ConsentOptions.condUsageStatsConsent()).first[0] + AppUIUtil.saveConsents(listOf(dataSharingConsent.derive(true))) +} \ No newline at end of file