Program: 193107
Project: 193107
Buggy source:
/** 
 * Computes the stack and task rects.  The given task stack bounds is the whole bounds not including the search bar.
 */
public void initialize(Rect taskStackBounds,StackState state){
  RecentsDebugFlags debugFlags=Recents.getDebugFlags();
  RecentsConfiguration config=Recents.getConfiguration();
  int widthPadding=(int)(config.taskStackWidthPaddingPct * taskStackBounds.width());
  int heightPadding=mContext.getResources().getDimensionPixelSize(R.dimen.recents_stack_top_padding);
  Rect lastStackRect=new Rect(mStackRect);
  mState=state;
  mStackTopOffset=mFocusedPeekHeight + heightPadding;
  mStackBottomOffset=mSystemInsets.bottom + heightPadding;
  state.computeRects(mFreeformRect,mStackRect,taskStackBounds,widthPadding,heightPadding,mStackBottomOffset);
  mHistoryButtonRect.set(mStackRect.left,mStackRect.top - heightPadding,mStackRect.right,mStackRect.top + mFocusedPeekHeight);
  float aspect=(float)(taskStackBounds.width() - mSystemInsets.left - mSystemInsets.right) / (taskStackBounds.height() - mSystemInsets.bottom);
  int width=mStackRect.width();
  int minHeight=mStackRect.height() - mFocusedPeekHeight - mStackBottomOffset;
  int height=(int)Math.min(width / aspect,minHeight);
  mTaskRect.set(mStackRect.left,mStackRect.top,mStackRect.left + width,mStackRect.top + height);
  if (lastStackRect.equals(mStackRect)) {
    return;
  }
  mUnfocusedCurve=constructUnfocusedCurve();
  mUnfocusedCurveInterpolator=new FreePathInterpolator(mUnfocusedCurve);
  mFocusedCurve=constructFocusedCurve();
  mFocusedCurveInterpolator=new FreePathInterpolator(mFocusedCurve);
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str");
    Log.d(TAG,"String_Node_Str" + mFreeformRect);
    Log.d(TAG,"String_Node_Str" + mStackRect);
    Log.d(TAG,"String_Node_Str" + mTaskRect);
    Log.d(TAG,"String_Node_Str" + mSystemInsets);
  }
}

Fixed version (ground truth):
/** 
 * Computes the stack and task rects.  The given task stack bounds is the whole bounds not including the search bar.
 */
public void initialize(Rect taskStackBounds,StackState state){
  RecentsConfiguration config=Recents.getConfiguration();
  int widthPadding=(int)(config.taskStackWidthPaddingPct * taskStackBounds.width());
  int heightPadding=mContext.getResources().getDimensionPixelSize(R.dimen.recents_stack_top_padding);
  Rect lastStackRect=new Rect(mStackRect);
  mState=state;
  mStackTopOffset=mFocusedPeekHeight + heightPadding;
  mStackBottomOffset=mSystemInsets.bottom + heightPadding;
  state.computeRects(mFreeformRect,mStackRect,taskStackBounds,widthPadding,heightPadding,mStackBottomOffset);
  mHistoryButtonRect.set(mStackRect.left,mStackRect.top - heightPadding,mStackRect.right,mStackRect.top + mFocusedPeekHeight);
  float aspect=(float)(taskStackBounds.width() - mSystemInsets.left - mSystemInsets.right) / (taskStackBounds.height() - mSystemInsets.bottom);
  int width=mStackRect.width();
  int minHeight=mStackRect.height() - mFocusedPeekHeight - mStackBottomOffset;
  int height=(int)Math.min(width / aspect,minHeight);
  mTaskRect.set(mStackRect.left,mStackRect.top,mStackRect.left + width,mStackRect.top + height);
  if (lastStackRect.equals(mStackRect)) {
    return;
  }
  mUnfocusedCurve=constructUnfocusedCurve();
  mUnfocusedCurveInterpolator=new FreePathInterpolator(mUnfocusedCurve);
  mFocusedCurve=constructFocusedCurve();
  mFocusedCurveInterpolator=new FreePathInterpolator(mFocusedCurve);
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str");
    Log.d(TAG,"String_Node_Str" + mFreeformRect);
    Log.d(TAG,"String_Node_Str" + mStackRect);
    Log.d(TAG,"String_Node_Str" + mTaskRect);
    Log.d(TAG,"String_Node_Str" + mSystemInsets);
  }
}