@VisibleForTesting public Bitmap ensureNormalizedIcon(Bitmap icon,String origin){
  if (icon == null || icon.getWidth() == 0) {
    if (mIconGenerator == null) {
      int cornerRadiusPx=Math.min(mLargeIconWidthPx,mLargeIconHeightPx) / 2;
      mIconGenerator=new RoundedIconGenerator(mLargeIconWidthPx,mLargeIconHeightPx,cornerRadiusPx,NOTIFICATION_ICON_BG_COLOR,NOTIFICATION_TEXT_SIZE_DP * mDensity);
    }
    return mIconGenerator.generateIconForUrl(origin,true);
  }
  if (icon.getWidth() > mLargeIconWidthPx || icon.getHeight() > mLargeIconHeightPx) {
    return icon.createScaledBitmap(icon,mLargeIconWidthPx,mLargeIconHeightPx,false);
  }
  return icon;
}

@ VisibleForTesting public Bitmap ensureNormalizedIcon ( Bitmap icon , String origin ) { if ( icon == null || icon . getWidth ( ) == 0 ) { if ( mIconGenerator == null ) { int cornerRadiusPx = Math . min ( mLargeIconWidthPx , mLargeIconHeightPx ) / 2 ; mIconGenerator = new RoundedIconGenerator ( mLargeIconWidthPx , mLargeIconHeightPx , cornerRadiusPx , NOTIFICATION_ICON_BG_COLOR , NOTIFICATION_TEXT_SIZE_DP * mDensity ) ; } return mIconGenerator . generateIconForUrl ( origin , true ) ; } if ( icon . getWidth ( ) > mLargeIconWidthPx || icon . getHeight ( ) > mLargeIconHeightPx ) { return icon . createScaledBitmap ( icon , mLargeIconWidthPx , mLargeIconHeightPx , false ) ; } return icon ; }
ensures the availability of an icon for the notification . if | icon | is a valid , non - empty bitmap , the bitmap will be scaled to be of an appropriate size for the current android device . otherwise , a default icon will be created based on the origin the notification is being displayed for .
