package Ġcom . jr ask a . github . client . startup Ċ Ċ import Ġandroid . os . Process Ċ import Ġandroid . os . System Clock Ċ import Ġcom . jr ask a . github . client . Owner Ċ import Ġcom . jr ask a . github . client . analytics . Analytics Event Ċ import Ġcom . jr ask a . github . client . analytics . Event Analytics Ċ import Ġtim ber . log . Tim ber Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠStartup Analytics Reporter Ġ@ Inject Ġconstructor ( ĊĠ Ġprivate Ġval Ġevent Analytics : ĠEvent Analytics Ċ ) Ġ{ ĊĠ Ġfun Ġreport Foreground Launch ( la unched Activity : ĠString , Ġstartup Saved State Present : ĠBoolean ) Ġ{ ĊĠĠĠ Ġval Ġlaunch Time Now Ġ= Ġlaunch Time Now () ĊĠĠĠ ĠTim ber . d (" App Startup Ġis Ġ% s Ġms , Ġactivity : Ġ% s , Ġsaved State : Ġ% s ", Ġlaunch Time Now , Ġlaunched Activity , Ġstartup Saved State Present ) ĊĊĠĠĠ Ġval Ġevent Builder Ġ= Ġif Ġ( startup Saved State Present ) Ġ{ ĊĠĠĠĠĠ ĠAnalytics Event . builder ( ANAL YT ICS _ AFTER _ KILL _ START ) ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠ ĠAnalytics Event . builder ( ANAL YT ICS _ COL D _ START ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġevent Builder . addProperty (" time ", Ġlaunch Time Now ) ĊĠĠĠ Ġevent Builder . addProperty (" activity ", Ġlaunched Activity ) ĊĊĠĠĠ Ġevent Analytics . report ( event Builder . build ()) ĊĠ Ġ} ĊĊĠ Ġfun Ġreport Background Launch () Ġ{ ĊĠĠĠ ĠTim ber . d (" App Startup Ġin Ġthe Ġbackground ") ĊĊĠĠĠ Ġevent Analytics . report ( Analytics Event . create ( ANAL YT ICS _ BACKGROUND _ START )) ĊĠ Ġ} ĊĊĠ Ġfun Ġreport Foreground Launch Without Activity () Ġ{ ĊĠĠĠ ĠTim ber . d (" App Ġstarted Ġas Ġforeground , Ġbut Ġpost Ġran Ġbefore Ġany ĠActivity ĠonCreate () ") ĊĊĠĠĠ Ġevent Analytics . report ( Analytics Event . create ( ANAL YT ICS _ UNDEFINED )) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġlaunch Time Now () Ġ= ĠSystem Clock . uptime Millis () Ġ- ĠProcess . getStart U ptime Millis () ĊĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġval ĠAN AL YT ICS _ COL D _ START Ġ= ĠAnalytics Event . Key (" start _ cold ", ĠOwner . PER FORMANCE _ TEAM ) ĊĠĠĠ Ġval ĠAN AL YT ICS _ AFTER _ KILL _ START Ġ= ĠAnalytics Event . Key (" start _ warm _ after _ kill ", ĠOwner . PER FORMANCE _ TEAM ) ĊĠĠĠ Ġval ĠAN AL YT ICS _ BACKGROUND _ START Ġ= ĠAnalytics Event . Key (" start _ background ", ĠOwner . PER FORMANCE _ TEAM ) ĊĠĠĠ Ġval ĠAN AL YT ICS _ UNDEFINED Ġ= ĠAnalytics Event . Key (" start _ foreground _ undefined ", ĠOwner . PER FORMANCE _ TEAM ) ĊĠ Ġ} Ċ } Ċ