Program: 190890
Project: 190890
Buggy source:
void computeShownFrameLocked(){
  final boolean selfTransformation=mHasLocalTransformation;
  Transformation attachedTransformation=(mAttachedWinAnimator != null && mAttachedWinAnimator.mHasLocalTransformation) ? mAttachedWinAnimator.mTransformation : null;
  Transformation appTransformation=(mAppAnimator != null && mAppAnimator.hasTransformation) ? mAppAnimator.transformation : null;
  final WindowState wallpaperTarget=mWallpaperControllerLocked.getWallpaperTarget();
  if (mIsWallpaper && wallpaperTarget != null && mService.mAnimateWallpaperWithTarget) {
    final WindowStateAnimator wallpaperAnimator=wallpaperTarget.mWinAnimator;
    if (wallpaperAnimator.mHasLocalTransformation && wallpaperAnimator.mAnimation != null && !wallpaperAnimator.mAnimation.getDetachWallpaper()) {
      attachedTransformation=wallpaperAnimator.mTransformation;
      if (DEBUG_WALLPAPER && attachedTransformation != null) {
        Slog.v(TAG,"String_Node_Str" + attachedTransformation);
      }
    }
    final AppWindowAnimator wpAppAnimator=wallpaperTarget.mAppToken == null ? null : wallpaperTarget.mAppToken.mAppAnimator;
    if (wpAppAnimator != null && wpAppAnimator.hasTransformation && wpAppAnimator.animation != null && !wpAppAnimator.animation.getDetachWallpaper()) {
      appTransformation=wpAppAnimator.transformation;
      if (DEBUG_WALLPAPER && appTransformation != null) {
        Slog.v(TAG,"String_Node_Str" + appTransformation);
      }
    }
  }
  final int displayId=mWin.getDisplayId();
  final ScreenRotationAnimation screenRotationAnimation=mAnimator.getScreenRotationAnimationLocked(displayId);
  final boolean screenAnimation=screenRotationAnimation != null && screenRotationAnimation.isAnimating();
  mHasClipRect=false;
  if (selfTransformation || attachedTransformation != null || appTransformation != null || screenAnimation) {
    final Rect frame=mWin.mFrame;
    final float tmpFloats[]=mService.mTmpFloats;
    final Matrix tmpMatrix=mWin.mTmpMatrix;
    if (screenAnimation && screenRotationAnimation.isRotating()) {
      final float w=frame.width();
      final float h=frame.height();
      if (w >= 1 && h >= 1) {
        tmpMatrix.setScale(1 + 2 / w,1 + 2 / h,w / 2,h / 2);
      }
 else {
        tmpMatrix.reset();
      }
    }
 else {
      tmpMatrix.reset();
    }
    tmpMatrix.postScale(mWin.mGlobalScale,mWin.mGlobalScale);
    if (selfTransformation) {
      tmpMatrix.postConcat(mTransformation.getMatrix());
    }
    if (attachedTransformation != null) {
      tmpMatrix.postConcat(attachedTransformation.getMatrix());
    }
    if (appTransformation != null) {
      tmpMatrix.postConcat(appTransformation.getMatrix());
    }
    tmpMatrix.postTranslate(frame.left + mWin.mXOffset,frame.top + mWin.mYOffset);
    if (screenAnimation) {
      tmpMatrix.postConcat(screenRotationAnimation.getEnterTransformation().getMatrix());
    }
    if (mService.mAccessibilityController != null && displayId == DEFAULT_DISPLAY) {
      MagnificationSpec spec=mService.mAccessibilityController.getMagnificationSpecForWindowLocked(mWin);
      applyMagnificationSpec(spec,tmpMatrix);
    }
    mHaveMatrix=true;
    tmpMatrix.getValues(tmpFloats);
    mDsDx=tmpFloats[Matrix.MSCALE_X];
    mDtDx=tmpFloats[Matrix.MSKEW_Y];
    mDsDy=tmpFloats[Matrix.MSKEW_X];
    mDtDy=tmpFloats[Matrix.MSCALE_Y];
    float x=tmpFloats[Matrix.MTRANS_X];
    float y=tmpFloats[Matrix.MTRANS_Y];
    mWin.mShownPosition.set((int)x,(int)y);
    mShownAlpha=mAlpha;
    if (!mService.mLimitedAlphaCompositing || (!PixelFormat.formatHasAlpha(mWin.mAttrs.format) || (mWin.isIdentityMatrix(mDsDx,mDtDx,mDsDy,mDtDy) && x == frame.left && y == frame.top))) {
      if (selfTransformation) {
        mShownAlpha*=mTransformation.getAlpha();
      }
      if (attachedTransformation != null) {
        mShownAlpha*=attachedTransformation.getAlpha();
      }
      if (appTransformation != null) {
        mShownAlpha*=appTransformation.getAlpha();
        if (appTransformation.hasClipRect()) {
          mClipRect.set(appTransformation.getClipRect());
          mHasClipRect=true;
          if (mWin.layoutInParentFrame()) {
            mClipRect.offset((mWin.mContainingFrame.left - mWin.mFrame.left),mWin.mContainingFrame.top - mWin.mFrame.top);
          }
        }
      }
      if (screenAnimation) {
        mShownAlpha*=screenRotationAnimation.getEnterTransformation().getAlpha();
      }
    }
 else {
    }
    if ((DEBUG_SURFACE_TRACE || WindowManagerService.localLOGV) && (mShownAlpha == 1.0 || mShownAlpha == 0.0))     Slog.v(TAG,"String_Node_Str" + this + "String_Node_Str"+ mAlpha+ "String_Node_Str"+ (selfTransformation ? mTransformation.getAlpha() : "String_Node_Str")+ "String_Node_Str"+ (attachedTransformation == null ? "String_Node_Str" : attachedTransformation.getAlpha())+ "String_Node_Str"+ (appTransformation == null ? "String_Node_Str" : appTransformation.getAlpha())+ "String_Node_Str"+ (screenAnimation ? screenRotationAnimation.getEnterTransformation().getAlpha() : "String_Node_Str"));
    return;
  }
 else   if (mIsWallpaper && mService.mWindowPlacerLocked.mWallpaperActionPending) {
    return;
  }
 else   if (mWin.isDragResizeChanged()) {
    return;
  }
  if (WindowManagerService.localLOGV)   Slog.v(TAG,"String_Node_Str" + this + "String_Node_Str"+ mAlpha);
  MagnificationSpec spec=null;
  if (mService.mAccessibilityController != null && displayId == DEFAULT_DISPLAY) {
    spec=mService.mAccessibilityController.getMagnificationSpecForWindowLocked(mWin);
  }
  if (spec != null) {
    final Rect frame=mWin.mFrame;
    final float tmpFloats[]=mService.mTmpFloats;
    final Matrix tmpMatrix=mWin.mTmpMatrix;
    tmpMatrix.setScale(mWin.mGlobalScale,mWin.mGlobalScale);
    tmpMatrix.postTranslate(frame.left + mWin.mXOffset,frame.top + mWin.mYOffset);
    applyMagnificationSpec(spec,tmpMatrix);
    tmpMatrix.getValues(tmpFloats);
    mHaveMatrix=true;
    mDsDx=tmpFloats[Matrix.MSCALE_X];
    mDtDx=tmpFloats[Matrix.MSKEW_Y];
    mDsDy=tmpFloats[Matrix.MSKEW_X];
    mDtDy=tmpFloats[Matrix.MSCALE_Y];
    float x=tmpFloats[Matrix.MTRANS_X];
    float y=tmpFloats[Matrix.MTRANS_Y];
    mWin.mShownPosition.set((int)x,(int)y);
    mShownAlpha=mAlpha;
  }
 else {
    mWin.mShownPosition.set(mWin.mFrame.left,mWin.mFrame.top);
    if (mWin.mXOffset != 0 || mWin.mYOffset != 0) {
      mWin.mShownPosition.offset(mWin.mXOffset,mWin.mYOffset);
    }
    mShownAlpha=mAlpha;
    mHaveMatrix=false;
    mDsDx=mWin.mGlobalScale;
    mDtDx=0;
    mDsDy=0;
    mDtDy=mWin.mGlobalScale;
  }
}

Fixed version (ground truth):
void computeShownFrameLocked(){
  final boolean selfTransformation=mHasLocalTransformation;
  Transformation attachedTransformation=(mAttachedWinAnimator != null && mAttachedWinAnimator.mHasLocalTransformation) ? mAttachedWinAnimator.mTransformation : null;
  Transformation appTransformation=(mAppAnimator != null && mAppAnimator.hasTransformation) ? mAppAnimator.transformation : null;
  final WindowState wallpaperTarget=mWallpaperControllerLocked.getWallpaperTarget();
  if (mIsWallpaper && wallpaperTarget != null && mService.mAnimateWallpaperWithTarget) {
    final WindowStateAnimator wallpaperAnimator=wallpaperTarget.mWinAnimator;
    if (wallpaperAnimator.mHasLocalTransformation && wallpaperAnimator.mAnimation != null && !wallpaperAnimator.mAnimation.getDetachWallpaper()) {
      attachedTransformation=wallpaperAnimator.mTransformation;
      if (DEBUG_WALLPAPER && attachedTransformation != null) {
        Slog.v(TAG,"String_Node_Str" + attachedTransformation);
      }
    }
    final AppWindowAnimator wpAppAnimator=wallpaperTarget.mAppToken == null ? null : wallpaperTarget.mAppToken.mAppAnimator;
    if (wpAppAnimator != null && wpAppAnimator.hasTransformation && wpAppAnimator.animation != null && !wpAppAnimator.animation.getDetachWallpaper()) {
      appTransformation=wpAppAnimator.transformation;
      if (DEBUG_WALLPAPER && appTransformation != null) {
        Slog.v(TAG,"String_Node_Str" + appTransformation);
      }
    }
  }
  final int displayId=mWin.getDisplayId();
  final ScreenRotationAnimation screenRotationAnimation=mAnimator.getScreenRotationAnimationLocked(displayId);
  final boolean screenAnimation=screenRotationAnimation != null && screenRotationAnimation.isAnimating();
  mHasClipRect=false;
  if (selfTransformation || attachedTransformation != null || appTransformation != null || screenAnimation) {
    final Rect frame=mWin.mFrame;
    final float tmpFloats[]=mService.mTmpFloats;
    final Matrix tmpMatrix=mWin.mTmpMatrix;
    if (screenAnimation && screenRotationAnimation.isRotating()) {
      final float w=frame.width();
      final float h=frame.height();
      if (w >= 1 && h >= 1) {
        tmpMatrix.setScale(1 + 2 / w,1 + 2 / h,w / 2,h / 2);
      }
 else {
        tmpMatrix.reset();
      }
    }
 else {
      tmpMatrix.reset();
    }
    tmpMatrix.postScale(mWin.mGlobalScale,mWin.mGlobalScale);
    if (selfTransformation) {
      tmpMatrix.postConcat(mTransformation.getMatrix());
    }
    if (attachedTransformation != null) {
      tmpMatrix.postConcat(attachedTransformation.getMatrix());
    }
    if (appTransformation != null) {
      tmpMatrix.postConcat(appTransformation.getMatrix());
    }
    tmpMatrix.postTranslate(frame.left + mWin.mXOffset,frame.top + mWin.mYOffset);
    if (screenAnimation) {
      tmpMatrix.postConcat(screenRotationAnimation.getEnterTransformation().getMatrix());
    }
    if (mService.mAccessibilityController != null && displayId == DEFAULT_DISPLAY) {
      MagnificationSpec spec=mService.mAccessibilityController.getMagnificationSpecForWindowLocked(mWin);
      applyMagnificationSpec(spec,tmpMatrix);
    }
    mHaveMatrix=true;
    tmpMatrix.getValues(tmpFloats);
    mDsDx=tmpFloats[Matrix.MSCALE_X];
    mDtDx=tmpFloats[Matrix.MSKEW_Y];
    mDsDy=tmpFloats[Matrix.MSKEW_X];
    mDtDy=tmpFloats[Matrix.MSCALE_Y];
    float x=tmpFloats[Matrix.MTRANS_X];
    float y=tmpFloats[Matrix.MTRANS_Y];
    mWin.mShownPosition.set(Math.round(x),Math.round(y));
    mShownAlpha=mAlpha;
    if (!mService.mLimitedAlphaCompositing || (!PixelFormat.formatHasAlpha(mWin.mAttrs.format) || (mWin.isIdentityMatrix(mDsDx,mDtDx,mDsDy,mDtDy) && x == frame.left && y == frame.top))) {
      if (selfTransformation) {
        mShownAlpha*=mTransformation.getAlpha();
      }
      if (attachedTransformation != null) {
        mShownAlpha*=attachedTransformation.getAlpha();
      }
      if (appTransformation != null) {
        mShownAlpha*=appTransformation.getAlpha();
        if (appTransformation.hasClipRect()) {
          mClipRect.set(appTransformation.getClipRect());
          mHasClipRect=true;
          if (mWin.layoutInParentFrame()) {
            mClipRect.offset((mWin.mContainingFrame.left - mWin.mFrame.left),mWin.mContainingFrame.top - mWin.mFrame.top);
          }
        }
      }
      if (screenAnimation) {
        mShownAlpha*=screenRotationAnimation.getEnterTransformation().getAlpha();
      }
    }
 else {
    }
    if ((DEBUG_SURFACE_TRACE || WindowManagerService.localLOGV) && (mShownAlpha == 1.0 || mShownAlpha == 0.0))     Slog.v(TAG,"String_Node_Str" + this + "String_Node_Str"+ mAlpha+ "String_Node_Str"+ (selfTransformation ? mTransformation.getAlpha() : "String_Node_Str")+ "String_Node_Str"+ (attachedTransformation == null ? "String_Node_Str" : attachedTransformation.getAlpha())+ "String_Node_Str"+ (appTransformation == null ? "String_Node_Str" : appTransformation.getAlpha())+ "String_Node_Str"+ (screenAnimation ? screenRotationAnimation.getEnterTransformation().getAlpha() : "String_Node_Str"));
    return;
  }
 else   if (mIsWallpaper && mService.mWindowPlacerLocked.mWallpaperActionPending) {
    return;
  }
 else   if (mWin.isDragResizeChanged()) {
    return;
  }
  if (WindowManagerService.localLOGV)   Slog.v(TAG,"String_Node_Str" + this + "String_Node_Str"+ mAlpha);
  MagnificationSpec spec=null;
  if (mService.mAccessibilityController != null && displayId == DEFAULT_DISPLAY) {
    spec=mService.mAccessibilityController.getMagnificationSpecForWindowLocked(mWin);
  }
  if (spec != null) {
    final Rect frame=mWin.mFrame;
    final float tmpFloats[]=mService.mTmpFloats;
    final Matrix tmpMatrix=mWin.mTmpMatrix;
    tmpMatrix.setScale(mWin.mGlobalScale,mWin.mGlobalScale);
    tmpMatrix.postTranslate(frame.left + mWin.mXOffset,frame.top + mWin.mYOffset);
    applyMagnificationSpec(spec,tmpMatrix);
    tmpMatrix.getValues(tmpFloats);
    mHaveMatrix=true;
    mDsDx=tmpFloats[Matrix.MSCALE_X];
    mDtDx=tmpFloats[Matrix.MSKEW_Y];
    mDsDy=tmpFloats[Matrix.MSKEW_X];
    mDtDy=tmpFloats[Matrix.MSCALE_Y];
    float x=tmpFloats[Matrix.MTRANS_X];
    float y=tmpFloats[Matrix.MTRANS_Y];
    mWin.mShownPosition.set(Math.round(x),Math.round(y));
    mShownAlpha=mAlpha;
  }
 else {
    mWin.mShownPosition.set(mWin.mFrame.left,mWin.mFrame.top);
    if (mWin.mXOffset != 0 || mWin.mYOffset != 0) {
      mWin.mShownPosition.offset(mWin.mXOffset,mWin.mYOffset);
    }
    mShownAlpha=mAlpha;
    mHaveMatrix=false;
    mDsDx=mWin.mGlobalScale;
    mDtDx=0;
    mDsDy=0;
    mDtDy=mWin.mGlobalScale;
  }
}