private boolean checkPermission ( String permission ) { int res = ctx . checkCallingOrSelfPermission ( permission ) ; return ( res == PackageManager . PERMISSION_GRANTED ) ; }
Check whether the application has been granted a certain permission .