Have vscode.env.telemetryEnabled respect product config
This commit is contained in:
parent
1c324f820b
commit
ad42148eeb
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue