Program: 199577
Project: 199577
Buggy source:
/** 
 * TaskStackView.TaskStackCallbacks Implementation 
 */
@Override public void onTaskLaunched(final TaskStackView stackView,final TaskView tv,final TaskStack stack,final Task task){
  if (mCb != null) {
    mCb.onTaskLaunching();
  }
  final Runnable launchRunnable=new Runnable(){
    @Override public void run(){
      TaskViewTransform transform;
      View sourceView=tv;
      int offsetX=0;
      int offsetY=0;
      if (tv == null) {
        sourceView=stackView;
        transform=stackView.getStackTransform(stack.indexOfTask(task));
        offsetX=transform.rect.left;
        offsetY=transform.rect.top;
      }
 else {
        transform=stackView.getStackTransform(stack.indexOfTask(task));
      }
      ActivityOptions opts=null;
      int thumbnailWidth=transform.rect.width();
      int thumbnailHeight=transform.rect.height();
      if (task.thumbnail != null && thumbnailWidth > 0 && thumbnailHeight > 0 && task.thumbnail.getWidth() > 0 && task.thumbnail.getHeight() > 0) {
        Bitmap b=Bitmap.createBitmap(thumbnailWidth,thumbnailHeight,Bitmap.Config.ARGB_8888);
        Canvas c=new Canvas(b);
        c.drawBitmap(task.thumbnail,new Rect(0,0,task.thumbnail.getWidth(),task.thumbnail.getHeight()),new Rect(0,0,thumbnailWidth,thumbnailHeight),null);
        c.setBitmap(null);
        opts=ActivityOptions.makeThumbnailScaleUpAnimation(sourceView,b,offsetX,offsetY);
      }
      Intent i=new Intent(task.key.intent);
      i.setFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY | Intent.FLAG_ACTIVITY_TASK_ON_HOME | Intent.FLAG_ACTIVITY_NEW_TASK);
      if (opts != null) {
        getContext().startActivityAsUser(i,opts.toBundle(),UserHandle.CURRENT);
      }
 else {
        getContext().startActivityAsUser(i,UserHandle.CURRENT);
      }
    }
  }
;
  if (tv == null || !Constants.Values.TaskView.AnimateFrontTaskIconOnLeavingRecents) {
    post(launchRunnable);
  }
 else {
    tv.animateOnLeavingRecents(launchRunnable);
  }
}

Fixed version (ground truth):
/** 
 * TaskStackView.TaskStackCallbacks Implementation 
 */
@Override public void onTaskLaunched(final TaskStackView stackView,final TaskView tv,final TaskStack stack,final Task task){
  if (mCb != null) {
    mCb.onTaskLaunching();
  }
  final Runnable launchRunnable=new Runnable(){
    @Override public void run(){
      TaskViewTransform transform;
      View sourceView=tv;
      int offsetX=0;
      int offsetY=0;
      if (tv == null) {
        sourceView=stackView;
        transform=stackView.getStackTransform(stack.indexOfTask(task));
        offsetX=transform.rect.left;
        offsetY=transform.rect.top;
      }
 else {
        transform=stackView.getStackTransform(stack.indexOfTask(task));
      }
      ActivityOptions opts=null;
      int thumbnailWidth=transform.rect.width();
      int thumbnailHeight=transform.rect.height();
      if (task.thumbnail != null && thumbnailWidth > 0 && thumbnailHeight > 0 && task.thumbnail.getWidth() > 0 && task.thumbnail.getHeight() > 0) {
        Bitmap b=Bitmap.createBitmap(thumbnailWidth,thumbnailHeight,Bitmap.Config.ARGB_8888);
        Canvas c=new Canvas(b);
        c.drawBitmap(task.thumbnail,new Rect(0,0,task.thumbnail.getWidth(),task.thumbnail.getHeight()),new Rect(0,0,thumbnailWidth,thumbnailHeight),null);
        c.setBitmap(null);
        opts=ActivityOptions.makeThumbnailScaleUpAnimation(sourceView,b,offsetX,offsetY);
      }
      Intent i=new Intent(task.key.intent);
      i.setFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY | Intent.FLAG_ACTIVITY_TASK_ON_HOME | Intent.FLAG_ACTIVITY_NEW_TASK);
      if (opts != null) {
        getContext().startActivityAsUser(i,opts.toBundle(),UserHandle.CURRENT);
      }
 else {
        getContext().startActivityAsUser(i,UserHandle.CURRENT);
      }
      Console.logTraceTime(Constants.DebugFlags.App.TimeRecentsLaunchTask,Constants.DebugFlags.App.TimeRecentsLaunchKey,"String_Node_Str");
    }
  }
;
  Console.logTraceTime(Constants.DebugFlags.App.TimeRecentsLaunchTask,Constants.DebugFlags.App.TimeRecentsLaunchKey,"String_Node_Str");
  if (tv == null || !Constants.Values.TaskView.AnimateFrontTaskIconOnLeavingRecents) {
    post(launchRunnable);
  }
 else {
    tv.animateOnLeavingRecents(launchRunnable);
  }
}