package Ġdev . sas ikan th . pin nit . background . re ceiv ers Ċ Ċ import Ġandroid . content . Broadcast Receiver Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġandroid . util . Log Ċ import Ġdagger . h ilt . android . Android EntryPoint Ċ import Ġdev . sas ikan th . pin nit . notifications . Notification Repository Ċ import Ġdev . sas ikan th . pin nit . utils . Dispatcher Provider Ċ import Ġdev . sas ikan th . pin nit . utils . notification . Notification Util Ċ import Ġkotlinx . coroutines . Coroutine ExceptionHandler Ċ import Ġkotlinx . coroutines . Coroutine Scope Ċ import Ġkotlinx . coroutines . Supervisor Job Ċ import Ġkotlinx . coroutines . launch Ċ import Ġjava . util . UUID Ċ import Ġjavax . inject . Inject Ċ Ċ @ Android EntryPoint Ċ class ĠDelete Notification Receiver Ġ: ĠBroadcast Receiver () Ġ{ ĊĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġprivate Ġconst Ġval ĠTAG Ġ= Ġ" Delete Notification Receiver " ĊĊĠĠĠ Ġconst Ġval ĠACTION _ DELETE Ġ= Ġ" dev . sas ikan th . pin nit . system . action . Delete Notification " ĊĠĠĠ Ġconst Ġval ĠEX TRA _ NOTIFICATION _ UUID Ġ= Ġ" dev . sas ikan th . system . Delete Notification Receiver : notification Uuid " ĊĠ Ġ} ĊĊĠ Ġ@ Inject ĊĠ Ġlateinit Ġvar Ġrepository : ĠNotification Repository ĊĊĠ Ġ@ Inject ĊĠ Ġlateinit Ġvar Ġnotification Util : ĠNotification Util ĊĊĠ Ġ@ Inject ĊĠ Ġlateinit Ġvar Ġdispatcher Provider : ĠDispatcher Provider ĊĊĠ Ġprivate Ġval Ġjob Ġ= ĠSuper visor Job () ĊĠ Ġprivate Ġval Ġcoroutine ExceptionHandler Ġ= ĠCor outine ExceptionHandler Ġ{ Ġ_, Ġthrowable Ġ-> ĊĠĠĠ ĠLog . d ( TAG , Ġ" Failed Ġto Ġdelete Ġthe Ġnotification .", Ġthrowable ) ĊĠ Ġ} ĊĠ Ġprivate Ġval Ġmain Scope Ġby Ġlazy Ġ{ ĊĠĠĠ ĠCor outine Scope ( job Ġ+ Ġdispatcher Provider . main Ġ+ Ġcoroutine ExceptionHandler ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġon Receive ( context : ĠContext ?, Ġintent : ĠIntent ?) Ġ{ ĊĠĠĠ Ġval Ġnotification Uuid Ġ= Ġintent ?. getString Extra ( EXTRA _ NOTIFICATION _ UUID ) ĊĊĠĠĠ Ġif Ġ( context Ġ!= Ġnull Ġ&& Ġintent Ġ!= Ġnull Ġ&& Ġintent . action Ġ== ĠACTION _ DELETE Ġ&& Ġnotification Uuid Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠ Ġval Ġasync Result Ġ= Ġgo Async () ĊĊĠĠĠĠĠ Ġmain Scope . launch Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġnotification Id Ġ= ĠUUID . fromString ( notification Uuid ) ĊĠĠĠĠĠĠĠ Ġval Ġnotification Ġ= Ġrepository . notification ( notification Id ) ĊĠĠĠĠĠĠĠ Ġrepository . update Pin Status ( notification . uuid , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġrepository . delete Notification ( notification ) ĊĊĠĠĠĠĠĠĠ Ġnotification Util . dismiss Notification ( notification ) ĊĊĠĠĠĠĠĠĠ Ġasync Result . finish () ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ