public DataSource < Void > prefetchToBitmapCache ( ImageRequest imageRequest , Object callerContext ) { if ( ! mIsPrefetchEnabledSupplier . get ( ) ) { return DataSources . immediateFailedDataSource ( PREFETCH_EXCEPTION ) ; } try { final Boolean shouldDecodePrefetches = imageRequest . shouldDecodePrefetches ( ) ; final boolean skipBitmapCache = shouldDecodePrefetches != null ? ! shouldDecodePrefetches // use imagerequest param if specified : mSuppressBitmapPrefetchingSupplier . get ( ) ; // otherwise fall back to pipeline's default Producer < Void > producerSequence = skipBitmapCache ? mProducerSequenceFactory . getEncodedImagePrefetchProducerSequence ( imageRequest ) : mProducerSequenceFactory . getDecodedImagePrefetchProducerSequence ( imageRequest ) ; return submitPrefetchRequest ( producerSequence , imageRequest , ImageRequest . RequestLevel . FULL_FETCH , callerContext , Priority . MEDIUM ) ; } catch ( Exception exception ) { return DataSources . immediateFailedDataSource ( exception ) ; } }
Submits a request for prefetching to the bitmap cache .