Program: 195538
Project: 195538
Buggy source:
@Override public void computeFrameLw(Rect pf,Rect df,Rect of,Rect cf,Rect vf,Rect dcf,Rect sf){
  mHaveFrame=true;
  TaskStack stack=mAppToken != null ? getStack() : null;
  if (stack != null && !stack.isFullscreen()) {
    getStackBounds(stack,mContainingFrame);
    if (mUnderStatusBar) {
      mContainingFrame.top=pf.top;
    }
  }
 else {
    mContainingFrame.set(pf);
  }
  mDisplayFrame.set(df);
  final int pw=mContainingFrame.width();
  final int ph=mContainingFrame.height();
  int w, h;
  if ((mAttrs.flags & WindowManager.LayoutParams.FLAG_SCALED) != 0) {
    if (mAttrs.width < 0) {
      w=pw;
    }
 else     if (mEnforceSizeCompat) {
      w=(int)(mAttrs.width * mGlobalScale + .5f);
    }
 else {
      w=mAttrs.width;
    }
    if (mAttrs.height < 0) {
      h=ph;
    }
 else     if (mEnforceSizeCompat) {
      h=(int)(mAttrs.height * mGlobalScale + .5f);
    }
 else {
      h=mAttrs.height;
    }
  }
 else {
    if (mAttrs.width == WindowManager.LayoutParams.MATCH_PARENT) {
      w=pw;
    }
 else     if (mEnforceSizeCompat) {
      w=(int)(mRequestedWidth * mGlobalScale + .5f);
    }
 else {
      w=mRequestedWidth;
    }
    if (mAttrs.height == WindowManager.LayoutParams.MATCH_PARENT) {
      h=ph;
    }
 else     if (mEnforceSizeCompat) {
      h=(int)(mRequestedHeight * mGlobalScale + .5f);
    }
 else {
      h=mRequestedHeight;
    }
  }
  if (!mParentFrame.equals(pf)) {
    mParentFrame.set(pf);
    mContentChanged=true;
  }
  if (mRequestedWidth != mLastRequestedWidth || mRequestedHeight != mLastRequestedHeight) {
    mLastRequestedWidth=mRequestedWidth;
    mLastRequestedHeight=mRequestedHeight;
    mContentChanged=true;
  }
  mOverscanFrame.set(of);
  mContentFrame.set(cf);
  mVisibleFrame.set(vf);
  mDecorFrame.set(dcf);
  mStableFrame.set(sf);
  final int fw=mFrame.width();
  final int fh=mFrame.height();
  float x, y;
  if (mEnforceSizeCompat) {
    x=mAttrs.x * mGlobalScale;
    y=mAttrs.y * mGlobalScale;
  }
 else {
    x=mAttrs.x;
    y=mAttrs.y;
  }
  Gravity.apply(mAttrs.gravity,w,h,mContainingFrame,(int)(x + mAttrs.horizontalMargin * pw),(int)(y + mAttrs.verticalMargin * ph),mFrame);
  Gravity.applyDisplay(mAttrs.gravity,df,mFrame);
  mContentFrame.set(Math.max(mContentFrame.left,mFrame.left),Math.max(mContentFrame.top,mFrame.top),Math.min(mContentFrame.right,mFrame.right),Math.min(mContentFrame.bottom,mFrame.bottom));
  mVisibleFrame.set(Math.max(mVisibleFrame.left,mFrame.left),Math.max(mVisibleFrame.top,mFrame.top),Math.min(mVisibleFrame.right,mFrame.right),Math.min(mVisibleFrame.bottom,mFrame.bottom));
  mStableFrame.set(Math.max(mStableFrame.left,mFrame.left),Math.max(mStableFrame.top,mFrame.top),Math.min(mStableFrame.right,mFrame.right),Math.min(mStableFrame.bottom,mFrame.bottom));
  mOverscanInsets.set(Math.max(mOverscanFrame.left - mFrame.left,0),Math.max(mOverscanFrame.top - mFrame.top,0),Math.max(mFrame.right - mOverscanFrame.right,0),Math.max(mFrame.bottom - mOverscanFrame.bottom,0));
  mContentInsets.set(mContentFrame.left - mFrame.left,mContentFrame.top - mFrame.top,mFrame.right - mContentFrame.right,mFrame.bottom - mContentFrame.bottom);
  mVisibleInsets.set(mVisibleFrame.left - mFrame.left,mVisibleFrame.top - mFrame.top,mFrame.right - mVisibleFrame.right,mFrame.bottom - mVisibleFrame.bottom);
  mStableInsets.set(Math.max(mStableFrame.left - mFrame.left,0),Math.max(mStableFrame.top - mFrame.top,0),Math.max(mFrame.right - mStableFrame.right,0),Math.max(mFrame.bottom - mStableFrame.bottom,0));
  mCompatFrame.set(mFrame);
  if (mEnforceSizeCompat) {
    mOverscanInsets.scale(mInvGlobalScale);
    mContentInsets.scale(mInvGlobalScale);
    mVisibleInsets.scale(mInvGlobalScale);
    mStableInsets.scale(mInvGlobalScale);
    mCompatFrame.scale(mInvGlobalScale);
  }
  if (mIsWallpaper && (fw != mFrame.width() || fh != mFrame.height())) {
    final DisplayContent displayContent=getDisplayContent();
    if (displayContent != null) {
      final DisplayInfo displayInfo=displayContent.getDisplayInfo();
      mService.updateWallpaperOffsetLocked(this,displayInfo.logicalWidth,displayInfo.logicalHeight,false);
    }
  }
  if (DEBUG_LAYOUT || WindowManagerService.localLOGV)   Slog.v(TAG,"String_Node_Str" + mRequestedWidth + "String_Node_Str"+ mRequestedHeight+ "String_Node_Str"+ "String_Node_Str"+ pw+ "String_Node_Str"+ ph+ "String_Node_Str"+ mFrame.toShortString()+ "String_Node_Str"+ mContentInsets.toShortString()+ "String_Node_Str"+ mVisibleInsets.toShortString()+ "String_Node_Str"+ mStableInsets.toShortString());
}

Fixed version (ground truth):
@Override public void computeFrameLw(Rect pf,Rect df,Rect of,Rect cf,Rect vf,Rect dcf,Rect sf){
  mHaveFrame=true;
  TaskStack stack=mAppToken != null ? getStack() : null;
  if (stack != null && !stack.isFullscreen()) {
    stack.getBounds(mContainingFrame);
    if (stack.mUnderStatusBar) {
      mContainingFrame.top=pf.top;
    }
  }
 else {
    mContainingFrame.set(pf);
  }
  mDisplayFrame.set(df);
  final int pw=mContainingFrame.width();
  final int ph=mContainingFrame.height();
  int w, h;
  if ((mAttrs.flags & WindowManager.LayoutParams.FLAG_SCALED) != 0) {
    if (mAttrs.width < 0) {
      w=pw;
    }
 else     if (mEnforceSizeCompat) {
      w=(int)(mAttrs.width * mGlobalScale + .5f);
    }
 else {
      w=mAttrs.width;
    }
    if (mAttrs.height < 0) {
      h=ph;
    }
 else     if (mEnforceSizeCompat) {
      h=(int)(mAttrs.height * mGlobalScale + .5f);
    }
 else {
      h=mAttrs.height;
    }
  }
 else {
    if (mAttrs.width == WindowManager.LayoutParams.MATCH_PARENT) {
      w=pw;
    }
 else     if (mEnforceSizeCompat) {
      w=(int)(mRequestedWidth * mGlobalScale + .5f);
    }
 else {
      w=mRequestedWidth;
    }
    if (mAttrs.height == WindowManager.LayoutParams.MATCH_PARENT) {
      h=ph;
    }
 else     if (mEnforceSizeCompat) {
      h=(int)(mRequestedHeight * mGlobalScale + .5f);
    }
 else {
      h=mRequestedHeight;
    }
  }
  if (!mParentFrame.equals(pf)) {
    mParentFrame.set(pf);
    mContentChanged=true;
  }
  if (mRequestedWidth != mLastRequestedWidth || mRequestedHeight != mLastRequestedHeight) {
    mLastRequestedWidth=mRequestedWidth;
    mLastRequestedHeight=mRequestedHeight;
    mContentChanged=true;
  }
  mOverscanFrame.set(of);
  mContentFrame.set(cf);
  mVisibleFrame.set(vf);
  mDecorFrame.set(dcf);
  mStableFrame.set(sf);
  final int fw=mFrame.width();
  final int fh=mFrame.height();
  float x, y;
  if (mEnforceSizeCompat) {
    x=mAttrs.x * mGlobalScale;
    y=mAttrs.y * mGlobalScale;
  }
 else {
    x=mAttrs.x;
    y=mAttrs.y;
  }
  Gravity.apply(mAttrs.gravity,w,h,mContainingFrame,(int)(x + mAttrs.horizontalMargin * pw),(int)(y + mAttrs.verticalMargin * ph),mFrame);
  Gravity.applyDisplay(mAttrs.gravity,df,mFrame);
  mContentFrame.set(Math.max(mContentFrame.left,mFrame.left),Math.max(mContentFrame.top,mFrame.top),Math.min(mContentFrame.right,mFrame.right),Math.min(mContentFrame.bottom,mFrame.bottom));
  mVisibleFrame.set(Math.max(mVisibleFrame.left,mFrame.left),Math.max(mVisibleFrame.top,mFrame.top),Math.min(mVisibleFrame.right,mFrame.right),Math.min(mVisibleFrame.bottom,mFrame.bottom));
  mStableFrame.set(Math.max(mStableFrame.left,mFrame.left),Math.max(mStableFrame.top,mFrame.top),Math.min(mStableFrame.right,mFrame.right),Math.min(mStableFrame.bottom,mFrame.bottom));
  mOverscanInsets.set(Math.max(mOverscanFrame.left - mFrame.left,0),Math.max(mOverscanFrame.top - mFrame.top,0),Math.max(mFrame.right - mOverscanFrame.right,0),Math.max(mFrame.bottom - mOverscanFrame.bottom,0));
  mContentInsets.set(mContentFrame.left - mFrame.left,mContentFrame.top - mFrame.top,mFrame.right - mContentFrame.right,mFrame.bottom - mContentFrame.bottom);
  mVisibleInsets.set(mVisibleFrame.left - mFrame.left,mVisibleFrame.top - mFrame.top,mFrame.right - mVisibleFrame.right,mFrame.bottom - mVisibleFrame.bottom);
  mStableInsets.set(Math.max(mStableFrame.left - mFrame.left,0),Math.max(mStableFrame.top - mFrame.top,0),Math.max(mFrame.right - mStableFrame.right,0),Math.max(mFrame.bottom - mStableFrame.bottom,0));
  mCompatFrame.set(mFrame);
  if (mEnforceSizeCompat) {
    mOverscanInsets.scale(mInvGlobalScale);
    mContentInsets.scale(mInvGlobalScale);
    mVisibleInsets.scale(mInvGlobalScale);
    mStableInsets.scale(mInvGlobalScale);
    mCompatFrame.scale(mInvGlobalScale);
  }
  if (mIsWallpaper && (fw != mFrame.width() || fh != mFrame.height())) {
    final DisplayContent displayContent=getDisplayContent();
    if (displayContent != null) {
      final DisplayInfo displayInfo=displayContent.getDisplayInfo();
      mService.updateWallpaperOffsetLocked(this,displayInfo.logicalWidth,displayInfo.logicalHeight,false);
    }
  }
  if (DEBUG_LAYOUT || WindowManagerService.localLOGV)   Slog.v(TAG,"String_Node_Str" + mRequestedWidth + "String_Node_Str"+ mRequestedHeight+ "String_Node_Str"+ "String_Node_Str"+ pw+ "String_Node_Str"+ ph+ "String_Node_Str"+ mFrame.toShortString()+ "String_Node_Str"+ mContentInsets.toShortString()+ "String_Node_Str"+ mVisibleInsets.toShortString()+ "String_Node_Str"+ mStableInsets.toShortString());
}