package Ġcom . fs ck . k 9 . job Ċ Ċ import Ġandroidx . work . Work Manager Ċ import Ġcom . fs ck . k 9 . Account Ċ import Ġcom . fs ck . k 9 . Preferences Ċ import Ġtim ber . log . Tim ber Ċ Ċ class ĠK 9 Job Manager ( ĊĠĠĠ Ġprivate Ġval Ġwork Manager : ĠWork Manager , ĊĠĠĠ Ġprivate Ġval Ġpreferences : ĠPreferences , ĊĠĠĠ Ġprivate Ġval Ġmail Sync Worker Manager : ĠMail Sync Worker Manager Ċ ) Ġ{ ĊĠĠĠ Ġfun Ġschedule All Mail Jobs () Ġ{ ĊĠĠĠĠĠĠĠ ĠTim ber . v (" scheduling Ġall Ġjobs ") ĊĠĠĠĠĠĠĠ Ġschedule Mail Sync () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġschedule Mail Sync ( account : ĠAccount ) Ġ{ ĊĠĠĠĠĠĠĠ Ġmail Sync Worker Manager . cancel Mail Sync ( account ) ĊĠĠĠĠĠĠĠ Ġmail Sync Worker Manager . schedule Mail Sync ( account ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġschedule Mail Sync () Ġ{ ĊĠĠĠĠĠĠĠ Ġcancel All Mail Sync Jobs () ĊĊĠĠĠĠĠĠĠ Ġpreferences . accounts . forEach Ġ{ Ġaccount Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmail Sync Worker Manager . schedule Mail Sync ( account ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġcancel All Mail Sync Jobs () Ġ{ ĊĠĠĠĠĠĠĠ ĠTim ber . v (" cancel ing Ġmail Ġsync Ġjob ") ĊĠĠĠĠĠĠĠ Ġwork Manager . cancel All Work By Tag ( Mail Sync Worker Manager . MAIL _ SYNC _ TAG ) ĊĠĠĠ Ġ} Ċ } Ċ