private void doPermissionWorkBeforeAndroidM(@NonNull Activity activity,@NonNull String[] permissions,@Nullable PermissionsResultAction action){
  for (  String perm : permissions) {
    if (action != null) {
      if (!mPermissions.contains(perm)) {
        action.onResult(perm,Permissions.NOT_FOUND);
      }
 else       if (ActivityCompat.checkSelfPermission(activity,perm) != PackageManager.PERMISSION_GRANTED) {
        action.onResult(perm,Permissions.DENIED);
      }
 else {
        action.onResult(perm,Permissions.GRANTED);
      }
    }
  }
}

private void doPermissionWorkBeforeAndroidM ( @ NonNull Activity activity , @ NonNull String [ ] permissions , @ Nullable PermissionsResultAction action ) { for ( String perm : permissions ) { if ( action != null ) { if ( ! mPermissions . contains ( perm ) ) { action . onResult ( perm , Permissions . NOT_FOUND ) ; } else if ( ActivityCompat . checkSelfPermission ( activity , perm ) != PackageManager . PERMISSION_GRANTED ) { action . onResult ( perm , Permissions . DENIED ) ; } else { action . onResult ( perm , Permissions . GRANTED ) ; } } } }
when request permissions on devices before android m ( android 6 . 0 , api level 23 ) do the granted or denied work directly according to the permission status
