@@ -8,7 +8,8 @@ let clui = require("clui");
88class DoctorService implements IDoctorService {
99 private static MIN_SUPPORTED_POD_VERSION = "0.38.2" ;
1010
11- constructor ( private $androidToolsInfo : IAndroidToolsInfo ,
11+ constructor ( private $analyticsService : IAnalyticsService ,
12+ private $androidToolsInfo : IAndroidToolsInfo ,
1213 private $hostInfo : IHostInfo ,
1314 private $logger : ILogger ,
1415 private $progressIndicator : IProgressIndicator ,
@@ -18,7 +19,7 @@ class DoctorService implements IDoctorService {
1819 private $npm : INodePackageManager ,
1920 private $fs : IFileSystem ) { }
2021
21- public printWarnings ( ) : boolean {
22+ public printWarnings ( configOptions ?: { trackResult : boolean } ) : boolean {
2223 let result = false ;
2324 let sysInfo = this . $sysInfo . getSysInfo ( path . join ( __dirname , ".." , ".." , "package.json" ) ) . wait ( ) ;
2425
@@ -88,7 +89,14 @@ class DoctorService implements IDoctorService {
8889
8990 let androidToolsIssues = this . $androidToolsInfo . validateInfo ( ) . wait ( ) ;
9091 let javaVersionIssue = this . $androidToolsInfo . validateJava ( sysInfo . javacVersion ) . wait ( ) ;
91- return result || androidToolsIssues || javaVersionIssue ;
92+
93+ let doctorResult = result || androidToolsIssues || javaVersionIssue ;
94+
95+ if ( ! configOptions || configOptions . trackResult ) {
96+ this . $analyticsService . track ( "DoctorEnvironmentSetup" , doctorResult ? "incorrect" : "correct" ) . wait ( ) ;
97+ }
98+
99+ return doctorResult ;
92100 }
93101
94102 private printPackageManagerTip ( ) {
0 commit comments