Program: 177
Project: 177
Buggy source:
/** 
 * @deprecated use {@link #setBackground(Drawable)} instead
 */
@Deprecated public void setBackgroundDrawable(Drawable background){
  computeOpaqueFlags();
  if (background == mBackground) {
    return;
  }
  boolean requestLayout=false;
  mBackgroundResource=0;
  if (mBackground != null) {
    mBackground.setCallback(null);
    unscheduleDrawable(mBackground);
  }
  if (background != null) {
    Rect padding=sThreadLocal.get();
    if (padding == null) {
      padding=new Rect();
      sThreadLocal.set(padding);
    }
    resetResolvedDrawables();
    background.setLayoutDirection(getLayoutDirection());
    if (background.getPadding(padding)) {
      resetResolvedPadding();
switch (background.getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
        mUserPaddingLeftInitial=padding.right;
      mUserPaddingRightInitial=padding.left;
    internalSetPadding(padding.right,padding.top,padding.left,padding.bottom);
  break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=padding.left;
mUserPaddingRightInitial=padding.right;
internalSetPadding(padding.left,padding.top,padding.right,padding.bottom);
}
mUseBackgroundPadding=true;
}
 else {
mUseBackgroundPadding=false;
}
if (mBackground == null || mBackground.getMinimumHeight() != background.getMinimumHeight() || mBackground.getMinimumWidth() != background.getMinimumWidth()) {
requestLayout=true;
}
background.setCallback(this);
if (background.isStateful()) {
background.setState(getDrawableState());
}
background.setVisible(getVisibility() == VISIBLE,false);
mBackground=background;
if ((mPrivateFlags & PFLAG_SKIP_DRAW) != 0) {
mPrivateFlags&=~PFLAG_SKIP_DRAW;
mPrivateFlags|=PFLAG_ONLY_DRAWS_BACKGROUND;
requestLayout=true;
}
}
 else {
mBackground=null;
mUseBackgroundPadding=false;
if ((mPrivateFlags & PFLAG_ONLY_DRAWS_BACKGROUND) != 0) {
mPrivateFlags&=~PFLAG_ONLY_DRAWS_BACKGROUND;
mPrivateFlags|=PFLAG_SKIP_DRAW;
}
requestLayout=true;
}
computeOpaqueFlags();
if (requestLayout) {
requestLayout();
}
mBackgroundSizeChanged=true;
invalidate(true);
}

Fixed version (ground truth):
/** 
 * @deprecated use {@link #setBackground(Drawable)} instead
 */
@Deprecated public void setBackgroundDrawable(Drawable background){
  computeOpaqueFlags();
  if (background == mBackground) {
    return;
  }
  boolean requestLayout=false;
  mBackgroundResource=0;
  if (mBackground != null) {
    mBackground.setCallback(null);
    unscheduleDrawable(mBackground);
  }
  if (background != null) {
    Rect padding=sThreadLocal.get();
    if (padding == null) {
      padding=new Rect();
      sThreadLocal.set(padding);
    }
    resetResolvedDrawables();
    background.setLayoutDirection(getLayoutDirection());
    if (background.getPadding(padding)) {
      resetResolvedPadding();
switch (background.getLayoutDirection()) {
case LAYOUT_DIRECTION_RTL:
        mUserPaddingLeftInitial=padding.right;
      mUserPaddingRightInitial=padding.left;
    internalSetPadding(padding.right,padding.top,padding.left,padding.bottom);
  break;
case LAYOUT_DIRECTION_LTR:
default :
mUserPaddingLeftInitial=padding.left;
mUserPaddingRightInitial=padding.right;
internalSetPadding(padding.left,padding.top,padding.right,padding.bottom);
}
}
if (mBackground == null || mBackground.getMinimumHeight() != background.getMinimumHeight() || mBackground.getMinimumWidth() != background.getMinimumWidth()) {
requestLayout=true;
}
background.setCallback(this);
if (background.isStateful()) {
background.setState(getDrawableState());
}
background.setVisible(getVisibility() == VISIBLE,false);
mBackground=background;
if ((mPrivateFlags & PFLAG_SKIP_DRAW) != 0) {
mPrivateFlags&=~PFLAG_SKIP_DRAW;
mPrivateFlags|=PFLAG_ONLY_DRAWS_BACKGROUND;
requestLayout=true;
}
}
 else {
mBackground=null;
if ((mPrivateFlags & PFLAG_ONLY_DRAWS_BACKGROUND) != 0) {
mPrivateFlags&=~PFLAG_ONLY_DRAWS_BACKGROUND;
mPrivateFlags|=PFLAG_SKIP_DRAW;
}
requestLayout=true;
}
computeOpaqueFlags();
if (requestLayout) {
requestLayout();
}
mBackgroundSizeChanged=true;
invalidate(true);
}