未验证 提交 ad42148e 编写于 作者: L Logan Ramos

Have vscode.env.telemetryEnabled respect product config

上级 1c324f82
......@@ -10,6 +10,7 @@ import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/pla
import { Disposable } from 'vs/base/common/lifecycle';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { IProductService } from 'vs/platform/product/common/productService';
@extHostNamedCustomer(MainContext.MainThreadTelemetry)
export class MainThreadTelemetry extends Disposable implements MainThreadTelemetryShape {
......@@ -22,12 +23,13 @@ export class MainThreadTelemetry extends Disposable implements MainThreadTelemet
@ITelemetryService private readonly _telemetryService: ITelemetryService,
@IConfigurationService private readonly _configurationService: IConfigurationService,
@IEnvironmentService private readonly _environmenService: IEnvironmentService,
@IProductService private readonly _productService: IProductService
) {
super();
this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostTelemetry);
if (!this._environmenService.disableTelemetry) {
if (!this._environmenService.disableTelemetry && this._productService.enableTelemetry) {
this._register(this._configurationService.onDidChangeConfiguration(e => {
if (e.affectedKeys.includes('telemetry.enableTelemetry')) {
this._proxy.$onDidChangeTelemetryEnabled(this.telemetryEnabled);
......@@ -39,7 +41,7 @@ export class MainThreadTelemetry extends Disposable implements MainThreadTelemet
}
private get telemetryEnabled(): boolean {
if (this._environmenService.disableTelemetry) {
if (this._environmenService.disableTelemetry || !this._productService.enableTelemetry) {
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册