question: public static String [ ] filterPermissions ( Context context , String [ ] permissions , int filter ) { final ArrayList < String > filtered = new ArrayList < > ( ) ; for ( String permission : permissions ) { if ( getPermissionGrant ( context , permission ) == filter ) { filtered . add ( permission ) ; } } return filtered . toArray ( new String [ filtered . size ( ) ] ) ; }
target:  Filters all provided permissions and returns only granted or denied.