package Ġcom . sil encer Ċ Ċ import Ġandroid . annotation . Suppress Lint Ċ import Ġandroid . content . Broadcast Receiver Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġandroid . os . Handler Ċ import Ġandroid . tele phony . Tele phony Manager Ċ import Ġandroid . util . Log Ċ Ċ class ĠPhone State Receiver Ġ: ĠBroadcast Receiver () Ġ{ ĊĊĠĠĠ Ġ@ Suppress Lint (" Unsafe Protected Broadcast Receiver ") ĊĠĠĠ Ġoverride Ġfun Ġon Receive ( context : ĠContext , Ġintent : ĠIntent ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLog . d (" Sil encer ", Ġ" incoming ĠCall ") ĊĊĠĠĠĠĠĠĠ Ġval Ġstate Str Ġ= Ġintent . extras !!. getString ( Tele phony Manager . EXTRA _ STATE ) !! ĊĠĠĠĠĠĠĠ Ġif Ġ( state Str . equals ( Tele phony Manager . EXTRA _ STATE _ RING ING )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠHandler (). post Delayed ({ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠEngine . sil ence ( context ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}, Ġ 5 0 0 ) ĊĠĠĠĠĠĠĠ Ġ} Ċ Ċ // ĠĠĠĠĠĠĠ Ġval Ġtele phony Ġ= Ġcontext . getSystem Service ( Context . TELE PHONY _ SERVICE ) Ġas ĠTele phony Manager Ċ // ĠĠĠĠĠĠĠ Ġtele phony . listen ( Phone State ChangeListener ( context ), ĠPhone State Listener . LIST EN _ CALL _ STATE ) ĊĠĠĠ Ġ} Ċ } Ċ