nus-yam/ex-repair huggingface dataset:
Program: 198361
Project: 198361
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final Window window=getWindow();
  final WindowManager.LayoutParams lp=window.getAttributes();
  lp.y=getResources().getDimensionPixelOffset(R.dimen.volume_panel_top);
  lp.type=WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY;
  lp.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
  window.setAttributes(lp);
  window.setGravity(Gravity.TOP);
  window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
  window.requestFeature(Window.FEATURE_NO_TITLE);
  setContentView(R.layout.quick_settings_brightness_dialog);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final Window window=getWindow();
  window.setGravity(Gravity.TOP);
  window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
  window.requestFeature(Window.FEATURE_NO_TITLE);
  setContentView(R.layout.quick_settings_brightness_dialog);
  final ImageView icon=(ImageView)findViewById(R.id.brightness_icon);
  final ToggleSlider slider=(ToggleSlider)findViewById(R.id.brightness_slider);
  mBrightnessController=new BrightnessController(this,icon,slider);
}
Program: 198362
Project: 198362
Buggy source:
@Override protected void onStart(){
  super.onStart();
  final ImageView icon=(ImageView)findViewById(R.id.brightness_icon);
  final ToggleSlider slider=(ToggleSlider)findViewById(R.id.brightness_slider);
  mBrightnessController=new BrightnessController(this,icon,slider);
  mBrightnessController.registerCallbacks();
}

Fixed version (ground truth):
@Override protected void onStart(){
  super.onStart();
  mBrightnessController.registerCallbacks();
}
Program: 198363
Project: 198363
Buggy source:
@Override public void onStateChanged(Connection c,int state){
switch (state) {
case Connection.STATE_FAILED:
    Log.d(this,"String_Node_Str",request,c.getFailureCode(),c.getFailureMessage());
  Log.d(this,"String_Node_Str",callId);
mAdapter.handleCreateConnectionFailed(callId,request,c.getFailureCode(),c.getFailureMessage());
break;
case Connection.STATE_CANCELED:
Log.d(this,"String_Node_Str",callId);
mAdapter.handleCreateConnectionCancelled(callId,request);
break;
case Connection.STATE_INITIALIZING:
Log.d(this,"String_Node_Str");
return;
default :
Log.d(this,"String_Node_Str",Connection.stateToString(state));
connectionCreated(callId,request,createdConnection);
break;
}
c.removeConnectionListener(this);
}

Fixed version (ground truth):
@Override public void onStateChanged(Connection c,int state){
switch (state) {
case Connection.STATE_FAILED:
    Log.d(this,"String_Node_Str",request,c.getFailureCode(),c.getFailureMessage());
  Log.d(this,"String_Node_Str",callId);
mAdapter.handleCreateConnectionFailed(callId,request,c.getFailureCode(),c.getFailureMessage());
break;
case Connection.STATE_CANCELED:
Log.d(this,"String_Node_Str",callId);
mAdapter.handleCreateConnectionCancelled(callId,request);
break;
case Connection.STATE_INITIALIZING:
Log.d(this,"String_Node_Str");
return;
}
c.removeConnectionListener(this);
}
Program: 198365
Project: 198365
Buggy source:
@Override public void onChange(boolean selfChange,Uri uri){
  if (selfChange)   return;
  if (BRIGHTNESS_MODE_URI.equals(uri)) {
    updateMode();
    updateSlider();
  }
 else   if (BRIGHTNESS_URI.equals(uri) && !mAutomatic) {
    updateSlider();
  }
 else   if (BRIGHTNESS_ADJ_URI.equals(uri) && mAutomatic) {
    updateSlider();
  }
 else {
    updateMode();
    updateSlider();
  }
  for (  BrightnessStateChangeCallback cb : mChangeCallbacks) {
    cb.onBrightnessLevelChanged();
  }
}

Fixed version (ground truth):
@Override public void onChange(boolean selfChange,Uri uri){
  if (selfChange)   return;
  try {
    mExternalChange=true;
    if (BRIGHTNESS_MODE_URI.equals(uri)) {
      updateMode();
      updateSlider();
    }
 else     if (BRIGHTNESS_URI.equals(uri) && !mAutomatic) {
      updateSlider();
    }
 else     if (BRIGHTNESS_ADJ_URI.equals(uri) && mAutomatic) {
      updateSlider();
    }
 else {
      updateMode();
      updateSlider();
    }
    for (    BrightnessStateChangeCallback cb : mChangeCallbacks) {
      cb.onBrightnessLevelChanged();
    }
  }
  finally {
    mExternalChange=false;
  }
}
Program: 198366
Project: 198366
Buggy source:
@Override public void onChanged(ToggleSlider view,boolean tracking,boolean automatic,int value){
  updateIcon(mAutomatic);
  if (!mAutomatic) {
    final int val=value + mMinimumBacklight;
    setBrightness(val);
    if (!tracking) {
      AsyncTask.execute(new Runnable(){
        public void run(){
          Settings.System.putIntForUser(mContext.getContentResolver(),Settings.System.SCREEN_BRIGHTNESS,val,UserHandle.USER_CURRENT);
        }
      }
);
    }
  }
 else {
    final float adj=value / (BRIGHTNESS_ADJ_RESOLUTION / 2f) - 1;
    setBrightnessAdj(adj);
    if (!tracking) {
      AsyncTask.execute(new Runnable(){
        public void run(){
          Settings.System.putFloatForUser(mContext.getContentResolver(),Settings.System.SCREEN_AUTO_BRIGHTNESS_ADJ,adj,UserHandle.USER_CURRENT);
        }
      }
);
    }
  }
  for (  BrightnessStateChangeCallback cb : mChangeCallbacks) {
    cb.onBrightnessLevelChanged();
  }
}

Fixed version (ground truth):
@Override public void onChanged(ToggleSlider view,boolean tracking,boolean automatic,int value){
  updateIcon(mAutomatic);
  if (mExternalChange)   return;
  if (!mAutomatic) {
    final int val=value + mMinimumBacklight;
    setBrightness(val);
    if (!tracking) {
      AsyncTask.execute(new Runnable(){
        public void run(){
          Settings.System.putIntForUser(mContext.getContentResolver(),Settings.System.SCREEN_BRIGHTNESS,val,UserHandle.USER_CURRENT);
        }
      }
);
    }
  }
 else {
    final float adj=value / (BRIGHTNESS_ADJ_RESOLUTION / 2f) - 1;
    setBrightnessAdj(adj);
    if (!tracking) {
      AsyncTask.execute(new Runnable(){
        public void run(){
          Settings.System.putFloatForUser(mContext.getContentResolver(),Settings.System.SCREEN_AUTO_BRIGHTNESS_ADJ,adj,UserHandle.USER_CURRENT);
        }
      }
);
    }
  }
  for (  BrightnessStateChangeCallback cb : mChangeCallbacks) {
    cb.onBrightnessLevelChanged();
  }
}
Program: 198367
Project: 198367
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final Window window=getWindow();
  final WindowManager.LayoutParams lp=window.getAttributes();
  lp.y=getResources().getDimensionPixelOffset(R.dimen.volume_panel_top);
  lp.type=WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY;
  lp.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
  window.setAttributes(lp);
  window.setGravity(Gravity.TOP);
  window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
  window.requestFeature(Window.FEATURE_NO_TITLE);
  setContentView(R.layout.quick_settings_brightness_dialog);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final Window window=getWindow();
  window.setGravity(Gravity.TOP);
  window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
  window.requestFeature(Window.FEATURE_NO_TITLE);
  setContentView(R.layout.quick_settings_brightness_dialog);
  final ImageView icon=(ImageView)findViewById(R.id.brightness_icon);
  final ToggleSlider slider=(ToggleSlider)findViewById(R.id.brightness_slider);
  mBrightnessController=new BrightnessController(this,icon,slider);
}
Program: 198368
Project: 198368
Buggy source:
@Override protected void onStart(){
  super.onStart();
  final ImageView icon=(ImageView)findViewById(R.id.brightness_icon);
  final ToggleSlider slider=(ToggleSlider)findViewById(R.id.brightness_slider);
  mBrightnessController=new BrightnessController(this,icon,slider);
  mBrightnessController.registerCallbacks();
}

Fixed version (ground truth):
@Override protected void onStart(){
  super.onStart();
  mBrightnessController.registerCallbacks();
}
Program: 198369
Project: 198369
Buggy source:
@Override public void onChange(boolean selfChange,Uri uri){
  if (selfChange)   return;
  if (BRIGHTNESS_MODE_URI.equals(uri)) {
    updateMode();
    updateSlider();
  }
 else   if (BRIGHTNESS_URI.equals(uri) && !mAutomatic) {
    updateSlider();
  }
 else   if (BRIGHTNESS_ADJ_URI.equals(uri) && mAutomatic) {
    updateSlider();
  }
 else {
    updateMode();
    updateSlider();
  }
  for (  BrightnessStateChangeCallback cb : mChangeCallbacks) {
    cb.onBrightnessLevelChanged();
  }
}

Fixed version (ground truth):
@Override public void onChange(boolean selfChange,Uri uri){
  if (selfChange)   return;
  try {
    mExternalChange=true;
    if (BRIGHTNESS_MODE_URI.equals(uri)) {
      updateMode();
      updateSlider();
    }
 else     if (BRIGHTNESS_URI.equals(uri) && !mAutomatic) {
      updateSlider();
    }
 else     if (BRIGHTNESS_ADJ_URI.equals(uri) && mAutomatic) {
      updateSlider();
    }
 else {
      updateMode();
      updateSlider();
    }
    for (    BrightnessStateChangeCallback cb : mChangeCallbacks) {
      cb.onBrightnessLevelChanged();
    }
  }
  finally {
    mExternalChange=false;
  }
}
Program: 198370
Project: 198370
Buggy source:
@Override public void onChanged(ToggleSlider view,boolean tracking,boolean automatic,int value){
  updateIcon(mAutomatic);
  if (!mAutomatic) {
    final int val=value + mMinimumBacklight;
    setBrightness(val);
    if (!tracking) {
      AsyncTask.execute(new Runnable(){
        public void run(){
          Settings.System.putIntForUser(mContext.getContentResolver(),Settings.System.SCREEN_BRIGHTNESS,val,UserHandle.USER_CURRENT);
        }
      }
);
    }
  }
 else {
    final float adj=value / (BRIGHTNESS_ADJ_RESOLUTION / 2f) - 1;
    setBrightnessAdj(adj);
    if (!tracking) {
      AsyncTask.execute(new Runnable(){
        public void run(){
          Settings.System.putFloatForUser(mContext.getContentResolver(),Settings.System.SCREEN_AUTO_BRIGHTNESS_ADJ,adj,UserHandle.USER_CURRENT);
        }
      }
);
    }
  }
  for (  BrightnessStateChangeCallback cb : mChangeCallbacks) {
    cb.onBrightnessLevelChanged();
  }
}

Fixed version (ground truth):
@Override public void onChanged(ToggleSlider view,boolean tracking,boolean automatic,int value){
  updateIcon(mAutomatic);
  if (mExternalChange)   return;
  if (!mAutomatic) {
    final int val=value + mMinimumBacklight;
    setBrightness(val);
    if (!tracking) {
      AsyncTask.execute(new Runnable(){
        public void run(){
          Settings.System.putIntForUser(mContext.getContentResolver(),Settings.System.SCREEN_BRIGHTNESS,val,UserHandle.USER_CURRENT);
        }
      }
);
    }
  }
 else {
    final float adj=value / (BRIGHTNESS_ADJ_RESOLUTION / 2f) - 1;
    setBrightnessAdj(adj);
    if (!tracking) {
      AsyncTask.execute(new Runnable(){
        public void run(){
          Settings.System.putFloatForUser(mContext.getContentResolver(),Settings.System.SCREEN_AUTO_BRIGHTNESS_ADJ,adj,UserHandle.USER_CURRENT);
        }
      }
);
    }
  }
  for (  BrightnessStateChangeCallback cb : mChangeCallbacks) {
    cb.onBrightnessLevelChanged();
  }
}
Program: 198371
Project: 198371
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final Window window=getWindow();
  final WindowManager.LayoutParams lp=window.getAttributes();
  lp.y=getResources().getDimensionPixelOffset(R.dimen.volume_panel_top);
  lp.type=WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY;
  lp.privateFlags|=WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
  window.setAttributes(lp);
  window.setGravity(Gravity.TOP);
  window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
  window.requestFeature(Window.FEATURE_NO_TITLE);
  setContentView(R.layout.quick_settings_brightness_dialog);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final Window window=getWindow();
  window.setGravity(Gravity.TOP);
  window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
  window.requestFeature(Window.FEATURE_NO_TITLE);
  setContentView(R.layout.quick_settings_brightness_dialog);
  final ImageView icon=(ImageView)findViewById(R.id.brightness_icon);
  final ToggleSlider slider=(ToggleSlider)findViewById(R.id.brightness_slider);
  mBrightnessController=new BrightnessController(this,icon,slider);
}
Program: 198372
Project: 198372
Buggy source:
@Override protected void onStart(){
  super.onStart();
  final ImageView icon=(ImageView)findViewById(R.id.brightness_icon);
  final ToggleSlider slider=(ToggleSlider)findViewById(R.id.brightness_slider);
  mBrightnessController=new BrightnessController(this,icon,slider);
  mBrightnessController.registerCallbacks();
}

Fixed version (ground truth):
@Override protected void onStart(){
  super.onStart();
  mBrightnessController.registerCallbacks();
}
Program: 198373
Project: 198373
Buggy source:
public void reset(){
  super.reset();
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}

Fixed version (ground truth):
public void reset(){
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}
Program: 198374
Project: 198374
Buggy source:
private void updateNotificationViews(NotificationData.Entry entry,StatusBarNotification notification,boolean isHeadsUp){
  final RemoteViews contentView=notification.getNotification().contentView;
  final RemoteViews bigContentView=isHeadsUp ? notification.getNotification().headsUpContentView : notification.getNotification().bigContentView;
  final Notification publicVersion=notification.getNotification().publicVersion;
  final RemoteViews publicContentView=publicVersion != null ? publicVersion.contentView : null;
  contentView.reapply(mContext,entry.expanded,mOnClickHandler);
  if (bigContentView != null && entry.getBigContentView() != null) {
    bigContentView.reapply(mContext,entry.getBigContentView(),mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(mContext,entry.getPublicContentView(),mOnClickHandler);
  }
  final PendingIntent contentIntent=notification.getNotification().contentIntent;
  if (contentIntent != null) {
    final View.OnClickListener listener=makeClicker(contentIntent,notification.getKey(),isHeadsUp);
    entry.row.setOnClickListener(listener);
  }
 else {
    entry.row.setOnClickListener(null);
  }
  entry.row.notifyContentUpdated();
}

Fixed version (ground truth):
private void updateNotificationViews(NotificationData.Entry entry,StatusBarNotification notification,boolean isHeadsUp){
  final RemoteViews contentView=notification.getNotification().contentView;
  final RemoteViews bigContentView=isHeadsUp ? notification.getNotification().headsUpContentView : notification.getNotification().bigContentView;
  final Notification publicVersion=notification.getNotification().publicVersion;
  final RemoteViews publicContentView=publicVersion != null ? publicVersion.contentView : null;
  if (entry.row != null) {
    entry.row.resetHeight();
  }
  contentView.reapply(mContext,entry.expanded,mOnClickHandler);
  if (bigContentView != null && entry.getBigContentView() != null) {
    bigContentView.reapply(mContext,entry.getBigContentView(),mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(mContext,entry.getPublicContentView(),mOnClickHandler);
  }
  final PendingIntent contentIntent=notification.getNotification().contentIntent;
  if (contentIntent != null) {
    final View.OnClickListener listener=makeClicker(contentIntent,notification.getKey(),isHeadsUp);
    entry.row.setOnClickListener(listener);
  }
 else {
    entry.row.setOnClickListener(null);
  }
  entry.row.notifyContentUpdated();
}
Program: 198375
Project: 198375
Buggy source:
/** 
 * @param expansionDisabled whether to prevent notification expansion
 */
public void setExpansionDisabled(boolean expansionDisabled){
  final boolean wasExpanded=isExpanded();
  mExpansionDisabled=expansionDisabled;
  logExpansionEvent(false,wasExpanded);
  notifyHeightChanged();
}

Fixed version (ground truth):
/** 
 * @param expansionDisabled whether to prevent notification expansion
 */
public void setExpansionDisabled(boolean expansionDisabled){
  if (expansionDisabled != mExpansionDisabled) {
    final boolean wasExpanded=isExpanded();
    mExpansionDisabled=expansionDisabled;
    logExpansionEvent(false,wasExpanded);
    if (wasExpanded != isExpanded()) {
      notifyHeightChanged();
    }
  }
}
Program: 198376
Project: 198376
Buggy source:
/** 
 * Set this notification to be expanded by the system.
 * @param expand whether the system wants this notification to be expanded.
 */
public void setSystemExpanded(boolean expand){
  final boolean wasExpanded=isExpanded();
  mIsSystemExpanded=expand;
  notifyHeightChanged();
  logExpansionEvent(false,wasExpanded);
}

Fixed version (ground truth):
/** 
 * Set this notification to be expanded by the system.
 * @param expand whether the system wants this notification to be expanded.
 */
public void setSystemExpanded(boolean expand){
  if (expand != mIsSystemExpanded) {
    final boolean wasExpanded=isExpanded();
    mIsSystemExpanded=expand;
    notifyHeightChanged();
    logExpansionEvent(false,wasExpanded);
  }
}
Program: 198377
Project: 198377
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();
  mMaxExpandHeight=0;
  mWasReset=true;
  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();
  mPrivateLayout.reset();
  resetHeight();
  logExpansionEvent(false,wasExpanded);
}
Program: 198378
Project: 198378
Buggy source:
protected void requestPanelHeightUpdate(){
  float currentMaxPanelHeight=getMaxPanelHeight();
  if ((!mTracking || isTrackingBlocked()) && mHeightAnimator == null && mExpandedHeight > 0 && currentMaxPanelHeight != mExpandedHeight && !mPeekPending && mPeekAnimator == null) {
    setExpandedHeight(currentMaxPanelHeight);
  }
}

Fixed version (ground truth):
protected void requestPanelHeightUpdate(){
  float currentMaxPanelHeight=getMaxPanelHeight();
  if ((!mTracking || isTrackingBlocked()) && mHeightAnimator == null && mExpandedHeight > 0 && currentMaxPanelHeight != mExpandedHeight && !mPeekPending && mPeekAnimator == null && !mTouching) {
    setExpandedHeight(currentMaxPanelHeight);
  }
}
Program: 198379
Project: 198379
Buggy source:
/** 
 * This returns the maximum height of the panel. Children should override this if their desired height is not the full height.
 * @return the default implementation simply returns the maximum height.
 */
protected int getMaxPanelHeight(){
  mMaxPanelHeight=Math.max(mMaxPanelHeight,getHeight());
  return mMaxPanelHeight;
}

Fixed version (ground truth):
/** 
 * This returns the maximum height of the panel. Children should override this if their desired height is not the full height.
 * @return the default implementation simply returns the maximum height.
 */
protected abstract int getMaxPanelHeight();
Program: 198381
Project: 198381
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  if (DEBUG)   logf("String_Node_Str",changed ? "String_Node_Str" : "String_Node_Str",bottom,(int)mExpandedHeight,mMaxPanelHeight);
  super.onLayout(changed,left,top,right,bottom);
  requestPanelHeightUpdate();
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  requestPanelHeightUpdate();
  mHasLayoutedSinceDown=true;
  if (mUpdateFlingOnLayout) {
    abortAnimations();
    fling(mUpdateFlingVelocity,true);
    mUpdateFlingOnLayout=false;
  }
}
Program: 198382
Project: 198382
Buggy source:
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  loadDimens();
  mMaxPanelHeight=-1;
}

Fixed version (ground truth):
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  loadDimens();
}
Program: 198384
Project: 198384
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  boolean intercept=false;
  if (mNotificationPanel.isFullyExpanded() && mStackScrollLayout.getVisibility() == View.VISIBLE && mService.getBarState() == StatusBarState.KEYGUARD && !mService.isBouncerShowing()) {
    intercept=mDragDownHelper.onInterceptTouchEvent(ev);
  }
  if (!intercept) {
    super.onInterceptTouchEvent(ev);
  }
  if (intercept) {
    MotionEvent cancellation=MotionEvent.obtain(ev);
    cancellation.setAction(MotionEvent.ACTION_CANCEL);
    mStackScrollLayout.onInterceptTouchEvent(cancellation);
    cancellation.recycle();
  }
  return intercept;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  boolean intercept=false;
  if (mNotificationPanel.isFullyExpanded() && mStackScrollLayout.getVisibility() == View.VISIBLE && mService.getBarState() == StatusBarState.KEYGUARD && !mService.isBouncerShowing()) {
    intercept=mDragDownHelper.onInterceptTouchEvent(ev);
  }
  if (!intercept) {
    super.onInterceptTouchEvent(ev);
  }
  if (intercept) {
    MotionEvent cancellation=MotionEvent.obtain(ev);
    cancellation.setAction(MotionEvent.ACTION_CANCEL);
    mStackScrollLayout.onInterceptTouchEvent(cancellation);
    mNotificationPanel.onInterceptTouchEvent(cancellation);
    cancellation.recycle();
  }
  return intercept;
}
Program: 198385
Project: 198385
Buggy source:
@Override public void onReset(ExpandableView view){
  mRequestViewResizeAnimationOnLayout=true;
}

Fixed version (ground truth):
@Override public void onReset(ExpandableView view){
  mRequestViewResizeAnimationOnLayout=true;
  mStackScrollAlgorithm.onReset(view);
}
Program: 198386
Project: 198386
Buggy source:
private void updateFirstChildHeightWhileExpanding(ViewGroup hostView){
  mFirstChildWhileExpanding=(ExpandableView)findFirstVisibleChild(hostView);
  if (mFirstChildWhileExpanding != null) {
    if (mExpandedOnStart) {
      mFirstChildMaxHeight=mFirstChildWhileExpanding.getActualHeight();
    }
 else {
      if (!isMaxSizeInitialized(mFirstChildWhileExpanding)) {
        mFirstChildWhileExpanding.addOnLayoutChangeListener(new View.OnLayoutChangeListener(){
          @Override public void onLayoutChange(          View v,          int left,          int top,          int right,          int bottom,          int oldLeft,          int oldTop,          int oldRight,          int oldBottom){
            if (mFirstChildWhileExpanding != null) {
              mFirstChildMaxHeight=getMaxAllowedChildHeight(mFirstChildWhileExpanding);
            }
 else {
              mFirstChildMaxHeight=0;
            }
            v.removeOnLayoutChangeListener(this);
          }
        }
);
      }
 else {
        mFirstChildMaxHeight=getMaxAllowedChildHeight(mFirstChildWhileExpanding);
      }
    }
  }
 else {
    mFirstChildMaxHeight=0;
  }
}

Fixed version (ground truth):
private void updateFirstChildHeightWhileExpanding(ViewGroup hostView){
  mFirstChildWhileExpanding=(ExpandableView)findFirstVisibleChild(hostView);
  if (mFirstChildWhileExpanding != null) {
    if (mExpandedOnStart) {
      mFirstChildMaxHeight=mFirstChildWhileExpanding.getActualHeight();
    }
 else {
      updateFirstChildMaxSizeToMaxHeight();
    }
  }
 else {
    mFirstChildMaxHeight=0;
  }
}
Program: 198387
Project: 198387
Buggy source:
private boolean isMaxSizeInitialized(ExpandableView child){
  if (child instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)child;
    return row.isShowingLayoutLayouted();
  }
  return child == null || child.getWidth() != 0;
}

Fixed version (ground truth):
private boolean isMaxSizeInitialized(ExpandableView child){
  if (child instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)child;
    return row.isMaxExpandHeightInitialized();
  }
  return child == null || child.getWidth() != 0;
}
Program: 198388
Project: 198388
Buggy source:
public void reset(){
  super.reset();
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}

Fixed version (ground truth):
public void reset(){
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}
Program: 198389
Project: 198389
Buggy source:
private void updateNotificationViews(NotificationData.Entry entry,StatusBarNotification notification,boolean isHeadsUp){
  final RemoteViews contentView=notification.getNotification().contentView;
  final RemoteViews bigContentView=isHeadsUp ? notification.getNotification().headsUpContentView : notification.getNotification().bigContentView;
  final Notification publicVersion=notification.getNotification().publicVersion;
  final RemoteViews publicContentView=publicVersion != null ? publicVersion.contentView : null;
  contentView.reapply(mContext,entry.expanded,mOnClickHandler);
  if (bigContentView != null && entry.getBigContentView() != null) {
    bigContentView.reapply(mContext,entry.getBigContentView(),mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(mContext,entry.getPublicContentView(),mOnClickHandler);
  }
  final PendingIntent contentIntent=notification.getNotification().contentIntent;
  if (contentIntent != null) {
    final View.OnClickListener listener=makeClicker(contentIntent,notification.getKey(),isHeadsUp);
    entry.row.setOnClickListener(listener);
  }
 else {
    entry.row.setOnClickListener(null);
  }
  entry.row.notifyContentUpdated();
}

Fixed version (ground truth):
private void updateNotificationViews(NotificationData.Entry entry,StatusBarNotification notification,boolean isHeadsUp){
  final RemoteViews contentView=notification.getNotification().contentView;
  final RemoteViews bigContentView=isHeadsUp ? notification.getNotification().headsUpContentView : notification.getNotification().bigContentView;
  final Notification publicVersion=notification.getNotification().publicVersion;
  final RemoteViews publicContentView=publicVersion != null ? publicVersion.contentView : null;
  if (entry.row != null) {
    entry.row.resetHeight();
  }
  contentView.reapply(mContext,entry.expanded,mOnClickHandler);
  if (bigContentView != null && entry.getBigContentView() != null) {
    bigContentView.reapply(mContext,entry.getBigContentView(),mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(mContext,entry.getPublicContentView(),mOnClickHandler);
  }
  final PendingIntent contentIntent=notification.getNotification().contentIntent;
  if (contentIntent != null) {
    final View.OnClickListener listener=makeClicker(contentIntent,notification.getKey(),isHeadsUp);
    entry.row.setOnClickListener(listener);
  }
 else {
    entry.row.setOnClickListener(null);
  }
  entry.row.notifyContentUpdated();
}
Program: 198390
Project: 198390
Buggy source:
/** 
 * @param expansionDisabled whether to prevent notification expansion
 */
public void setExpansionDisabled(boolean expansionDisabled){
  final boolean wasExpanded=isExpanded();
  mExpansionDisabled=expansionDisabled;
  logExpansionEvent(false,wasExpanded);
  notifyHeightChanged();
}

Fixed version (ground truth):
/** 
 * @param expansionDisabled whether to prevent notification expansion
 */
public void setExpansionDisabled(boolean expansionDisabled){
  if (expansionDisabled != mExpansionDisabled) {
    final boolean wasExpanded=isExpanded();
    mExpansionDisabled=expansionDisabled;
    logExpansionEvent(false,wasExpanded);
    if (wasExpanded != isExpanded()) {
      notifyHeightChanged();
    }
  }
}
Program: 198391
Project: 198391
Buggy source:
/** 
 * Set this notification to be expanded by the system.
 * @param expand whether the system wants this notification to be expanded.
 */
public void setSystemExpanded(boolean expand){
  final boolean wasExpanded=isExpanded();
  mIsSystemExpanded=expand;
  notifyHeightChanged();
  logExpansionEvent(false,wasExpanded);
}

Fixed version (ground truth):
/** 
 * Set this notification to be expanded by the system.
 * @param expand whether the system wants this notification to be expanded.
 */
public void setSystemExpanded(boolean expand){
  if (expand != mIsSystemExpanded) {
    final boolean wasExpanded=isExpanded();
    mIsSystemExpanded=expand;
    notifyHeightChanged();
    logExpansionEvent(false,wasExpanded);
  }
}
Program: 198392
Project: 198392
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();
  mMaxExpandHeight=0;
  mWasReset=true;
  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();
  mPrivateLayout.reset();
  resetHeight();
  logExpansionEvent(false,wasExpanded);
}
Program: 198393
Project: 198393
Buggy source:
protected void requestPanelHeightUpdate(){
  float currentMaxPanelHeight=getMaxPanelHeight();
  if ((!mTracking || isTrackingBlocked()) && mHeightAnimator == null && mExpandedHeight > 0 && currentMaxPanelHeight != mExpandedHeight && !mPeekPending && mPeekAnimator == null) {
    setExpandedHeight(currentMaxPanelHeight);
  }
}

Fixed version (ground truth):
protected void requestPanelHeightUpdate(){
  float currentMaxPanelHeight=getMaxPanelHeight();
  if ((!mTracking || isTrackingBlocked()) && mHeightAnimator == null && mExpandedHeight > 0 && currentMaxPanelHeight != mExpandedHeight && !mPeekPending && mPeekAnimator == null && !mTouching) {
    setExpandedHeight(currentMaxPanelHeight);
  }
}
Program: 198394
Project: 198394
Buggy source:
/** 
 * This returns the maximum height of the panel. Children should override this if their desired height is not the full height.
 * @return the default implementation simply returns the maximum height.
 */
protected int getMaxPanelHeight(){
  mMaxPanelHeight=Math.max(mMaxPanelHeight,getHeight());
  return mMaxPanelHeight;
}

Fixed version (ground truth):
/** 
 * This returns the maximum height of the panel. Children should override this if their desired height is not the full height.
 * @return the default implementation simply returns the maximum height.
 */
protected abstract int getMaxPanelHeight();
Program: 198396
Project: 198396
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  if (DEBUG)   logf("String_Node_Str",changed ? "String_Node_Str" : "String_Node_Str",bottom,(int)mExpandedHeight,mMaxPanelHeight);
  super.onLayout(changed,left,top,right,bottom);
  requestPanelHeightUpdate();
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  requestPanelHeightUpdate();
  mHasLayoutedSinceDown=true;
  if (mUpdateFlingOnLayout) {
    abortAnimations();
    fling(mUpdateFlingVelocity,true);
    mUpdateFlingOnLayout=false;
  }
}
Program: 198397
Project: 198397
Buggy source:
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  loadDimens();
  mMaxPanelHeight=-1;
}

Fixed version (ground truth):
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  loadDimens();
}
Program: 198399
Project: 198399
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  boolean intercept=false;
  if (mNotificationPanel.isFullyExpanded() && mStackScrollLayout.getVisibility() == View.VISIBLE && mService.getBarState() == StatusBarState.KEYGUARD && !mService.isBouncerShowing()) {
    intercept=mDragDownHelper.onInterceptTouchEvent(ev);
  }
  if (!intercept) {
    super.onInterceptTouchEvent(ev);
  }
  if (intercept) {
    MotionEvent cancellation=MotionEvent.obtain(ev);
    cancellation.setAction(MotionEvent.ACTION_CANCEL);
    mStackScrollLayout.onInterceptTouchEvent(cancellation);
    cancellation.recycle();
  }
  return intercept;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  boolean intercept=false;
  if (mNotificationPanel.isFullyExpanded() && mStackScrollLayout.getVisibility() == View.VISIBLE && mService.getBarState() == StatusBarState.KEYGUARD && !mService.isBouncerShowing()) {
    intercept=mDragDownHelper.onInterceptTouchEvent(ev);
  }
  if (!intercept) {
    super.onInterceptTouchEvent(ev);
  }
  if (intercept) {
    MotionEvent cancellation=MotionEvent.obtain(ev);
    cancellation.setAction(MotionEvent.ACTION_CANCEL);
    mStackScrollLayout.onInterceptTouchEvent(cancellation);
    mNotificationPanel.onInterceptTouchEvent(cancellation);
    cancellation.recycle();
  }
  return intercept;
}
Program: 198400
Project: 198400
Buggy source:
@Override public void onReset(ExpandableView view){
  mRequestViewResizeAnimationOnLayout=true;
}

Fixed version (ground truth):
@Override public void onReset(ExpandableView view){
  mRequestViewResizeAnimationOnLayout=true;
  mStackScrollAlgorithm.onReset(view);
}
Program: 198401
Project: 198401
Buggy source:
private void updateFirstChildHeightWhileExpanding(ViewGroup hostView){
  mFirstChildWhileExpanding=(ExpandableView)findFirstVisibleChild(hostView);
  if (mFirstChildWhileExpanding != null) {
    if (mExpandedOnStart) {
      mFirstChildMaxHeight=mFirstChildWhileExpanding.getActualHeight();
    }
 else {
      if (!isMaxSizeInitialized(mFirstChildWhileExpanding)) {
        mFirstChildWhileExpanding.addOnLayoutChangeListener(new View.OnLayoutChangeListener(){
          @Override public void onLayoutChange(          View v,          int left,          int top,          int right,          int bottom,          int oldLeft,          int oldTop,          int oldRight,          int oldBottom){
            if (mFirstChildWhileExpanding != null) {
              mFirstChildMaxHeight=getMaxAllowedChildHeight(mFirstChildWhileExpanding);
            }
 else {
              mFirstChildMaxHeight=0;
            }
            v.removeOnLayoutChangeListener(this);
          }
        }
);
      }
 else {
        mFirstChildMaxHeight=getMaxAllowedChildHeight(mFirstChildWhileExpanding);
      }
    }
  }
 else {
    mFirstChildMaxHeight=0;
  }
}

Fixed version (ground truth):
private void updateFirstChildHeightWhileExpanding(ViewGroup hostView){
  mFirstChildWhileExpanding=(ExpandableView)findFirstVisibleChild(hostView);
  if (mFirstChildWhileExpanding != null) {
    if (mExpandedOnStart) {
      mFirstChildMaxHeight=mFirstChildWhileExpanding.getActualHeight();
    }
 else {
      updateFirstChildMaxSizeToMaxHeight();
    }
  }
 else {
    mFirstChildMaxHeight=0;
  }
}
Program: 198402
Project: 198402
Buggy source:
private boolean isMaxSizeInitialized(ExpandableView child){
  if (child instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)child;
    return row.isShowingLayoutLayouted();
  }
  return child == null || child.getWidth() != 0;
}

Fixed version (ground truth):
private boolean isMaxSizeInitialized(ExpandableView child){
  if (child instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)child;
    return row.isMaxExpandHeightInitialized();
  }
  return child == null || child.getWidth() != 0;
}
Program: 198403
Project: 198403
Buggy source:
public void reset(){
  super.reset();
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}

Fixed version (ground truth):
public void reset(){
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}
Program: 198404
Project: 198404
Buggy source:
private void updateNotificationViews(NotificationData.Entry entry,StatusBarNotification notification,boolean isHeadsUp){
  final RemoteViews contentView=notification.getNotification().contentView;
  final RemoteViews bigContentView=isHeadsUp ? notification.getNotification().headsUpContentView : notification.getNotification().bigContentView;
  final Notification publicVersion=notification.getNotification().publicVersion;
  final RemoteViews publicContentView=publicVersion != null ? publicVersion.contentView : null;
  contentView.reapply(mContext,entry.expanded,mOnClickHandler);
  if (bigContentView != null && entry.getBigContentView() != null) {
    bigContentView.reapply(mContext,entry.getBigContentView(),mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(mContext,entry.getPublicContentView(),mOnClickHandler);
  }
  final PendingIntent contentIntent=notification.getNotification().contentIntent;
  if (contentIntent != null) {
    final View.OnClickListener listener=makeClicker(contentIntent,notification.getKey(),isHeadsUp);
    entry.row.setOnClickListener(listener);
  }
 else {
    entry.row.setOnClickListener(null);
  }
  entry.row.notifyContentUpdated();
}

Fixed version (ground truth):
private void updateNotificationViews(NotificationData.Entry entry,StatusBarNotification notification,boolean isHeadsUp){
  final RemoteViews contentView=notification.getNotification().contentView;
  final RemoteViews bigContentView=isHeadsUp ? notification.getNotification().headsUpContentView : notification.getNotification().bigContentView;
  final Notification publicVersion=notification.getNotification().publicVersion;
  final RemoteViews publicContentView=publicVersion != null ? publicVersion.contentView : null;
  if (entry.row != null) {
    entry.row.resetHeight();
  }
  contentView.reapply(mContext,entry.expanded,mOnClickHandler);
  if (bigContentView != null && entry.getBigContentView() != null) {
    bigContentView.reapply(mContext,entry.getBigContentView(),mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(mContext,entry.getPublicContentView(),mOnClickHandler);
  }
  final PendingIntent contentIntent=notification.getNotification().contentIntent;
  if (contentIntent != null) {
    final View.OnClickListener listener=makeClicker(contentIntent,notification.getKey(),isHeadsUp);
    entry.row.setOnClickListener(listener);
  }
 else {
    entry.row.setOnClickListener(null);
  }
  entry.row.notifyContentUpdated();
}
Program: 198405
Project: 198405
Buggy source:
/** 
 * @param expansionDisabled whether to prevent notification expansion
 */
public void setExpansionDisabled(boolean expansionDisabled){
  final boolean wasExpanded=isExpanded();
  mExpansionDisabled=expansionDisabled;
  logExpansionEvent(false,wasExpanded);
  notifyHeightChanged();
}

Fixed version (ground truth):
/** 
 * @param expansionDisabled whether to prevent notification expansion
 */
public void setExpansionDisabled(boolean expansionDisabled){
  if (expansionDisabled != mExpansionDisabled) {
    final boolean wasExpanded=isExpanded();
    mExpansionDisabled=expansionDisabled;
    logExpansionEvent(false,wasExpanded);
    if (wasExpanded != isExpanded()) {
      notifyHeightChanged();
    }
  }
}
Program: 198406
Project: 198406
Buggy source:
/** 
 * Set this notification to be expanded by the system.
 * @param expand whether the system wants this notification to be expanded.
 */
public void setSystemExpanded(boolean expand){
  final boolean wasExpanded=isExpanded();
  mIsSystemExpanded=expand;
  notifyHeightChanged();
  logExpansionEvent(false,wasExpanded);
}

Fixed version (ground truth):
/** 
 * Set this notification to be expanded by the system.
 * @param expand whether the system wants this notification to be expanded.
 */
public void setSystemExpanded(boolean expand){
  if (expand != mIsSystemExpanded) {
    final boolean wasExpanded=isExpanded();
    mIsSystemExpanded=expand;
    notifyHeightChanged();
    logExpansionEvent(false,wasExpanded);
  }
}
Program: 198407
Project: 198407
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();
  mMaxExpandHeight=0;
  mWasReset=true;
  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();
  mPrivateLayout.reset();
  resetHeight();
  logExpansionEvent(false,wasExpanded);
}
Program: 198408
Project: 198408
Buggy source:
protected void requestPanelHeightUpdate(){
  float currentMaxPanelHeight=getMaxPanelHeight();
  if ((!mTracking || isTrackingBlocked()) && mHeightAnimator == null && mExpandedHeight > 0 && currentMaxPanelHeight != mExpandedHeight && !mPeekPending && mPeekAnimator == null) {
    setExpandedHeight(currentMaxPanelHeight);
  }
}

Fixed version (ground truth):
protected void requestPanelHeightUpdate(){
  float currentMaxPanelHeight=getMaxPanelHeight();
  if ((!mTracking || isTrackingBlocked()) && mHeightAnimator == null && mExpandedHeight > 0 && currentMaxPanelHeight != mExpandedHeight && !mPeekPending && mPeekAnimator == null && !mTouching) {
    setExpandedHeight(currentMaxPanelHeight);
  }
}
Program: 198409
Project: 198409
Buggy source:
/** 
 * This returns the maximum height of the panel. Children should override this if their desired height is not the full height.
 * @return the default implementation simply returns the maximum height.
 */
protected int getMaxPanelHeight(){
  mMaxPanelHeight=Math.max(mMaxPanelHeight,getHeight());
  return mMaxPanelHeight;
}

Fixed version (ground truth):
/** 
 * This returns the maximum height of the panel. Children should override this if their desired height is not the full height.
 * @return the default implementation simply returns the maximum height.
 */
protected abstract int getMaxPanelHeight();
Program: 198411
Project: 198411
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  if (DEBUG)   logf("String_Node_Str",changed ? "String_Node_Str" : "String_Node_Str",bottom,(int)mExpandedHeight,mMaxPanelHeight);
  super.onLayout(changed,left,top,right,bottom);
  requestPanelHeightUpdate();
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  requestPanelHeightUpdate();
  mHasLayoutedSinceDown=true;
  if (mUpdateFlingOnLayout) {
    abortAnimations();
    fling(mUpdateFlingVelocity,true);
    mUpdateFlingOnLayout=false;
  }
}
Program: 198412
Project: 198412
Buggy source:
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  loadDimens();
  mMaxPanelHeight=-1;
}

Fixed version (ground truth):
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  loadDimens();
}
Program: 198414
Project: 198414
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  boolean intercept=false;
  if (mNotificationPanel.isFullyExpanded() && mStackScrollLayout.getVisibility() == View.VISIBLE && mService.getBarState() == StatusBarState.KEYGUARD && !mService.isBouncerShowing()) {
    intercept=mDragDownHelper.onInterceptTouchEvent(ev);
  }
  if (!intercept) {
    super.onInterceptTouchEvent(ev);
  }
  if (intercept) {
    MotionEvent cancellation=MotionEvent.obtain(ev);
    cancellation.setAction(MotionEvent.ACTION_CANCEL);
    mStackScrollLayout.onInterceptTouchEvent(cancellation);
    cancellation.recycle();
  }
  return intercept;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  boolean intercept=false;
  if (mNotificationPanel.isFullyExpanded() && mStackScrollLayout.getVisibility() == View.VISIBLE && mService.getBarState() == StatusBarState.KEYGUARD && !mService.isBouncerShowing()) {
    intercept=mDragDownHelper.onInterceptTouchEvent(ev);
  }
  if (!intercept) {
    super.onInterceptTouchEvent(ev);
  }
  if (intercept) {
    MotionEvent cancellation=MotionEvent.obtain(ev);
    cancellation.setAction(MotionEvent.ACTION_CANCEL);
    mStackScrollLayout.onInterceptTouchEvent(cancellation);
    mNotificationPanel.onInterceptTouchEvent(cancellation);
    cancellation.recycle();
  }
  return intercept;
}
Program: 198415
Project: 198415
Buggy source:
@Override public void onReset(ExpandableView view){
  mRequestViewResizeAnimationOnLayout=true;
}

Fixed version (ground truth):
@Override public void onReset(ExpandableView view){
  mRequestViewResizeAnimationOnLayout=true;
  mStackScrollAlgorithm.onReset(view);
}
Program: 198416
Project: 198416
Buggy source:
private void updateFirstChildHeightWhileExpanding(ViewGroup hostView){
  mFirstChildWhileExpanding=(ExpandableView)findFirstVisibleChild(hostView);
  if (mFirstChildWhileExpanding != null) {
    if (mExpandedOnStart) {
      mFirstChildMaxHeight=mFirstChildWhileExpanding.getActualHeight();
    }
 else {
      if (!isMaxSizeInitialized(mFirstChildWhileExpanding)) {
        mFirstChildWhileExpanding.addOnLayoutChangeListener(new View.OnLayoutChangeListener(){
          @Override public void onLayoutChange(          View v,          int left,          int top,          int right,          int bottom,          int oldLeft,          int oldTop,          int oldRight,          int oldBottom){
            if (mFirstChildWhileExpanding != null) {
              mFirstChildMaxHeight=getMaxAllowedChildHeight(mFirstChildWhileExpanding);
            }
 else {
              mFirstChildMaxHeight=0;
            }
            v.removeOnLayoutChangeListener(this);
          }
        }
);
      }
 else {
        mFirstChildMaxHeight=getMaxAllowedChildHeight(mFirstChildWhileExpanding);
      }
    }
  }
 else {
    mFirstChildMaxHeight=0;
  }
}

Fixed version (ground truth):
private void updateFirstChildHeightWhileExpanding(ViewGroup hostView){
  mFirstChildWhileExpanding=(ExpandableView)findFirstVisibleChild(hostView);
  if (mFirstChildWhileExpanding != null) {
    if (mExpandedOnStart) {
      mFirstChildMaxHeight=mFirstChildWhileExpanding.getActualHeight();
    }
 else {
      updateFirstChildMaxSizeToMaxHeight();
    }
  }
 else {
    mFirstChildMaxHeight=0;
  }
}