public List < IconFace > getAllIcons ( ) throws IOException { List < IconPath > iconPaths = getIconPaths ( ) ; if ( iconPaths . isEmpty ( ) ) { return Collections . emptyList ( ) ; } List < IconFace > iconFaces = new ArrayList <> ( iconPaths . size ( ) ) ; for ( IconPath iconPath : iconPaths ) { String filePath = iconPath . getPath ( ) ; if ( filePath . endsWith ( ".xml" ) ) { // adaptive icon? byte [ ] data = getFileData ( filePath ) ; if ( data == null ) { continue ; } parseResourceTable ( ) ; AdaptiveIconParser iconParser = new AdaptiveIconParser ( ) ; transBinaryXml ( data , iconParser ) ; Icon backgroundIcon = null ; if ( iconParser . getBackground ( ) != null ) { backgroundIcon = newFileIcon ( iconParser . getBackground ( ) , iconPath . getDensity ( ) ) ; } Icon foregroundIcon = null ; if ( iconParser . getForeground ( ) != null ) { foregroundIcon = newFileIcon ( iconParser . getForeground ( ) , iconPath . getDensity ( ) ) ; } AdaptiveIcon icon = new AdaptiveIcon ( foregroundIcon , backgroundIcon ) ; iconFaces . add ( icon ) ; } else { Icon icon = newFileIcon ( filePath , iconPath . getDensity ( ) ) ; iconFaces . add ( icon ) ; } } return iconFaces ; }
This method return icons specified in android manifest file application . The icons could be file icon color icon or adaptive icon etc .