Program: 194931
Project: 194931
Buggy source:
SaveImageInBackgroundTask(Context context,SaveImageInBackgroundData data,NotificationManager nManager,int nId){
  Resources r=context.getResources();
  mImageTime=System.currentTimeMillis();
  String imageDate=new SimpleDateFormat("String_Node_Str").format(new Date(mImageTime));
  mImageFileName=String.format(SCREENSHOT_FILE_NAME_TEMPLATE,imageDate);
  mScreenshotDir=new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES),SCREENSHOTS_DIR_NAME);
  mImageFilePath=new File(mScreenshotDir,mImageFileName).getAbsolutePath();
  mImageWidth=data.image.getWidth();
  mImageHeight=data.image.getHeight();
  int iconSize=data.iconSize;
  int previewWidth=data.previewWidth;
  int previewHeight=data.previewheight;
  final int shortSide=mImageWidth < mImageHeight ? mImageWidth : mImageHeight;
  Bitmap preview=Bitmap.createBitmap(previewWidth,previewHeight,data.image.getConfig());
  Canvas c=new Canvas(preview);
  Paint paint=new Paint();
  ColorMatrix desat=new ColorMatrix();
  desat.setSaturation(0.25f);
  paint.setColorFilter(new ColorMatrixColorFilter(desat));
  Matrix matrix=new Matrix();
  matrix.postTranslate((previewWidth - mImageWidth) / 2,(previewHeight - mImageHeight) / 2);
  c.drawBitmap(data.image,matrix,paint);
  c.drawColor(0x40FFFFFF);
  c.setBitmap(null);
  Bitmap croppedIcon=Bitmap.createScaledBitmap(preview,iconSize,iconSize,true);
  mTickerAddSpace=!mTickerAddSpace;
  mNotificationId=nId;
  mNotificationManager=nManager;
  final long now=System.currentTimeMillis();
  mNotificationBuilder=new Notification.Builder(context).setTicker(r.getString(R.string.screenshot_saving_ticker) + (mTickerAddSpace ? "String_Node_Str" : "String_Node_Str")).setContentTitle(r.getString(R.string.screenshot_saving_title)).setContentText(r.getString(R.string.screenshot_saving_text)).setSmallIcon(R.drawable.stat_notify_image).setWhen(now).setColor(r.getColor(com.android.internal.R.color.system_notification_accent_color));
  mNotificationStyle=new Notification.BigPictureStyle().bigPicture(preview);
  mNotificationBuilder.setStyle(mNotificationStyle);
  mPublicNotificationBuilder=new Notification.Builder(context).setContentTitle(r.getString(R.string.screenshot_saving_title)).setContentText(r.getString(R.string.screenshot_saving_text)).setSmallIcon(R.drawable.stat_notify_image).setCategory(Notification.CATEGORY_PROGRESS).setWhen(now).setColor(r.getColor(com.android.internal.R.color.system_notification_accent_color));
  mNotificationBuilder.setPublicVersion(mPublicNotificationBuilder.build());
  Notification n=mNotificationBuilder.build();
  n.flags|=Notification.FLAG_NO_CLEAR;
  mNotificationManager.notify(nId,n);
  mNotificationBuilder.setLargeIcon(croppedIcon);
  mNotificationStyle.bigLargeIcon((Bitmap)null);
}

Fixed version (ground truth):
SaveImageInBackgroundTask(Context context,SaveImageInBackgroundData data,NotificationManager nManager,int nId){
  Resources r=context.getResources();
  mImageTime=System.currentTimeMillis();
  String imageDate=new SimpleDateFormat("String_Node_Str").format(new Date(mImageTime));
  mImageFileName=String.format(SCREENSHOT_FILE_NAME_TEMPLATE,imageDate);
  mScreenshotDir=new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES),SCREENSHOTS_DIR_NAME);
  mImageFilePath=new File(mScreenshotDir,mImageFileName).getAbsolutePath();
  mImageWidth=data.image.getWidth();
  mImageHeight=data.image.getHeight();
  int iconSize=data.iconSize;
  int previewWidth=data.previewWidth;
  int previewHeight=data.previewheight;
  Canvas c=new Canvas();
  Paint paint=new Paint();
  ColorMatrix desat=new ColorMatrix();
  desat.setSaturation(0.25f);
  paint.setColorFilter(new ColorMatrixColorFilter(desat));
  Matrix matrix=new Matrix();
  int overlayColor=0x40FFFFFF;
  Bitmap picture=Bitmap.createBitmap(previewWidth,previewHeight,data.image.getConfig());
  matrix.setTranslate((previewWidth - mImageWidth) / 2,(previewHeight - mImageHeight) / 2);
  c.setBitmap(picture);
  c.drawBitmap(data.image,matrix,paint);
  c.drawColor(overlayColor);
  c.setBitmap(null);
  float scale=(float)iconSize / Math.min(mImageWidth,mImageHeight);
  Bitmap icon=Bitmap.createBitmap(iconSize,iconSize,data.image.getConfig());
  matrix.setScale(scale,scale);
  matrix.postTranslate((iconSize - (scale * mImageWidth)) / 2,(iconSize - (scale * mImageHeight)) / 2);
  c.setBitmap(icon);
  c.drawBitmap(data.image,matrix,paint);
  c.drawColor(overlayColor);
  c.setBitmap(null);
  mTickerAddSpace=!mTickerAddSpace;
  mNotificationId=nId;
  mNotificationManager=nManager;
  final long now=System.currentTimeMillis();
  mNotificationBuilder=new Notification.Builder(context).setTicker(r.getString(R.string.screenshot_saving_ticker) + (mTickerAddSpace ? "String_Node_Str" : "String_Node_Str")).setContentTitle(r.getString(R.string.screenshot_saving_title)).setContentText(r.getString(R.string.screenshot_saving_text)).setSmallIcon(R.drawable.stat_notify_image).setWhen(now).setColor(r.getColor(com.android.internal.R.color.system_notification_accent_color));
  mNotificationStyle=new Notification.BigPictureStyle().bigPicture(picture);
  mNotificationBuilder.setStyle(mNotificationStyle);
  mPublicNotificationBuilder=new Notification.Builder(context).setContentTitle(r.getString(R.string.screenshot_saving_title)).setContentText(r.getString(R.string.screenshot_saving_text)).setSmallIcon(R.drawable.stat_notify_image).setCategory(Notification.CATEGORY_PROGRESS).setWhen(now).setColor(r.getColor(com.android.internal.R.color.system_notification_accent_color));
  mNotificationBuilder.setPublicVersion(mPublicNotificationBuilder.build());
  Notification n=mNotificationBuilder.build();
  n.flags|=Notification.FLAG_NO_CLEAR;
  mNotificationManager.notify(nId,n);
  mNotificationBuilder.setLargeIcon(icon);
  mNotificationStyle.bigLargeIcon((Bitmap)null);
}