package Ġcom . react native vo ise k app extension . call screen service Ċ Ċ import Ġandroid . os . Build Ċ import Ġandroid . tele com . Call . Details Ċ import Ġandroid . tele com . Call Screen ing Service Ċ import Ġandroid . tele phony . PhoneNumber Utils Ċ import Ġandroid . util . Log Ċ import Ġandroidx . annotation . Requires Api Ċ import Ġcom . facebook . react . bridge . React ApplicationContext Ċ import Ġcom . facebook . react . modules . core . Permission Aware Activity Ċ import Ġcom . react native vo ise k app extension . utils . Constants Ċ import Ġjava . util .* Ċ Ċ @ Requires Api ( api Ġ= ĠBuild . VERSION _ CODES . Q ) Ċ class ĠVo ise k Call Screen Service Ġ: ĠCall Screen ing Service () Ġ{ ĊĠ Ġoverride Ġfun Ġon Screen Call ( details : ĠDetails ) Ġ{ ĊĠĠĠ ĠLog . d (" Call Screen ing Service ", Ġdetails . handle . scheme Specific Part ) ĊĠĠĠ Ġif Ġ( is Block Calls On List Active ) Ġ{ ĊĠĠĠĠĠ Ġif Ġ( details . call Direction Ġ== ĠDetails . DIRECTION _ IN COM ING ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠphoneNumber Ġ= Ġdetails . handle . scheme Specific Part ĊĠĠĠĠĠĠĠ Ġif Ġ( is Phone On Black List ( phoneNumber )) Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġrespond To Call ( details , Ġblock Call Response ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġblock Call Response (): ĠCall Response Ġ{ ĊĠĠĠ Ġreturn ĠCall Response . Builder (). set Dis allow Call ( true ) ĊĠĠĠĠĠ Ġ. set Reject Call ( true ) ĊĠĠĠĠĠ Ġ. set Skip Notification ( true ) ĊĠĠĠĠĠ Ġ. set Skip Call Log ( false ) ĊĠĠĠĠĠ Ġ. build () ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġis Phone On Black List ( phoneNumber : ĠString ): ĠBoolean Ġ{ ĊĠĠĠ Ġval Ġshared Preferences Blocking Numbers Ġ= Ġget SharedPreferences ( Constants . CALL ER _ BLOCK _ KEY , ĠMODE _ PRIVATE ) ĊĠĠĠ Ġif Ġ( shared Preferences Blocking Numbers . contains ( phoneNumber )) Ġ{ ĊĠĠĠĠĠ Ġreturn Ġtrue ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠ Ġval ĠphoneNumber List : ĠList < String > Ġ= ĠArrayList ( shared Preferences Blocking Numbers . all . keys ) ĊĠĠĠĠĠ Ġfor Ġ( n Ġin ĠphoneNumber List ) Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( PhoneNumber Utils . compare ( this , ĠphoneNumber , Ġn )) Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġreturn Ġtrue ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn Ġfalse ĊĠ Ġ} ĊĊĠ Ġprivate Ġval Ġis Block Calls On List Active : ĠBoolean ĊĠĠĠ Ġget () Ġ{ ĊĠĠĠĠĠ Ġval Ġshared Preferences Options Ġ= Ġget SharedPreferences ( Constants . CALL ER _ OPTIONS _ KEY , ĠMODE _ PRIVATE ) ĊĠĠĠĠĠ Ġreturn Ġshared Preferences Options . getBoolean ( Constants . OPTION _ BLOCK _ CALL _ ON _ BLACK _ LIST , Ġfalse ) ĊĠĠĠ Ġ} Ċ } Ċ