package Ġcom . openj its u . android . openj its u . data . repositories Ċ Ċ import Ġandroid . util . Log Ċ import Ġcom . openj its u . android . openj its u . Application Ċ import Ġcom . openj its u . android . openj its u . data . models . Submission Ċ import Ġcom . openj its u . android . openj its u . data . network . Api Ċ import Ġcom . openj its u . android . openj its u . util . No Connectivity Exception Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠSubmission Repository : ĠRepository () Ġ{ ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ ĠApplication . app Component . inject ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun ĠgetAll Sub missions (): ĠList < Submission > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLog . i (" openj its u / repo ", Ġ" At tempting Ġto Ġget Ġfrom ĠSub missions ĠRepository ...") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġitems Ġ= Ġapi . getAll Sub missions (). await () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif ( shared Preferences . getBoolean (" submissions _ db _ inserted ", Ġtrue )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġdao . insert Sub missions ( items ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġshared Preferences . edit (). put Boolean ("", Ġfalse ). apply () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġitems ĊĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( e : ĠNo Connectivity Exception ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLog . i (" openj its u / repo ", Ġ" No Ġnetwork Ġconnectivity , Ġreturning Ġsaved Ġsubmissions ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdao . getAll Sub missions () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }