nus-yam/ex-repair huggingface dataset:
Program: 196019
Project: 196019
Buggy source:
private boolean filterMotionEvent(MotionEvent event){
  return event.getActionMasked() != MotionEvent.ACTION_DOWN || event.getY() > mClipTopAmount && event.getY() < mActualHeight;
}

Fixed version (ground truth):
protected boolean filterMotionEvent(MotionEvent event){
  return event.getActionMasked() != MotionEvent.ACTION_DOWN || event.getY() > mClipTopAmount && event.getY() < mActualHeight;
}
Program: 196020
Project: 196020
Buggy source:
public NotificationContentView(Context context,AttributeSet attrs){
  super(context,attrs);
  mFadePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.ADD));
  reset();
}

Fixed version (ground truth):
public NotificationContentView(Context context,AttributeSet attrs){
  super(context,attrs);
  mFadePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.ADD));
  reset(true);
}
Program: 196021
Project: 196021
Buggy source:
public void reset(){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
  }
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
  }
  removeAllViews();
  mContractedChild=null;
  mExpandedChild=null;
  mSmallHeight=getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  mActualHeight=mSmallHeight;
  mContractedVisible=true;
}

Fixed version (ground truth):
public void reset(boolean resetActualHeight){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
  }
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
  }
  removeAllViews();
  mContractedChild=null;
  mExpandedChild=null;
  mSmallHeight=getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  mContractedVisible=true;
  if (resetActualHeight) {
    mActualHeight=mSmallHeight;
  }
}
Program: 196022
Project: 196022
Buggy source:
public boolean showNotification(NotificationData.Entry headsUp){
  if (mHeadsUp != null && headsUp != null && !mHeadsUp.key.equals(headsUp.key)) {
    release();
  }
  mHeadsUp=headsUp;
  if (mContentHolder != null) {
    mContentHolder.removeAllViews();
  }
  if (mHeadsUp != null) {
    mHeadsUp.row.setSystemExpanded(true);
    mHeadsUp.row.setSensitive(false);
    mHeadsUp.row.setHideSensitive(false,false,0,0);
    if (mContentHolder == null) {
      return false;
    }
    mContentHolder.setX(0);
    mContentHolder.setVisibility(View.VISIBLE);
    mContentHolder.setAlpha(mMaxAlpha);
    mContentHolder.addView(mHeadsUp.row);
    sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
    mSwipeHelper.snapChild(mContentHolder,1f);
    mStartTouchTime=System.currentTimeMillis() + mTouchSensitivityDelay;
    mHeadsUp.setInterruption();
    mBar.scheduleHeadsUpOpen();
    mBar.resetHeadsUpDecayTimer();
  }
  return true;
}

Fixed version (ground truth):
public boolean showNotification(NotificationData.Entry headsUp){
  if (mHeadsUp != null && headsUp != null && !mHeadsUp.key.equals(headsUp.key)) {
    release();
  }
  mHeadsUp=headsUp;
  if (mContentHolder != null) {
    mContentHolder.removeAllViews();
  }
  if (mHeadsUp != null) {
    mHeadsUp.row.setSystemExpanded(true);
    mHeadsUp.row.setSensitive(false);
    mHeadsUp.row.setHeadsUp(true);
    mHeadsUp.row.setHideSensitive(false,false,0,0);
    if (mContentHolder == null) {
      return false;
    }
    mContentHolder.setX(0);
    mContentHolder.setVisibility(View.VISIBLE);
    mContentHolder.setAlpha(mMaxAlpha);
    mContentHolder.addView(mHeadsUp.row);
    sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
    mSwipeHelper.snapChild(mContentHolder,1f);
    mStartTouchTime=System.currentTimeMillis() + mTouchSensitivityDelay;
    mHeadsUp.setInterruption();
    mBar.scheduleHeadsUpOpen();
    mBar.resetHeadsUpDecayTimer();
  }
  return true;
}
Program: 196023
Project: 196023
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
switch (ev.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
    if (DEBUG_EDGE_SWIPE)     Log.d(TAG,"String_Node_Str" + ev.getY());
  mFirstX=ev.getX();
mFirstY=ev.getY();
mConsuming=false;
break;
case MotionEvent.ACTION_MOVE:
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str" + ev.getY());
final float dY=ev.getY() - mFirstY;
final float daX=Math.abs(ev.getX() - mFirstX);
final float daY=Math.abs(dY);
if (!mConsuming && (4f * daX) < daY && daY > mTouchSlop) {
if (dY > 0) {
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mBar.animateExpandNotificationsPanel();
}
if (dY < 0) {
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mBar.onHeadsUpDismissed();
}
mConsuming=true;
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mConsuming=false;
break;
}
return mConsuming;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
switch (ev.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
    if (DEBUG_EDGE_SWIPE)     Log.d(TAG,"String_Node_Str" + ev.getY());
  mFirstX=ev.getX();
mFirstY=ev.getY();
mConsuming=false;
break;
case MotionEvent.ACTION_MOVE:
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str" + ev.getY());
final float dY=ev.getY() - mFirstY;
final float daX=Math.abs(ev.getX() - mFirstX);
final float daY=Math.abs(dY);
if (!mConsuming && daX < daY && daY > mTouchSlop) {
if (dY > 0) {
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mBar.animateExpandNotificationsPanel();
}
if (dY < 0) {
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mBar.onHeadsUpDismissed();
}
mConsuming=true;
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mConsuming=false;
break;
}
return mConsuming;
}
Program: 196024
Project: 196024
Buggy source:
@Override public void onAttachedToWindow(){
  final ViewConfiguration viewConfiguration=ViewConfiguration.get(getContext());
  float touchSlop=viewConfiguration.getScaledTouchSlop();
  mSwipeHelper=new SwipeHelper(SwipeHelper.X,this,getContext());
  mSwipeHelper.setMaxSwipeProgress(mMaxAlpha);
  mEdgeSwipeHelper=new EdgeSwipeHelper(touchSlop);
  int minHeight=getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  int maxHeight=getResources().getDimensionPixelSize(R.dimen.notification_max_height);
  mExpandHelper=new ExpandHelper(getContext(),this,minHeight,maxHeight);
  mContentHolder=(ViewGroup)findViewById(R.id.content_holder);
  mContentHolder.setOutlineProvider(CONTENT_HOLDER_OUTLINE_PROVIDER);
  if (mHeadsUp != null) {
    showNotification(mHeadsUp);
  }
  getViewTreeObserver().addOnComputeInternalInsetsListener(this);
}

Fixed version (ground truth):
@Override public void onAttachedToWindow(){
  final ViewConfiguration viewConfiguration=ViewConfiguration.get(getContext());
  float touchSlop=viewConfiguration.getScaledTouchSlop();
  mSwipeHelper=new SwipeHelper(SwipeHelper.X,this,getContext());
  mSwipeHelper.setMaxSwipeProgress(mMaxAlpha);
  mEdgeSwipeHelper=new EdgeSwipeHelper(touchSlop);
  int minHeight=getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  int maxHeight=getResources().getDimensionPixelSize(R.dimen.notification_max_height);
  mContentHolder=(ViewGroup)findViewById(R.id.content_holder);
  mContentHolder.setOutlineProvider(CONTENT_HOLDER_OUTLINE_PROVIDER);
  if (mHeadsUp != null) {
    showNotification(mHeadsUp);
  }
  getViewTreeObserver().addOnComputeInternalInsetsListener(this);
}
Program: 196025
Project: 196025
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
switch (ev.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
    if (DEBUG_EDGE_SWIPE)     Log.d(TAG,"String_Node_Str" + ev.getY());
  mFirstX=ev.getX();
mFirstY=ev.getY();
mConsuming=false;
break;
case MotionEvent.ACTION_MOVE:
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str" + ev.getY());
final float dY=ev.getY() - mFirstY;
final float daX=Math.abs(ev.getX() - mFirstX);
final float daY=Math.abs(dY);
if (!mConsuming && (4f * daX) < daY && daY > mTouchSlop) {
if (dY > 0) {
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mBar.animateExpandNotificationsPanel();
}
if (dY < 0) {
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mBar.onHeadsUpDismissed();
}
mConsuming=true;
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mConsuming=false;
break;
}
return mConsuming;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
switch (ev.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
    if (DEBUG_EDGE_SWIPE)     Log.d(TAG,"String_Node_Str" + ev.getY());
  mFirstX=ev.getX();
mFirstY=ev.getY();
mConsuming=false;
break;
case MotionEvent.ACTION_MOVE:
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str" + ev.getY());
final float dY=ev.getY() - mFirstY;
final float daX=Math.abs(ev.getX() - mFirstX);
final float daY=Math.abs(dY);
if (!mConsuming && daX < daY && daY > mTouchSlop) {
if (dY > 0) {
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mBar.animateExpandNotificationsPanel();
}
if (dY < 0) {
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mBar.onHeadsUpDismissed();
}
mConsuming=true;
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mConsuming=false;
break;
}
return mConsuming;
}
Program: 196026
Project: 196026
Buggy source:
@Override public void onAttachedToWindow(){
  final ViewConfiguration viewConfiguration=ViewConfiguration.get(getContext());
  float touchSlop=viewConfiguration.getScaledTouchSlop();
  mSwipeHelper=new SwipeHelper(SwipeHelper.X,this,getContext());
  mSwipeHelper.setMaxSwipeProgress(mMaxAlpha);
  mEdgeSwipeHelper=new EdgeSwipeHelper(touchSlop);
  int minHeight=getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  int maxHeight=getResources().getDimensionPixelSize(R.dimen.notification_max_height);
  mExpandHelper=new ExpandHelper(getContext(),this,minHeight,maxHeight);
  mContentHolder=(ViewGroup)findViewById(R.id.content_holder);
  mContentHolder.setOutlineProvider(CONTENT_HOLDER_OUTLINE_PROVIDER);
  if (mHeadsUp != null) {
    showNotification(mHeadsUp);
  }
  getViewTreeObserver().addOnComputeInternalInsetsListener(this);
}

Fixed version (ground truth):
@Override public void onAttachedToWindow(){
  final ViewConfiguration viewConfiguration=ViewConfiguration.get(getContext());
  float touchSlop=viewConfiguration.getScaledTouchSlop();
  mSwipeHelper=new SwipeHelper(SwipeHelper.X,this,getContext());
  mSwipeHelper.setMaxSwipeProgress(mMaxAlpha);
  mEdgeSwipeHelper=new EdgeSwipeHelper(touchSlop);
  int minHeight=getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  int maxHeight=getResources().getDimensionPixelSize(R.dimen.notification_max_height);
  mContentHolder=(ViewGroup)findViewById(R.id.content_holder);
  mContentHolder.setOutlineProvider(CONTENT_HOLDER_OUTLINE_PROVIDER);
  if (mHeadsUp != null) {
    showNotification(mHeadsUp);
  }
  getViewTreeObserver().addOnComputeInternalInsetsListener(this);
}
Program: 196028
Project: 196028
Buggy source:
public void clearThumbnail(){
  if (thumbnail != null) {
    thumbnail.destroy();
    thumbnail=null;
  }
}

Fixed version (ground truth):
public void clearThumbnail(){
  if (thumbnail != null) {
    thumbnail.destroy();
    thumbnail=null;
  }
  deferThumbnailDestruction=false;
}
Program: 196029
Project: 196029
Buggy source:
public void clearAnimation(){
  if (animation != null) {
    animation=null;
    animating=true;
  }
  if (!deferThumbnailDestruction) {
    clearThumbnail();
  }
  if (mAppToken.deferClearAllDrawn) {
    mAppToken.allDrawn=false;
    mAppToken.deferClearAllDrawn=false;
  }
}

Fixed version (ground truth):
public void clearAnimation(){
  if (animation != null) {
    animation=null;
    animating=true;
  }
  clearThumbnail();
  if (mAppToken.deferClearAllDrawn) {
    mAppToken.allDrawn=false;
    mAppToken.deferClearAllDrawn=false;
  }
}
Program: 196030
Project: 196030
Buggy source:
private boolean stepAnimation(long currentTime){
  if (animation == null) {
    return false;
  }
  transformation.clear();
  final boolean more=animation.getTransformation(currentTime,transformation);
  if (false && WindowManagerService.DEBUG_ANIM)   Slog.v(TAG,"String_Node_Str" + mAppToken + "String_Node_Str"+ more+ "String_Node_Str"+ transformation);
  if (!more) {
    animation=null;
    if (!deferThumbnailDestruction) {
      clearThumbnail();
    }
    if (WindowManagerService.DEBUG_ANIM)     Slog.v(TAG,"String_Node_Str" + mAppToken + "String_Node_Str"+ currentTime);
  }
  hasTransformation=more;
  return more;
}

Fixed version (ground truth):
private boolean stepAnimation(long currentTime){
  if (animation == null) {
    return false;
  }
  transformation.clear();
  boolean hasMoreFrames=animation.getTransformation(currentTime,transformation);
  if (!hasMoreFrames) {
    if (deferThumbnailDestruction && !deferFinalFrameCleanup) {
      deferFinalFrameCleanup=true;
      hasMoreFrames=true;
    }
 else {
      if (false && WindowManagerService.DEBUG_ANIM)       Slog.v(TAG,"String_Node_Str" + mAppToken + "String_Node_Str"+ hasMoreFrames+ "String_Node_Str"+ transformation);
      deferFinalFrameCleanup=false;
      animation=null;
      clearThumbnail();
      if (WindowManagerService.DEBUG_ANIM)       Slog.v(TAG,"String_Node_Str" + mAppToken + "String_Node_Str"+ currentTime);
    }
  }
  hasTransformation=hasMoreFrames;
  return hasMoreFrames;
}
Program: 196034
Project: 196034
Buggy source:
public void clearThumbnail(){
  if (thumbnail != null) {
    thumbnail.destroy();
    thumbnail=null;
  }
}

Fixed version (ground truth):
public void clearThumbnail(){
  if (thumbnail != null) {
    thumbnail.destroy();
    thumbnail=null;
  }
  deferThumbnailDestruction=false;
}
Program: 196035
Project: 196035
Buggy source:
public void clearAnimation(){
  if (animation != null) {
    animation=null;
    animating=true;
  }
  if (!deferThumbnailDestruction) {
    clearThumbnail();
  }
  if (mAppToken.deferClearAllDrawn) {
    mAppToken.allDrawn=false;
    mAppToken.deferClearAllDrawn=false;
  }
}

Fixed version (ground truth):
public void clearAnimation(){
  if (animation != null) {
    animation=null;
    animating=true;
  }
  clearThumbnail();
  if (mAppToken.deferClearAllDrawn) {
    mAppToken.allDrawn=false;
    mAppToken.deferClearAllDrawn=false;
  }
}
Program: 196036
Project: 196036
Buggy source:
private boolean stepAnimation(long currentTime){
  if (animation == null) {
    return false;
  }
  transformation.clear();
  final boolean more=animation.getTransformation(currentTime,transformation);
  if (false && WindowManagerService.DEBUG_ANIM)   Slog.v(TAG,"String_Node_Str" + mAppToken + "String_Node_Str"+ more+ "String_Node_Str"+ transformation);
  if (!more) {
    animation=null;
    if (!deferThumbnailDestruction) {
      clearThumbnail();
    }
    if (WindowManagerService.DEBUG_ANIM)     Slog.v(TAG,"String_Node_Str" + mAppToken + "String_Node_Str"+ currentTime);
  }
  hasTransformation=more;
  return more;
}

Fixed version (ground truth):
private boolean stepAnimation(long currentTime){
  if (animation == null) {
    return false;
  }
  transformation.clear();
  boolean hasMoreFrames=animation.getTransformation(currentTime,transformation);
  if (!hasMoreFrames) {
    if (deferThumbnailDestruction && !deferFinalFrameCleanup) {
      deferFinalFrameCleanup=true;
      hasMoreFrames=true;
    }
 else {
      if (false && WindowManagerService.DEBUG_ANIM)       Slog.v(TAG,"String_Node_Str" + mAppToken + "String_Node_Str"+ hasMoreFrames+ "String_Node_Str"+ transformation);
      deferFinalFrameCleanup=false;
      animation=null;
      clearThumbnail();
      if (WindowManagerService.DEBUG_ANIM)       Slog.v(TAG,"String_Node_Str" + mAppToken + "String_Node_Str"+ currentTime);
    }
  }
  hasTransformation=hasMoreFrames;
  return hasMoreFrames;
}
Program: 196039
Project: 196039
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
switch (ev.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
    if (DEBUG_EDGE_SWIPE)     Log.d(TAG,"String_Node_Str" + ev.getY());
  mFirstX=ev.getX();
mFirstY=ev.getY();
mConsuming=false;
break;
case MotionEvent.ACTION_MOVE:
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str" + ev.getY());
final float dY=ev.getY() - mFirstY;
final float daX=Math.abs(ev.getX() - mFirstX);
final float daY=Math.abs(dY);
if (!mConsuming && (4f * daX) < daY && daY > mTouchSlop) {
if (dY > 0) {
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mBar.animateExpandNotificationsPanel();
}
if (dY < 0) {
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mBar.onHeadsUpDismissed();
}
mConsuming=true;
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mConsuming=false;
break;
}
return mConsuming;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
switch (ev.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
    if (DEBUG_EDGE_SWIPE)     Log.d(TAG,"String_Node_Str" + ev.getY());
  mFirstX=ev.getX();
mFirstY=ev.getY();
mConsuming=false;
break;
case MotionEvent.ACTION_MOVE:
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str" + ev.getY());
final float dY=ev.getY() - mFirstY;
final float daX=Math.abs(ev.getX() - mFirstX);
final float daY=Math.abs(dY);
if (!mConsuming && daX < daY && daY > mTouchSlop) {
if (dY > 0) {
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mBar.animateExpandNotificationsPanel();
}
if (dY < 0) {
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mBar.onHeadsUpDismissed();
}
mConsuming=true;
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
if (DEBUG_EDGE_SWIPE) Log.d(TAG,"String_Node_Str");
mConsuming=false;
break;
}
return mConsuming;
}
Program: 196040
Project: 196040
Buggy source:
@Override public void onAttachedToWindow(){
  final ViewConfiguration viewConfiguration=ViewConfiguration.get(getContext());
  float touchSlop=viewConfiguration.getScaledTouchSlop();
  mSwipeHelper=new SwipeHelper(SwipeHelper.X,this,getContext());
  mSwipeHelper.setMaxSwipeProgress(mMaxAlpha);
  mEdgeSwipeHelper=new EdgeSwipeHelper(touchSlop);
  int minHeight=getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  int maxHeight=getResources().getDimensionPixelSize(R.dimen.notification_max_height);
  mExpandHelper=new ExpandHelper(getContext(),this,minHeight,maxHeight);
  mContentHolder=(ViewGroup)findViewById(R.id.content_holder);
  mContentHolder.setOutlineProvider(CONTENT_HOLDER_OUTLINE_PROVIDER);
  if (mHeadsUp != null) {
    showNotification(mHeadsUp);
  }
  getViewTreeObserver().addOnComputeInternalInsetsListener(this);
}

Fixed version (ground truth):
@Override public void onAttachedToWindow(){
  final ViewConfiguration viewConfiguration=ViewConfiguration.get(getContext());
  float touchSlop=viewConfiguration.getScaledTouchSlop();
  mSwipeHelper=new SwipeHelper(SwipeHelper.X,this,getContext());
  mSwipeHelper.setMaxSwipeProgress(mMaxAlpha);
  mEdgeSwipeHelper=new EdgeSwipeHelper(touchSlop);
  int minHeight=getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  int maxHeight=getResources().getDimensionPixelSize(R.dimen.notification_max_height);
  mContentHolder=(ViewGroup)findViewById(R.id.content_holder);
  mContentHolder.setOutlineProvider(CONTENT_HOLDER_OUTLINE_PROVIDER);
  if (mHeadsUp != null) {
    showNotification(mHeadsUp);
  }
  getViewTreeObserver().addOnComputeInternalInsetsListener(this);
}
Program: 196041
Project: 196041
Buggy source:
public void resetHeight(){
  super.resetHeight();
  mMaxExpandHeight=0;
  mWasReset=true;
  onHeightReset();
  requestLayout();
}

Fixed version (ground truth):
public void resetHeight(){
  if (mIsHeadsUp) {
    resetActualHeight();
  }
  mMaxExpandHeight=0;
  mWasReset=true;
  onHeightReset();
  requestLayout();
}
Program: 196042
Project: 196042
Buggy source:
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  mRowMinHeight=0;
  final boolean wasExpanded=isExpanded();
  mRowMaxHeight=0;
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mExpansionDisabled=false;
  mPublicLayout.reset();
  mPrivateLayout.reset();
  resetHeight();
  logExpansionEvent(false,wasExpanded);
}

Fixed version (ground truth):
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  mRowMinHeight=0;
  final boolean wasExpanded=isExpanded();
  mRowMaxHeight=0;
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mExpansionDisabled=false;
  mPublicLayout.reset(mIsHeadsUp);
  mPrivateLayout.reset(mIsHeadsUp);
  resetHeight();
  logExpansionEvent(false,wasExpanded);
}
Program: 196043
Project: 196043
Buggy source:
private boolean filterMotionEvent(MotionEvent event){
  return event.getActionMasked() != MotionEvent.ACTION_DOWN || event.getY() > mClipTopAmount && event.getY() < mActualHeight;
}

Fixed version (ground truth):
protected boolean filterMotionEvent(MotionEvent event){
  return event.getActionMasked() != MotionEvent.ACTION_DOWN || event.getY() > mClipTopAmount && event.getY() < mActualHeight;
}
Program: 196044
Project: 196044
Buggy source:
public NotificationContentView(Context context,AttributeSet attrs){
  super(context,attrs);
  mFadePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.ADD));
  reset();
}

Fixed version (ground truth):
public NotificationContentView(Context context,AttributeSet attrs){
  super(context,attrs);
  mFadePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.ADD));
  reset(true);
}
Program: 196045
Project: 196045
Buggy source:
public void reset(){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
  }
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
  }
  removeAllViews();
  mContractedChild=null;
  mExpandedChild=null;
  mSmallHeight=getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  mActualHeight=mSmallHeight;
  mContractedVisible=true;
}

Fixed version (ground truth):
public void reset(boolean resetActualHeight){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
  }
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
  }
  removeAllViews();
  mContractedChild=null;
  mExpandedChild=null;
  mSmallHeight=getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  mContractedVisible=true;
  if (resetActualHeight) {
    mActualHeight=mSmallHeight;
  }
}
Program: 196046
Project: 196046
Buggy source:
public boolean showNotification(NotificationData.Entry headsUp){
  if (mHeadsUp != null && headsUp != null && !mHeadsUp.key.equals(headsUp.key)) {
    release();
  }
  mHeadsUp=headsUp;
  if (mContentHolder != null) {
    mContentHolder.removeAllViews();
  }
  if (mHeadsUp != null) {
    mHeadsUp.row.setSystemExpanded(true);
    mHeadsUp.row.setSensitive(false);
    mHeadsUp.row.setHideSensitive(false,false,0,0);
    if (mContentHolder == null) {
      return false;
    }
    mContentHolder.setX(0);
    mContentHolder.setVisibility(View.VISIBLE);
    mContentHolder.setAlpha(mMaxAlpha);
    mContentHolder.addView(mHeadsUp.row);
    sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
    mSwipeHelper.snapChild(mContentHolder,1f);
    mStartTouchTime=System.currentTimeMillis() + mTouchSensitivityDelay;
    mHeadsUp.setInterruption();
    mBar.scheduleHeadsUpOpen();
    mBar.resetHeadsUpDecayTimer();
  }
  return true;
}

Fixed version (ground truth):
public boolean showNotification(NotificationData.Entry headsUp){
  if (mHeadsUp != null && headsUp != null && !mHeadsUp.key.equals(headsUp.key)) {
    release();
  }
  mHeadsUp=headsUp;
  if (mContentHolder != null) {
    mContentHolder.removeAllViews();
  }
  if (mHeadsUp != null) {
    mHeadsUp.row.setSystemExpanded(true);
    mHeadsUp.row.setSensitive(false);
    mHeadsUp.row.setHeadsUp(true);
    mHeadsUp.row.setHideSensitive(false,false,0,0);
    if (mContentHolder == null) {
      return false;
    }
    mContentHolder.setX(0);
    mContentHolder.setVisibility(View.VISIBLE);
    mContentHolder.setAlpha(mMaxAlpha);
    mContentHolder.addView(mHeadsUp.row);
    sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);
    mSwipeHelper.snapChild(mContentHolder,1f);
    mStartTouchTime=System.currentTimeMillis() + mTouchSensitivityDelay;
    mHeadsUp.setInterruption();
    mBar.scheduleHeadsUpOpen();
    mBar.resetHeadsUpDecayTimer();
  }
  return true;
}
Program: 196049
Project: 196049
Buggy source:
public void clearThumbnail(){
  if (thumbnail != null) {
    thumbnail.destroy();
    thumbnail=null;
  }
}

Fixed version (ground truth):
public void clearThumbnail(){
  if (thumbnail != null) {
    thumbnail.destroy();
    thumbnail=null;
  }
  deferThumbnailDestruction=false;
}
Program: 196050
Project: 196050
Buggy source:
public void clearAnimation(){
  if (animation != null) {
    animation=null;
    animating=true;
  }
  if (!deferThumbnailDestruction) {
    clearThumbnail();
  }
  if (mAppToken.deferClearAllDrawn) {
    mAppToken.allDrawn=false;
    mAppToken.deferClearAllDrawn=false;
  }
}

Fixed version (ground truth):
public void clearAnimation(){
  if (animation != null) {
    animation=null;
    animating=true;
  }
  clearThumbnail();
  if (mAppToken.deferClearAllDrawn) {
    mAppToken.allDrawn=false;
    mAppToken.deferClearAllDrawn=false;
  }
}
Program: 196051
Project: 196051
Buggy source:
private boolean stepAnimation(long currentTime){
  if (animation == null) {
    return false;
  }
  transformation.clear();
  final boolean more=animation.getTransformation(currentTime,transformation);
  if (false && WindowManagerService.DEBUG_ANIM)   Slog.v(TAG,"String_Node_Str" + mAppToken + "String_Node_Str"+ more+ "String_Node_Str"+ transformation);
  if (!more) {
    animation=null;
    if (!deferThumbnailDestruction) {
      clearThumbnail();
    }
    if (WindowManagerService.DEBUG_ANIM)     Slog.v(TAG,"String_Node_Str" + mAppToken + "String_Node_Str"+ currentTime);
  }
  hasTransformation=more;
  return more;
}

Fixed version (ground truth):
private boolean stepAnimation(long currentTime){
  if (animation == null) {
    return false;
  }
  transformation.clear();
  boolean hasMoreFrames=animation.getTransformation(currentTime,transformation);
  if (!hasMoreFrames) {
    if (deferThumbnailDestruction && !deferFinalFrameCleanup) {
      deferFinalFrameCleanup=true;
      hasMoreFrames=true;
    }
 else {
      if (false && WindowManagerService.DEBUG_ANIM)       Slog.v(TAG,"String_Node_Str" + mAppToken + "String_Node_Str"+ hasMoreFrames+ "String_Node_Str"+ transformation);
      deferFinalFrameCleanup=false;
      animation=null;
      clearThumbnail();
      if (WindowManagerService.DEBUG_ANIM)       Slog.v(TAG,"String_Node_Str" + mAppToken + "String_Node_Str"+ currentTime);
    }
  }
  hasTransformation=hasMoreFrames;
  return hasMoreFrames;
}
Program: 196063
Project: 196063
Buggy source:
/** 
 * Completely remove the given task.
 * @param taskId Identifier of the task to be removed.
 * @param flags Additional operational flags.  May be 0 or{@link #REMOVE_TASK_KILL_PROCESS}.
 * @return Returns true if the given task was found and removed.
 * @hide
 */
public boolean removeTask(int taskId,int flags) throws SecurityException {
  try {
    return ActivityManagerNative.getDefault().removeTask(taskId,flags);
  }
 catch (  RemoteException e) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Completely remove the given task.
 * @param taskId Identifier of the task to be removed.
 * @return Returns true if the given task was found and removed.
 * @hide
 */
public boolean removeTask(int taskId) throws SecurityException {
  try {
    return ActivityManagerNative.getDefault().removeTask(taskId);
  }
 catch (  RemoteException e) {
    return false;
  }
}
Program: 196065
Project: 196065
Buggy source:
public boolean removeTask(int taskId,int flags) throws RemoteException {
  Parcel data=Parcel.obtain();
  Parcel reply=Parcel.obtain();
  data.writeInterfaceToken(IActivityManager.descriptor);
  data.writeInt(taskId);
  data.writeInt(flags);
  mRemote.transact(REMOVE_TASK_TRANSACTION,data,reply,0);
  reply.readException();
  boolean result=reply.readInt() != 0;
  reply.recycle();
  data.recycle();
  return result;
}

Fixed version (ground truth):
public boolean removeTask(int taskId) throws RemoteException {
  Parcel data=Parcel.obtain();
  Parcel reply=Parcel.obtain();
  data.writeInterfaceToken(IActivityManager.descriptor);
  data.writeInt(taskId);
  mRemote.transact(REMOVE_TASK_TRANSACTION,data,reply,0);
  reply.readException();
  boolean result=reply.readInt() != 0;
  reply.recycle();
  data.recycle();
  return result;
}
Program: 196066
Project: 196066
Buggy source:
public boolean removeTask(int taskId,int flags) throws RemoteException ;

Fixed version (ground truth):
public boolean removeTask(int taskId) throws RemoteException ;
Program: 196067
Project: 196067
Buggy source:
public void handleSwipe(View view){
  TaskDescription ad=((ViewHolder)view.getTag()).taskDescription;
  if (ad == null) {
    Log.v(TAG,"String_Node_Str" + view + "String_Node_Str"+ view.getTag());
    return;
  }
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + ad.getLabel());
  mRecentTaskDescriptions.remove(ad);
  mRecentTasksLoader.remove(ad);
  if (mRecentTaskDescriptions.size() == 0) {
    dismissAndGoBack();
  }
  final ActivityManager am=(ActivityManager)getContext().getSystemService(Context.ACTIVITY_SERVICE);
  if (am != null) {
    am.removeTask(ad.persistentTaskId,ActivityManager.REMOVE_TASK_KILL_PROCESS);
    setContentDescription(getContext().getString(R.string.accessibility_recents_item_dismissed,ad.getLabel()));
    sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
    setContentDescription(null);
  }
}

Fixed version (ground truth):
public void handleSwipe(View view){
  TaskDescription ad=((ViewHolder)view.getTag()).taskDescription;
  if (ad == null) {
    Log.v(TAG,"String_Node_Str" + view + "String_Node_Str"+ view.getTag());
    return;
  }
  if (DEBUG)   Log.v(TAG,"String_Node_Str" + ad.getLabel());
  mRecentTaskDescriptions.remove(ad);
  mRecentTasksLoader.remove(ad);
  if (mRecentTaskDescriptions.size() == 0) {
    dismissAndGoBack();
  }
  final ActivityManager am=(ActivityManager)getContext().getSystemService(Context.ACTIVITY_SERVICE);
  if (am != null) {
    am.removeTask(ad.persistentTaskId);
    setContentDescription(getContext().getString(R.string.accessibility_recents_item_dismissed,ad.getLabel()));
    sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
    setContentDescription(null);
  }
}
Program: 196068
Project: 196068
Buggy source:
/** 
 * Removes the task and kills the process 
 */
public void removeTask(int taskId,boolean isDocument){
  if (mAm == null)   return;
  if (Constants.DebugFlags.App.EnableSystemServicesProxy)   return;
  mAm.removeTask(taskId,isDocument ? 0 : ActivityManager.REMOVE_TASK_KILL_PROCESS);
}

Fixed version (ground truth):
/** 
 * Removes the task 
 */
public void removeTask(int taskId){
  if (mAm == null)   return;
  if (Constants.DebugFlags.App.EnableSystemServicesProxy)   return;
  mAm.removeTask(taskId);
}
Program: 196069
Project: 196069
Buggy source:
@Override public void onTaskViewDismissed(Task t){
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  loader.deleteTaskData(t,false);
  RecentsTaskLoader.getInstance().getSystemServicesProxy().removeTask(t.key.id,Utilities.isDocument(t.key.baseIntent));
}

Fixed version (ground truth):
@Override public void onTaskViewDismissed(Task t){
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  loader.deleteTaskData(t,false);
  RecentsTaskLoader.getInstance().getSystemServicesProxy().removeTask(t.key.id);
}
Program: 196070
Project: 196070
Buggy source:
@Override public void onPackageRemoved(String packageName,int uid){
  final int eventUserId=getChangingUserId();
synchronized (ActivityManagerService.this) {
    for (int i=mRecentTasks.size() - 1; i >= 0; i--) {
      TaskRecord tr=mRecentTasks.get(i);
      if (tr.userId != eventUserId)       continue;
      ComponentName cn=tr.intent.getComponent();
      if (cn != null && cn.getPackageName().equals(packageName)) {
        removeTaskByIdLocked(tr.taskId,ActivityManager.REMOVE_TASK_KILL_PROCESS);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onPackageRemoved(String packageName,int uid){
  final int eventUserId=getChangingUserId();
synchronized (ActivityManagerService.this) {
    for (int i=mRecentTasks.size() - 1; i >= 0; i--) {
      TaskRecord tr=mRecentTasks.get(i);
      if (tr.userId != eventUserId)       continue;
      ComponentName cn=tr.intent.getComponent();
      if (cn != null && cn.getPackageName().equals(packageName)) {
        removeTaskByIdLocked(tr.taskId,true);
      }
    }
  }
}
Program: 196073
Project: 196073
Buggy source:
@Override public boolean removeTask(int taskId,int flags){
synchronized (this) {
    enforceCallingPermission(android.Manifest.permission.REMOVE_TASKS,"String_Node_Str");
    long ident=Binder.clearCallingIdentity();
    try {
      return removeTaskByIdLocked(taskId,flags);
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}

Fixed version (ground truth):
@Override public boolean removeTask(int taskId){
synchronized (this) {
    enforceCallingPermission(android.Manifest.permission.REMOVE_TASKS,"String_Node_Str");
    long ident=Binder.clearCallingIdentity();
    try {
      return removeTaskByIdLocked(taskId,true);
    }
  finally {
      Binder.restoreCallingIdentity(ident);
    }
  }
}
Program: 196074
Project: 196074
Buggy source:
@Override public void finishAndRemoveTask(){
  checkCaller();
synchronized (ActivityManagerService.this) {
    long origId=Binder.clearCallingIdentity();
    try {
      TaskRecord tr=recentTaskForIdLocked(mTaskId);
      if (tr == null) {
        throw new IllegalArgumentException("String_Node_Str" + mTaskId);
      }
      int flags=tr.getBaseIntent().getFlags();
      boolean isDocument=(flags & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) == Intent.FLAG_ACTIVITY_NEW_DOCUMENT;
      removeTaskByIdLocked(mTaskId,!isDocument ? ActivityManager.REMOVE_TASK_KILL_PROCESS : 0);
    }
  finally {
      Binder.restoreCallingIdentity(origId);
    }
  }
}

Fixed version (ground truth):
@Override public void finishAndRemoveTask(){
  checkCaller();
synchronized (ActivityManagerService.this) {
    long origId=Binder.clearCallingIdentity();
    try {
      if (!removeTaskByIdLocked(mTaskId,false)) {
        throw new IllegalArgumentException("String_Node_Str" + mTaskId);
      }
    }
  finally {
      Binder.restoreCallingIdentity(origId);
    }
  }
}
Program: 196075
Project: 196075
Buggy source:
/** 
 * Removes the task with the specified task id.
 * @param taskId Identifier of the task to be removed.
 * @param flags Additional operational flags.  May be 0 or{@link ActivityManager#REMOVE_TASK_KILL_PROCESS}.
 * @return Returns true if the given task was found and removed.
 */
private boolean removeTaskByIdLocked(int taskId,int flags){
  TaskRecord tr=recentTaskForIdLocked(taskId);
  if (tr != null) {
    tr.removeTaskActivitiesLocked();
    cleanUpRemovedTaskLocked(tr,flags);
    if (tr.isPersistable) {
      notifyTaskPersisterLocked(null,true);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Removes the task with the specified task id.
 * @param taskId Identifier of the task to be removed.
 * @param killProcess Kill any process associated with the task if possible.
 * @return Returns true if the given task was found and removed.
 */
private boolean removeTaskByIdLocked(int taskId,boolean killProcess){
  TaskRecord tr=recentTaskForIdLocked(taskId);
  if (tr != null) {
    tr.removeTaskActivitiesLocked();
    cleanUpRemovedTaskLocked(tr,killProcess);
    if (tr.isPersistable) {
      notifyTaskPersisterLocked(null,true);
    }
    return true;
  }
  return false;
}
Program: 196076
Project: 196076
Buggy source:
@Override public void onPackageModified(String packageName){
  final int eventUserId=getChangingUserId();
  final IPackageManager pm=AppGlobals.getPackageManager();
  final ArrayList<Pair<Intent,Integer>> recentTaskIntents=new ArrayList<Pair<Intent,Integer>>();
  final HashSet<ComponentName> componentsKnownToExist=new HashSet<ComponentName>();
  final ArrayList<Integer> tasksToRemove=new ArrayList<Integer>();
synchronized (ActivityManagerService.this) {
    for (int i=mRecentTasks.size() - 1; i >= 0; i--) {
      TaskRecord tr=mRecentTasks.get(i);
      if (tr.userId != eventUserId)       continue;
      recentTaskIntents.add(new Pair<Intent,Integer>(tr.intent,tr.taskId));
    }
  }
  for (int i=recentTaskIntents.size() - 1; i >= 0; i--) {
    Pair<Intent,Integer> p=recentTaskIntents.get(i);
    ComponentName cn=p.first.getComponent();
    if (cn != null && cn.getPackageName().equals(packageName)) {
      if (componentsKnownToExist.contains(cn)) {
        continue;
      }
      try {
        ActivityInfo info=pm.getActivityInfo(cn,0,eventUserId);
        if (info != null) {
          componentsKnownToExist.add(cn);
        }
 else {
          tasksToRemove.add(p.second);
        }
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + cn,e);
      }
    }
  }
synchronized (ActivityManagerService.this) {
    for (int i=tasksToRemove.size() - 1; i >= 0; i--) {
      removeTaskByIdLocked(tasksToRemove.get(i),0);
    }
  }
}

Fixed version (ground truth):
@Override public void onPackageModified(String packageName){
  final int eventUserId=getChangingUserId();
  final IPackageManager pm=AppGlobals.getPackageManager();
  final ArrayList<Pair<Intent,Integer>> recentTaskIntents=new ArrayList<Pair<Intent,Integer>>();
  final HashSet<ComponentName> componentsKnownToExist=new HashSet<ComponentName>();
  final ArrayList<Integer> tasksToRemove=new ArrayList<Integer>();
synchronized (ActivityManagerService.this) {
    for (int i=mRecentTasks.size() - 1; i >= 0; i--) {
      TaskRecord tr=mRecentTasks.get(i);
      if (tr.userId != eventUserId)       continue;
      recentTaskIntents.add(new Pair<Intent,Integer>(tr.intent,tr.taskId));
    }
  }
  for (int i=recentTaskIntents.size() - 1; i >= 0; i--) {
    Pair<Intent,Integer> p=recentTaskIntents.get(i);
    ComponentName cn=p.first.getComponent();
    if (cn != null && cn.getPackageName().equals(packageName)) {
      if (componentsKnownToExist.contains(cn)) {
        continue;
      }
      try {
        ActivityInfo info=pm.getActivityInfo(cn,0,eventUserId);
        if (info != null) {
          componentsKnownToExist.add(cn);
        }
 else {
          tasksToRemove.add(p.second);
        }
      }
 catch (      RemoteException e) {
        Log.e(TAG,"String_Node_Str" + cn,e);
      }
    }
  }
synchronized (ActivityManagerService.this) {
    for (int i=tasksToRemove.size() - 1; i >= 0; i--) {
      removeTaskByIdLocked(tasksToRemove.get(i),false);
    }
  }
}
Program: 196077
Project: 196077
Buggy source:
private void cleanUpRemovedTaskLocked(TaskRecord tr,int flags){
  mRecentTasks.remove(tr);
  tr.removedFromRecents(mTaskPersister);
  final boolean killProcesses=(flags & ActivityManager.REMOVE_TASK_KILL_PROCESS) != 0;
  Intent baseIntent=new Intent(tr.intent != null ? tr.intent : tr.affinityIntent);
  ComponentName component=baseIntent.getComponent();
  if (component == null) {
    Slog.w(TAG,"String_Node_Str" + tr);
    return;
  }
  mServices.cleanUpRemovedTaskLocked(tr,component,baseIntent);
  if (killProcesses) {
    final String pkg=component.getPackageName();
    ArrayList<ProcessRecord> procs=new ArrayList<ProcessRecord>();
    ArrayMap<String,SparseArray<ProcessRecord>> pmap=mProcessNames.getMap();
    for (int i=0; i < pmap.size(); i++) {
      SparseArray<ProcessRecord> uids=pmap.valueAt(i);
      for (int j=0; j < uids.size(); j++) {
        ProcessRecord proc=uids.valueAt(j);
        if (proc.userId != tr.userId) {
          continue;
        }
        if (!proc.pkgList.containsKey(pkg)) {
          continue;
        }
        procs.add(proc);
      }
    }
    for (int i=0; i < procs.size(); i++) {
      ProcessRecord pr=procs.get(i);
      if (pr == mHomeProcess) {
        continue;
      }
      if (pr.setSchedGroup == Process.THREAD_GROUP_BG_NONINTERACTIVE) {
        pr.kill("String_Node_Str",true);
      }
 else {
        pr.waitingToKill="String_Node_Str";
      }
    }
  }
}

Fixed version (ground truth):
private void cleanUpRemovedTaskLocked(TaskRecord tr,boolean killProcess){
  mRecentTasks.remove(tr);
  tr.removedFromRecents(mTaskPersister);
  ComponentName component=tr.getBaseIntent().getComponent();
  if (component == null) {
    Slog.w(TAG,"String_Node_Str" + tr);
    return;
  }
  if (!killProcess) {
    return;
  }
  final String pkg=component.getPackageName();
  ArrayList<ProcessRecord> procsToKill=new ArrayList<ProcessRecord>();
  ArrayMap<String,SparseArray<ProcessRecord>> pmap=mProcessNames.getMap();
  for (int i=0; i < pmap.size(); i++) {
    SparseArray<ProcessRecord> uids=pmap.valueAt(i);
    for (int j=0; j < uids.size(); j++) {
      ProcessRecord proc=uids.valueAt(j);
      if (proc.userId != tr.userId) {
        continue;
      }
      if (proc == mHomeProcess) {
        continue;
      }
      if (!proc.pkgList.containsKey(pkg)) {
        continue;
      }
      for (int k=0; k < proc.activities.size(); k++) {
        TaskRecord otherTask=proc.activities.get(k).task;
        if (tr.taskId != otherTask.taskId && otherTask.inRecents) {
          return;
        }
      }
      procsToKill.add(proc);
    }
  }
  mServices.cleanUpRemovedTaskLocked(tr,component,new Intent(tr.getBaseIntent()));
  for (int i=0; i < procsToKill.size(); i++) {
    ProcessRecord pr=procsToKill.get(i);
    if (pr.setSchedGroup == Process.THREAD_GROUP_BG_NONINTERACTIVE) {
      pr.kill("String_Node_Str",true);
    }
 else {
      pr.waitingToKill="String_Node_Str";
    }
  }
}
Program: 196078
Project: 196078
Buggy source:
@Override public boolean onLongClick(View v){
  if (task.id >= 0 && thumbs != null) {
    mAm.removeTask(task.id,ActivityManager.REMOVE_TASK_KILL_PROCESS);
    buildUi();
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onLongClick(View v){
  if (task.id >= 0 && thumbs != null) {
    mAm.removeTask(task.id);
    buildUi();
    return true;
  }
  return false;
}
Program: 196079
Project: 196079
Buggy source:
private void addThumbnail(LinearLayout container,Bitmap bm,final ActivityManager.RecentTaskInfo task,final ActivityManager.TaskThumbnail thumbs){
  ImageView iv=new ImageView(this);
  if (bm != null) {
    iv.setImageBitmap(bm);
  }
  iv.setBackgroundResource(android.R.drawable.gallery_thumb);
  int w=getResources().getDimensionPixelSize(android.R.dimen.thumbnail_width);
  int h=getResources().getDimensionPixelSize(android.R.dimen.thumbnail_height);
  container.addView(iv,new LinearLayout.LayoutParams(w,h));
  iv.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (task.id >= 0 && thumbs != null) {
        mAm.moveTaskToFront(task.id,ActivityManager.MOVE_TASK_WITH_HOME);
      }
 else {
        try {
          startActivity(task.baseIntent);
        }
 catch (        ActivityNotFoundException e) {
          Log.w("String_Node_Str","String_Node_Str" + e);
        }
      }
      buildUi();
    }
  }
);
  iv.setOnLongClickListener(new View.OnLongClickListener(){
    @Override public boolean onLongClick(    View v){
      if (task.id >= 0 && thumbs != null) {
        mAm.removeTask(task.id,ActivityManager.REMOVE_TASK_KILL_PROCESS);
        buildUi();
        return true;
      }
      return false;
    }
  }
);
}

Fixed version (ground truth):
private void addThumbnail(LinearLayout container,Bitmap bm,final ActivityManager.RecentTaskInfo task,final ActivityManager.TaskThumbnail thumbs){
  ImageView iv=new ImageView(this);
  if (bm != null) {
    iv.setImageBitmap(bm);
  }
  iv.setBackgroundResource(android.R.drawable.gallery_thumb);
  int w=getResources().getDimensionPixelSize(android.R.dimen.thumbnail_width);
  int h=getResources().getDimensionPixelSize(android.R.dimen.thumbnail_height);
  container.addView(iv,new LinearLayout.LayoutParams(w,h));
  iv.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (task.id >= 0 && thumbs != null) {
        mAm.moveTaskToFront(task.id,ActivityManager.MOVE_TASK_WITH_HOME);
      }
 else {
        try {
          startActivity(task.baseIntent);
        }
 catch (        ActivityNotFoundException e) {
          Log.w("String_Node_Str","String_Node_Str" + e);
        }
      }
      buildUi();
    }
  }
);
  iv.setOnLongClickListener(new View.OnLongClickListener(){
    @Override public boolean onLongClick(    View v){
      if (task.id >= 0 && thumbs != null) {
        mAm.removeTask(task.id);
        buildUi();
        return true;
      }
      return false;
    }
  }
);
}
Program: 196080
Project: 196080
Buggy source:
/** 
 * Completely remove the given task.
 * @param taskId Identifier of the task to be removed.
 * @param flags Additional operational flags.  May be 0 or{@link #REMOVE_TASK_KILL_PROCESS}.
 * @return Returns true if the given task was found and removed.
 * @hide
 */
public boolean removeTask(int taskId,int flags) throws SecurityException {
  try {
    return ActivityManagerNative.getDefault().removeTask(taskId,flags);
  }
 catch (  RemoteException e) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Completely remove the given task.
 * @param taskId Identifier of the task to be removed.
 * @return Returns true if the given task was found and removed.
 * @hide
 */
public boolean removeTask(int taskId) throws SecurityException {
  try {
    return ActivityManagerNative.getDefault().removeTask(taskId);
  }
 catch (  RemoteException e) {
    return false;
  }
}
Program: 196082
Project: 196082
Buggy source:
public boolean removeTask(int taskId,int flags) throws RemoteException {
  Parcel data=Parcel.obtain();
  Parcel reply=Parcel.obtain();
  data.writeInterfaceToken(IActivityManager.descriptor);
  data.writeInt(taskId);
  data.writeInt(flags);
  mRemote.transact(REMOVE_TASK_TRANSACTION,data,reply,0);
  reply.readException();
  boolean result=reply.readInt() != 0;
  reply.recycle();
  data.recycle();
  return result;
}

Fixed version (ground truth):
public boolean removeTask(int taskId) throws RemoteException {
  Parcel data=Parcel.obtain();
  Parcel reply=Parcel.obtain();
  data.writeInterfaceToken(IActivityManager.descriptor);
  data.writeInt(taskId);
  mRemote.transact(REMOVE_TASK_TRANSACTION,data,reply,0);
  reply.readException();
  boolean result=reply.readInt() != 0;
  reply.recycle();
  data.recycle();
  return result;
}
Program: 196083
Project: 196083
Buggy source:
public boolean removeTask(int taskId,int flags) throws RemoteException ;

Fixed version (ground truth):
public boolean removeTask(int taskId) throws RemoteException ;