예제 #1
0
 private Map<String, String> getExtraMap(
     @Nullable CloseableImage image, long queueTime, QualityInfo quality, boolean isFinal) {
   if (!mProducerListener.requiresExtraMap(mProducerContext.getId())) {
     return null;
   }
   String queueStr = String.valueOf(queueTime);
   String qualityStr = String.valueOf(quality.isOfGoodEnoughQuality());
   String finalStr = String.valueOf(isFinal);
   String imageTypeStr = String.valueOf(mProducerContext.getImageRequest().getImageType());
   if (image instanceof CloseableStaticBitmap) {
     Bitmap bitmap = ((CloseableStaticBitmap) image).getUnderlyingBitmap();
     String sizeStr = bitmap.getWidth() + "x" + bitmap.getHeight();
     return ImmutableMap.of(
         BITMAP_SIZE_KEY,
         sizeStr,
         JobScheduler.QUEUE_TIME_KEY,
         queueStr,
         HAS_GOOD_QUALITY_KEY,
         qualityStr,
         IS_FINAL_KEY,
         finalStr,
         IMAGE_TYPE_KEY,
         imageTypeStr);
   } else {
     return ImmutableMap.of(
         JobScheduler.QUEUE_TIME_KEY,
         queueStr,
         HAS_GOOD_QUALITY_KEY,
         qualityStr,
         IS_FINAL_KEY,
         finalStr,
         IMAGE_TYPE_KEY,
         imageTypeStr);
   }
 }
예제 #2
0
 private Map<String, String> getExtraMap(
     final long queueTime, final QualityInfo qualityInfo, final boolean isFinal) {
   if (!mProducerListener.requiresExtraMap(mProducerContext.getId())) {
     return null;
   }
   return ImmutableMap.of(
       QUEUE_TIME_KEY,
       String.valueOf(queueTime),
       HAS_GOOD_QUALITY_KEY,
       String.valueOf(qualityInfo.isOfGoodEnoughQuality()),
       IS_FINAL_KEY,
       String.valueOf(isFinal));
 }