public static String permissionToString ( final int iPermission ) { int permission = iPermission ; final StringBuilder returnValue = new StringBuilder ( ) ; for ( Entry < Integer , String > p : PERMISSION_BIT_NAMES . entrySet ( ) ) { if ( ( permission & p . getKey ( ) ) == p . getKey ( ) ) { if ( returnValue . length ( ) > 0 ) returnValue . append ( ", " ) ; returnValue . append ( p . getValue ( ) ) ; permission &= ~ p . getKey ( ) ; } } if ( permission != 0 ) { if ( returnValue . length ( ) > 0 ) returnValue . append ( ", " ) ; returnValue . append ( "Unknown 0x" ) ; returnValue . append ( Integer . toHexString ( permission ) ) ; } return returnValue . toString ( ) ; }
Convert the permission code to a readable string .