package Ġcom . ly j . domain . use case . android . permission Ċ Ċ import Ġandroid . app . Activity Ċ import Ġcom . ly j . domain . repository . android . Is All Granted Ċ import Ġcom . ly j . domain . repository . android . Permission Repository Ċ import Ġio . reactivex . rx java 3 . android . schedul ers . Android Schedulers Ċ import Ġio . reactivex . rx java 3 . core . Single Ċ import Ġjavax . inject . Inject Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Singleton Ċ class ĠPermission Check UseCase Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġpermission Repository : ĠPermission Repository Ċ ) Ġ{ ĊĠĠĠ Ġfun Ġexecute ( ĊĠĠĠĠĠĠĠ Ġactivity : ĠActivity , ĊĠĠĠĠĠĠĠ Ġpermissions : ĠArray < String > ĊĠĠĠ Ġ): ĠSingle < Is All Granted > Ġ= ĊĠĠĠĠĠĠĠ Ġpermission Repository ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check And Request Permission ( activity , Ġpermissions ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. observe On ( Android Schedulers . main Thread ()) Ċ }