Program: 83659
Project: 83659
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  final boolean workspaceLocked=mLauncher.isWorkspaceLocked();
  final boolean allAppsVisible=mLauncher.isAllAppsVisible();
  if (workspaceLocked || allAppsVisible) {
    return false;
  }
  final int action=ev.getAction();
  if ((action == MotionEvent.ACTION_MOVE) && (mTouchState != TOUCH_STATE_REST)) {
    return true;
  }
  if (mVelocityTracker == null) {
    mVelocityTracker=VelocityTracker.obtain();
  }
  mVelocityTracker.addMovement(ev);
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_MOVE:
{
      final int pointerIndex=ev.findPointerIndex(mActivePointerId);
      final float x=ev.getX(pointerIndex);
      final float y=ev.getY(pointerIndex);
      final int xDiff=(int)Math.abs(x - mLastMotionX);
      final int yDiff=(int)Math.abs(y - mLastMotionY);
      final int touchSlop=mTouchSlop;
      boolean xPaged=xDiff > mPagingTouchSlop;
      boolean xMoved=xDiff > touchSlop;
      boolean yMoved=yDiff > touchSlop;
      if (xMoved || yMoved) {
        if (xPaged) {
          mTouchState=TOUCH_STATE_SCROLLING;
          mLastMotionX=x;
          enableChildrenCache(0,getChildCount());
        }
        if (mAllowLongPress) {
          mAllowLongPress=false;
          final View currentScreen=getChildAt(mCurrentScreen);
          currentScreen.cancelLongPress();
        }
      }
      break;
    }
case MotionEvent.ACTION_DOWN:
{
    final float x=ev.getX();
    final float y=ev.getY();
    mLastMotionX=x;
    mLastMotionY=y;
    mActivePointerId=ev.getPointerId(0);
    mAllowLongPress=true;
    mTouchState=mScroller.isFinished() ? TOUCH_STATE_REST : TOUCH_STATE_SCROLLING;
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
if (mTouchState != TOUCH_STATE_SCROLLING) {
  final CellLayout currentScreen=(CellLayout)getChildAt(mCurrentScreen);
  if (!currentScreen.lastDownOnOccupiedCell()) {
    getLocationOnScreen(mTempCell);
    final int pointerIndex=ev.findPointerIndex(mActivePointerId);
    mWallpaperManager.sendWallpaperCommand(getWindowToken(),"String_Node_Str",mTempCell[0] + (int)ev.getX(pointerIndex),mTempCell[1] + (int)ev.getY(pointerIndex),0,null);
  }
}
clearChildrenCache();
mTouchState=TOUCH_STATE_REST;
mActivePointerId=INVALID_POINTER;
mAllowLongPress=false;
if (mVelocityTracker != null) {
mVelocityTracker.recycle();
mVelocityTracker=null;
}
break;
case MotionEvent.ACTION_POINTER_UP:
onSecondaryPointerUp(ev);
break;
}
return mTouchState != TOUCH_STATE_REST;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  final boolean workspaceLocked=mLauncher.isWorkspaceLocked();
  final boolean allAppsVisible=mLauncher.isAllAppsVisible();
  if (workspaceLocked || allAppsVisible) {
    return false;
  }
  final int action=ev.getAction();
  if ((action == MotionEvent.ACTION_MOVE) && (mTouchState != TOUCH_STATE_REST)) {
    return true;
  }
  if (mVelocityTracker == null) {
    mVelocityTracker=VelocityTracker.obtain();
  }
  mVelocityTracker.addMovement(ev);
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_MOVE:
{
      final int pointerIndex=ev.findPointerIndex(mActivePointerId);
      final float x=ev.getX(pointerIndex);
      final float y=ev.getY(pointerIndex);
      final int xDiff=(int)Math.abs(x - mLastMotionX);
      final int yDiff=(int)Math.abs(y - mLastMotionY);
      final int touchSlop=mTouchSlop;
      boolean xPaged=xDiff > mPagingTouchSlop;
      boolean xMoved=xDiff > touchSlop;
      boolean yMoved=yDiff > touchSlop;
      if (xMoved || yMoved) {
        if (xPaged) {
          mTouchState=TOUCH_STATE_SCROLLING;
          mLastMotionX=x;
          enableChildrenCache(mCurrentScreen - 1,mCurrentScreen + 1);
        }
        if (mAllowLongPress) {
          mAllowLongPress=false;
          final View currentScreen=getChildAt(mCurrentScreen);
          currentScreen.cancelLongPress();
        }
      }
      break;
    }
case MotionEvent.ACTION_DOWN:
{
    final float x=ev.getX();
    final float y=ev.getY();
    mLastMotionX=x;
    mLastMotionY=y;
    mActivePointerId=ev.getPointerId(0);
    mAllowLongPress=true;
    mTouchState=mScroller.isFinished() ? TOUCH_STATE_REST : TOUCH_STATE_SCROLLING;
    break;
  }
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
if (mTouchState != TOUCH_STATE_SCROLLING) {
  final CellLayout currentScreen=(CellLayout)getChildAt(mCurrentScreen);
  if (!currentScreen.lastDownOnOccupiedCell()) {
    getLocationOnScreen(mTempCell);
    final int pointerIndex=ev.findPointerIndex(mActivePointerId);
    mWallpaperManager.sendWallpaperCommand(getWindowToken(),"String_Node_Str",mTempCell[0] + (int)ev.getX(pointerIndex),mTempCell[1] + (int)ev.getY(pointerIndex),0,null);
  }
}
clearChildrenCache();
mTouchState=TOUCH_STATE_REST;
mActivePointerId=INVALID_POINTER;
mAllowLongPress=false;
if (mVelocityTracker != null) {
mVelocityTracker.recycle();
mVelocityTracker=null;
}
break;
case MotionEvent.ACTION_POINTER_UP:
onSecondaryPointerUp(ev);
break;
}
return mTouchState != TOUCH_STATE_REST;
}