IJPL-193751 Allow loading TraceConsentManager from JetBrains plugins only

GitOrigin-RevId: c2e6878e1cc00969c081e5090feb5c6b04c744fa
This commit is contained in:
Ilia Smirnov
2025-09-14 17:31:17 +00:00
committed by intellij-monorepo-bot
parent 934b1eedf2
commit cdcc47a0a8
@@ -1,6 +1,7 @@
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ide.gdpr.trace
import com.intellij.internal.statistic.utils.getPluginInfo
import com.intellij.openapi.extensions.ExtensionPointName
import org.jetbrains.annotations.ApiStatus
@@ -21,6 +22,10 @@ interface TraceConsentManager {
val EP_NAME: ExtensionPointName<TraceConsentManager> = ExtensionPointName("com.intellij.ide.gdpr.traceConsentManager")
@JvmStatic
fun getInstance(): TraceConsentManager? = EP_NAME.extensionList.firstOrNull()
fun getInstance(): TraceConsentManager? {
return EP_NAME.findFirstSafe {
getPluginInfo(it.javaClass).isDevelopedByJetBrains()
}
}
}
}