@@ -4,7 +4,6 @@ import * as path from "path";
4
4
import { cache } from "../../common/decorators" ;
5
5
6
6
export class AnalyticsService extends AnalyticsServiceBase implements IAnalyticsService {
7
- private static ANALYTICS_FEATURE_USAGE_TRACKING_API_KEY = "9912cff308334c6d9ad9c33f76a983e3" ;
8
7
private static ANALYTICS_BROKER_START_TIMEOUT = 30 * 1000 ;
9
8
10
9
constructor ( protected $logger : ILogger ,
@@ -13,11 +12,10 @@ export class AnalyticsService extends AnalyticsServiceBase implements IAnalytics
13
12
$prompter : IPrompter ,
14
13
$userSettingsService : UserSettings . IUserSettingsService ,
15
14
$analyticsSettingsService : IAnalyticsSettingsService ,
16
- $progressIndicator : IProgressIndicator ,
17
15
$osInfo : IOsInfo ,
18
16
private $childProcess : IChildProcess ,
19
17
private $processService : IProcessService ) {
20
- super ( $logger , $options , $staticConfig , $prompter , $userSettingsService , $analyticsSettingsService , $progressIndicator , $ osInfo) ;
18
+ super ( $logger , $options , $staticConfig , $prompter , $userSettingsService , $analyticsSettingsService , $osInfo ) ;
21
19
}
22
20
23
21
public track ( featureName : string , featureValue : string ) : Promise < void > {
@@ -28,12 +26,12 @@ export class AnalyticsService extends AnalyticsServiceBase implements IAnalytics
28
26
return this . sendExceptionForTracking ( exception , message ) ;
29
27
}
30
28
31
- protected async checkConsentCore ( trackFeatureUsage : boolean ) : Promise < void > {
32
- await this . restartEqatecMonitor ( AnalyticsService . ANALYTICS_FEATURE_USAGE_TRACKING_API_KEY ) ;
33
- await super . checkConsentCore ( trackFeatureUsage ) ;
29
+ public async trackAcceptFeatureUsage ( settings : { acceptTrackFeatureUsage : boolean } ) : Promise < void > {
34
30
35
- // Stop the monitor, so correct API_KEY will be used when features are tracked.
36
- this . tryStopEqatecMonitor ( ) ;
31
+ this . sendMessageToBroker ( < IAcceptUsageReportingInformation > {
32
+ type : TrackingTypes . AcceptTrackFeatureUsage ,
33
+ acceptTrackFeatureUsage : settings . acceptTrackFeatureUsage
34
+ } ) ;
37
35
}
38
36
39
37
@cache ( )
@@ -93,7 +91,7 @@ export class AnalyticsService extends AnalyticsServiceBase implements IAnalytics
93
91
94
92
if ( this . analyticsStatuses [ this . $staticConfig . TRACK_FEATURE_USAGE_SETTING_NAME ] === AnalyticsStatus . enabled ) {
95
93
return this . sendMessageToBroker (
96
- {
94
+ < IFeatureTrackingInformation > {
97
95
type : TrackingTypes . Feature ,
98
96
featureName : featureName ,
99
97
featureValue : featureValue
@@ -107,7 +105,7 @@ export class AnalyticsService extends AnalyticsServiceBase implements IAnalytics
107
105
108
106
if ( this . analyticsStatuses [ this . $staticConfig . ERROR_REPORT_SETTING_NAME ] === AnalyticsStatus . enabled ) {
109
107
return this . sendMessageToBroker (
110
- {
108
+ < IExceptionsTrackingInformation > {
111
109
type : TrackingTypes . Exception ,
112
110
exception,
113
111
message
@@ -116,7 +114,7 @@ export class AnalyticsService extends AnalyticsServiceBase implements IAnalytics
116
114
}
117
115
}
118
116
119
- private async sendMessageToBroker ( message : any ) : Promise < void > {
117
+ private async sendMessageToBroker ( message : ITrackingInformation ) : Promise < void > {
120
118
const broker = await this . getAnalyticsBroker ( ) ;
121
119
return new Promise < void > ( ( resolve , reject ) => broker . send ( message , resolve ) ) ;
122
120
}
0 commit comments