@@ -19,6 +19,7 @@ import { IProductService } from 'vs/platform/product/common/productService';
1919import { IHostService } from 'vs/workbench/services/host/browser/host' ;
2020import { IEnvironmentService } from 'vs/platform/environment/common/environment' ;
2121import { IJSONEditingService } from 'vs/workbench/services/configuration/common/jsonEditing' ;
22+ import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys' ;
2223
2324export abstract class AbstractTelemetryOptOut implements IWorkbenchContribution {
2425
@@ -27,6 +28,7 @@ export abstract class AbstractTelemetryOptOut implements IWorkbenchContribution
2728
2829 constructor (
2930 @IStorageService private readonly storageService : IStorageService ,
31+ @IStorageKeysSyncRegistryService storageKeysSyncRegistryService : IStorageKeysSyncRegistryService ,
3032 @IOpenerService private readonly openerService : IOpenerService ,
3133 @INotificationService private readonly notificationService : INotificationService ,
3234 @IHostService private readonly hostService : IHostService ,
@@ -37,7 +39,9 @@ export abstract class AbstractTelemetryOptOut implements IWorkbenchContribution
3739 @IProductService private readonly productService : IProductService ,
3840 @IEnvironmentService private readonly environmentService : IEnvironmentService ,
3941 @IJSONEditingService private readonly jsonEditingService : IJSONEditingService
40- ) { }
42+ ) {
43+ storageKeysSyncRegistryService . registerStorageKey ( { key : AbstractTelemetryOptOut . TELEMETRY_OPT_OUT_SHOWN , version : 1 } ) ;
44+ }
4145
4246 protected async handleTelemetryOptOut ( ) : Promise < void > {
4347 if ( this . productService . telemetryOptOutUrl && ! this . storageService . get ( AbstractTelemetryOptOut . TELEMETRY_OPT_OUT_SHOWN , StorageScope . GLOBAL ) ) {
@@ -161,6 +165,7 @@ export class BrowserTelemetryOptOut extends AbstractTelemetryOptOut {
161165
162166 constructor (
163167 @IStorageService storageService : IStorageService ,
168+ @IStorageKeysSyncRegistryService storageKeysSyncRegistryService : IStorageKeysSyncRegistryService ,
164169 @IOpenerService openerService : IOpenerService ,
165170 @INotificationService notificationService : INotificationService ,
166171 @IHostService hostService : IHostService ,
@@ -172,7 +177,7 @@ export class BrowserTelemetryOptOut extends AbstractTelemetryOptOut {
172177 @IEnvironmentService environmentService : IEnvironmentService ,
173178 @IJSONEditingService jsonEditingService : IJSONEditingService
174179 ) {
175- super ( storageService , openerService , notificationService , hostService , telemetryService , experimentService , configurationService , galleryService , productService , environmentService , jsonEditingService ) ;
180+ super ( storageService , storageKeysSyncRegistryService , openerService , notificationService , hostService , telemetryService , experimentService , configurationService , galleryService , productService , environmentService , jsonEditingService ) ;
176181
177182 this . handleTelemetryOptOut ( ) ;
178183 }
0 commit comments