Program: 192756
Project: 192756
Buggy source:
/** 
 * Update/get the transform.
 * @param ignoreSingleTaskCase When set, will ensure that the transform computed does not takeinto account the special single-task case.  This is only used internally to ensure that we can calculate the transform for any position in the stack.
 */
public TaskViewTransform getStackTransform(float taskProgress,float stackScroll,TaskViewTransform transformOut,TaskViewTransform frontTransform,boolean ignoreSingleTaskCase){
  SystemServicesProxy ssp=Recents.getSystemServices();
  mUnfocusedRange.offset(stackScroll);
  float p=mUnfocusedRange.getNormalizedX(taskProgress);
  float yp=mUnfocusedCurveInterpolator.getInterpolation(p);
  float unfocusedP=p;
  int unFocusedY=(int)(Math.max(0f,(1f - yp)) * mStackRect.height());
  boolean unfocusedVisible=mUnfocusedRange.isInRange(taskProgress);
  int focusedY=0;
  boolean focusedVisible=true;
  if (mFocusState > 0f) {
    mFocusedRange.offset(stackScroll);
    p=mFocusedRange.getNormalizedX(taskProgress);
    yp=mFocusedCurveInterpolator.getInterpolation(p);
    focusedY=(int)(Math.max(0f,(1f - yp)) * mStackRect.height());
    focusedVisible=mFocusedRange.isInRange(taskProgress);
  }
  if (!unfocusedVisible && !focusedVisible) {
    transformOut.reset();
    return transformOut;
  }
  int x=(mStackRect.width() - mTaskRect.width()) / 2;
  int y;
  float z;
  float relP;
  if (!ssp.hasFreeformWorkspaceSupport() && mNumStackTasks == 1 && !ignoreSingleTaskCase) {
    p=(mMinScrollP - stackScroll) / mNumStackTasks;
    int centerYOffset=(mStackRect.top - mTaskRect.top) + (mStackRect.height() - mTaskRect.height()) / 2;
    y=centerYOffset + getYForDeltaP(p,0);
    z=mMaxTranslationZ;
    relP=1f;
  }
 else {
    y=unFocusedY + (int)(mFocusState * (focusedY - unFocusedY));
    y+=(mStackRect.top - mTaskRect.top);
    z=Math.max(mMinTranslationZ,Math.min(mMaxTranslationZ,mMinTranslationZ + (p * (mMaxTranslationZ - mMinTranslationZ))));
    if (mNumStackTasks == 1) {
      relP=1f;
    }
 else {
      relP=Math.min(mMaxScrollP,unfocusedP);
    }
  }
  transformOut.scale=1f;
  transformOut.alpha=1f;
  transformOut.translationZ=z;
  transformOut.rect.set(mTaskRect);
  transformOut.rect.offset(x,y);
  Utilities.scaleRectAboutCenter(transformOut.rect,transformOut.scale);
  transformOut.visible=(transformOut.rect.top < mStackRect.bottom) && (frontTransform == null || transformOut.rect.top != frontTransform.rect.top);
  transformOut.p=relP;
  return transformOut;
}

Fixed version (ground truth):
/** 
 * Update/get the transform.
 * @param ignoreSingleTaskCase When set, will ensure that the transform computed does not takeinto account the special single-task case.  This is only used internally to ensure that we can calculate the transform for any position in the stack.
 */
public void getStackTransform(float taskProgress,float stackScroll,TaskViewTransform transformOut,TaskViewTransform frontTransform,boolean ignoreSingleTaskCase,boolean forceUpdate){
  SystemServicesProxy ssp=Recents.getSystemServices();
  mUnfocusedRange.offset(stackScroll);
  float p=mUnfocusedRange.getNormalizedX(taskProgress);
  float yp=mUnfocusedCurveInterpolator.getInterpolation(p);
  float unfocusedP=p;
  int unFocusedY=(int)(Math.max(0f,(1f - yp)) * mStackRect.height());
  boolean unfocusedVisible=mUnfocusedRange.isInRange(taskProgress);
  int focusedY=0;
  boolean focusedVisible=true;
  if (mFocusState > 0f) {
    mFocusedRange.offset(stackScroll);
    p=mFocusedRange.getNormalizedX(taskProgress);
    yp=mFocusedCurveInterpolator.getInterpolation(p);
    focusedY=(int)(Math.max(0f,(1f - yp)) * mStackRect.height());
    focusedVisible=mFocusedRange.isInRange(taskProgress);
  }
  if (!forceUpdate && !unfocusedVisible && !focusedVisible) {
    transformOut.reset();
    return;
  }
  int x=(mStackRect.width() - mTaskRect.width()) / 2;
  int y;
  float z;
  float relP;
  if (!ssp.hasFreeformWorkspaceSupport() && mNumStackTasks == 1 && !ignoreSingleTaskCase) {
    p=(mMinScrollP - stackScroll) / mNumStackTasks;
    int centerYOffset=(mStackRect.top - mTaskRect.top) + (mStackRect.height() - mTaskRect.height()) / 2;
    y=centerYOffset + getYForDeltaP(p,0);
    z=mMaxTranslationZ;
    relP=1f;
  }
 else {
    y=unFocusedY + (int)(mFocusState * (focusedY - unFocusedY));
    y+=(mStackRect.top - mTaskRect.top);
    z=Math.max(mMinTranslationZ,Math.min(mMaxTranslationZ,mMinTranslationZ + (p * (mMaxTranslationZ - mMinTranslationZ))));
    if (mNumStackTasks == 1) {
      relP=1f;
    }
 else {
      relP=Math.min(mMaxScrollP,unfocusedP);
    }
  }
  transformOut.scale=1f;
  transformOut.alpha=1f;
  transformOut.translationZ=z;
  transformOut.rect.set(mTaskRect);
  transformOut.rect.offset(x,y);
  Utilities.scaleRectAboutCenter(transformOut.rect,transformOut.scale);
  transformOut.visible=(transformOut.rect.top < mStackRect.bottom) && (frontTransform == null || transformOut.rect.top != frontTransform.rect.top);
  transformOut.p=relP;
}