/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 1 9 ĠThe ĠAndroid ĠOpen ĠSource ĠProject Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ package Ġcom . android . tools . idea . gradle . project . sync . issues Ċ Ċ import Ġcom . android . tools . analytics . Usage Tracker Ċ import Ġcom . android . tools . idea . gradle . project . sync . Gradle Sync State Ċ import Ġcom . google . wire less . android . sdk . stats . Android Studio Event Ċ import Ġcom . google . wire less . android . sdk . stats . Gradle Sync Issue Ċ import Ġcom . intellij . openapi . diagnostic . Logger Ċ import Ġcom . intellij . openapi . project . Project Ċ Ċ private Ġval ĠLOG Ġ= ĠLogger . getInstance ( Sync Issue Usage Reporter Impl :: class . java ) Ċ Ċ class ĠSync Issue Usage Reporter Impl ( private Ġval Ġproject : ĠProject ) Ġ: ĠSync Issue Usage Reporter Ġ{ ĊĠ Ġprivate Ġval Ġcollected Issues Ġ= Ġmutable ListOf < Gradle Sync Issue >() ĊĠ Ġprivate Ġval Ġcollected Quick Fixes Ġ= Ġmutable ListOf < Android Studio Event . Gradle Sync Quick Fix >() ĊĠ Ġprivate Ġvar Ġcollected Failure : ĠAndroid Studio Event . Gradle Sync Failure ? Ġ= Ġnull ĊĊĠ Ġoverride Ġfun Ġreport To Usage Tracker () Ġ{ ĊĠĠĠ Ġif Ġ( collected Issues . isNotEmpty ()) Ġ{ ĊĠĠĠĠĠ ĠUsage Tracker . log ( ĊĠĠĠĠĠĠĠĠĠ ĠGradle Sync State ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. getInstance ( project ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. generate Sync Event ( Android Studio Event . Event Kind . GRAD LE _ SYNC _ ISS UES ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. addAll Gradle Sync Issues ( collected Issues )) ĊĠĠĠĠĠ Ġcollected Issues . clear () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġif Ġ( collected Quick Fixes . isNotEmpty () Ġ|| Ġcollected Failure Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠ ĠUsage Tracker . log ( ĊĠĠĠĠĠĠĠĠĠ ĠGradle Sync State ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. getInstance ( project ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. generate Sync Event ( Android Studio Event . Event Kind . GRAD LE _ SYNC _ FAILURE _ DETAILS ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. addAll Offer ed Quick Fixes ( collected Quick Fixes ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Gradle Sync Failure ( collected Failure Ġ?: ĠAndroid Studio Event . Gradle Sync Failure . UNKNOWN _ GRAD LE _ FAILURE )) ĊĊĠĠĠĠĠ Ġcollected Failure Ġ= Ġnull ĊĠĠĠĠĠ Ġcollected Quick Fixes . clear () ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġcollect ( issue : ĠGradle Sync Issue . Builder ) Ġ{ ĊĠĠĠ Ġcollected Issues . add ( issue . build ()) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġcollect ( quick Fixes : ĠCollection < Android Studio Event . Gradle Sync Quick Fix >) Ġ{ ĊĠĠĠ Ġcollected Quick Fixes . addAll ( quick Fixes ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġcollect ( failure : ĠAndroid Studio Event . Gradle Sync Failure ) Ġ{ ĊĠĠĠ Ġif Ġ( collected Failure Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠ ĠLOG . warn (" Multiple Ġsync Ġfailures Ġreported . ĠDis card ing : Ġ$ collected Failure ") ĊĠĠĠ Ġ} ĊĠĠĠ Ġcollected Failure Ġ= Ġfailure ĊĠ Ġ} Ċ } ĊĊ