private boolean hasVibratePermission ( Context context ) { PackageManager pm = context . getPackageManager ( ) ; int hasPerm = pm . checkPermission ( android . Manifest . permission . VIBRATE , context . getPackageName ( ) ) ; return hasPerm == PackageManager . PERMISSION_GRANTED ; }
Method to verify that vibrate permission has been granted .