Program: 196178
Project: 196178
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent event){
  if (mInstantExpanding) {
    return false;
  }
  int pointerIndex=event.findPointerIndex(mTrackingPointer);
  if (pointerIndex < 0) {
    pointerIndex=0;
    mTrackingPointer=event.getPointerId(pointerIndex);
  }
  final float x=event.getX(pointerIndex);
  final float y=event.getY(pointerIndex);
  boolean scrolledToBottom=isScrolledToBottom();
switch (event.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
    mStatusBar.userActivity();
  if (mHeightAnimator != null && !mHintAnimationRunning || mPeekPending || mPeekAnimator != null) {
    cancelHeightAnimator();
    cancelPeek();
    mTouchSlopExceeded=true;
    return true;
  }
mInitialTouchY=y;
mInitialTouchX=x;
mTouchSlopExceeded=false;
mJustPeeked=false;
mPanelClosedOnDown=mExpandedHeight == 0.0f;
mHasLayoutedSinceDown=false;
mUpdateFlingOnLayout=false;
mTouchAboveFalsingThreshold=false;
initVelocityTracker();
trackMovement(event);
break;
case MotionEvent.ACTION_POINTER_UP:
final int upPointer=event.getPointerId(event.getActionIndex());
if (mTrackingPointer == upPointer) {
final int newIndex=event.getPointerId(0) != upPointer ? 0 : 1;
mTrackingPointer=event.getPointerId(newIndex);
mInitialTouchX=event.getX(newIndex);
mInitialTouchY=event.getY(newIndex);
}
break;
case MotionEvent.ACTION_MOVE:
final float h=y - mInitialTouchY;
trackMovement(event);
if (scrolledToBottom) {
if (h < -mTouchSlop && h < -Math.abs(x - mInitialTouchX)) {
cancelHeightAnimator();
mInitialOffsetOnTouch=mExpandedHeight;
mInitialTouchY=y;
mInitialTouchX=x;
mTracking=true;
mTouchSlopExceeded=true;
onTrackingStarted();
return true;
}
}
break;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
break;
}
return false;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent event){
  if (mInstantExpanding) {
    return false;
  }
  int pointerIndex=event.findPointerIndex(mTrackingPointer);
  if (pointerIndex < 0) {
    pointerIndex=0;
    mTrackingPointer=event.getPointerId(pointerIndex);
  }
  final float x=event.getX(pointerIndex);
  final float y=event.getY(pointerIndex);
  boolean scrolledToBottom=isScrolledToBottom();
switch (event.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
    mStatusBar.userActivity();
  if (mHeightAnimator != null && !mHintAnimationRunning || mPeekPending || mPeekAnimator != null) {
    cancelHeightAnimator();
    cancelPeek();
    mTouchSlopExceeded=true;
    return true;
  }
mInitialTouchY=y;
mInitialTouchX=x;
mTouchStartedInEmptyArea=!isInContentBounds(x,y);
mTouchSlopExceeded=false;
mJustPeeked=false;
mPanelClosedOnDown=mExpandedHeight == 0.0f;
mHasLayoutedSinceDown=false;
mUpdateFlingOnLayout=false;
mTouchAboveFalsingThreshold=false;
initVelocityTracker();
trackMovement(event);
break;
case MotionEvent.ACTION_POINTER_UP:
final int upPointer=event.getPointerId(event.getActionIndex());
if (mTrackingPointer == upPointer) {
final int newIndex=event.getPointerId(0) != upPointer ? 0 : 1;
mTrackingPointer=event.getPointerId(newIndex);
mInitialTouchX=event.getX(newIndex);
mInitialTouchY=event.getY(newIndex);
}
break;
case MotionEvent.ACTION_MOVE:
final float h=y - mInitialTouchY;
trackMovement(event);
if (scrolledToBottom || mTouchStartedInEmptyArea) {
if (h < -mTouchSlop && h < -Math.abs(x - mInitialTouchX)) {
cancelHeightAnimator();
mInitialOffsetOnTouch=mExpandedHeight;
mInitialTouchY=y;
mInitialTouchX=x;
mTracking=true;
mTouchSlopExceeded=true;
onTrackingStarted();
return true;
}
}
break;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
break;
}
return false;
}