Program: 45627
Project: 45627
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  if (!isVisible()) {
    return true;
  }
  if (mLocks != 0) {
    return true;
  }
  super.onTouchEvent(ev);
  int x=(int)ev.getX();
  int y=(int)ev.getY();
  int action=ev.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
    if (x < 60 && y > 700) {
    }
  if (y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length - 1]) {
    mTouchTracking=TRACKING_HOME;
  }
 else {
    mTouchTracking=TRACKING_FLING;
    mMotionDownRawX=(int)ev.getRawX();
    mMotionDownRawY=(int)ev.getRawY();
    if (mRotateMove) {
      mRollo.mState.newPositionX=ev.getRawY() / mDefines.SCREEN_WIDTH_PX;
    }
 else {
      mRollo.mState.newPositionX=ev.getRawX() / mDefines.SCREEN_WIDTH_PX;
    }
    mRollo.mState.newTouchDown=1;
    if (!mRollo.checkClickOK()) {
      mRollo.clearSelectedIcon();
    }
 else {
      mDownIconIndex=mCurrentIconIndex=mRollo.selectIcon(x,y,mRollo.mMessageProc.mPosX);
      if (mDownIconIndex < 0) {
        cancelLongPress();
      }
    }
    mRollo.mState.save();
    mRollo.move();
    mVelocity=VelocityTracker.obtain();
    mVelocity.addMovement(ev);
    mStartedScrolling=false;
  }
break;
case MotionEvent.ACTION_MOVE:
case MotionEvent.ACTION_OUTSIDE:
if (mTouchTracking == TRACKING_HOME) {
}
 else {
int rawX=(int)ev.getRawX();
int rawY=(int)ev.getRawY();
int slop;
if (mRotateMove) {
  slop=Math.abs(rawY - mMotionDownRawY);
}
 else {
  slop=Math.abs(rawX - mMotionDownRawX);
}
if (!mStartedScrolling && slop < mSlop) {
  mCurrentIconIndex=mRollo.chooseTappedIcon(x,y,mRollo.mMessageProc.mPosX);
  if (mDownIconIndex != mCurrentIconIndex) {
    cancelLongPress();
    mCurrentIconIndex=-1;
  }
}
 else {
  if (!mStartedScrolling) {
    cancelLongPress();
    mCurrentIconIndex=-1;
  }
  if (mRotateMove) {
    mRollo.mState.newPositionX=ev.getRawY() / mDefines.SCREEN_WIDTH_PX;
  }
 else {
    mRollo.mState.newPositionX=ev.getRawX() / mDefines.SCREEN_WIDTH_PX;
  }
  mRollo.mState.newTouchDown=1;
  mRollo.move();
  mStartedScrolling=true;
  mRollo.clearSelectedIcon();
  mVelocity.addMovement(ev);
  mRollo.mState.save();
}
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
if (mTouchTracking == TRACKING_HOME) {
if (action == MotionEvent.ACTION_UP) {
if (y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length - 1]) {
mLauncher.closeAllApps(true);
}
}
}
 else {
mRollo.mState.newTouchDown=0;
if (mRotateMove) {
mRollo.mState.newPositionX=ev.getRawY() / mDefines.SCREEN_WIDTH_PX;
}
 else {
mRollo.mState.newPositionX=ev.getRawX() / mDefines.SCREEN_WIDTH_PX;
}
mVelocity.computeCurrentVelocity(1000,mMaxFlingVelocity);
if (mRotateMove) {
mRollo.mState.flingVelocityX=mVelocity.getYVelocity() / mDefines.SCREEN_WIDTH_PX;
}
 else {
mRollo.mState.flingVelocityX=mVelocity.getXVelocity() / mDefines.SCREEN_WIDTH_PX;
}
mRollo.clearSelectedIcon();
mRollo.mState.save();
mRollo.fling();
if (mVelocity != null) {
mVelocity.recycle();
mVelocity=null;
}
break;
}
}
return true;
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  if (!isVisible()) {
    return true;
  }
  if (mLocks != 0) {
    return true;
  }
  super.onTouchEvent(ev);
  int x=(int)ev.getX();
  int y=(int)ev.getY();
  int action=ev.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
    if (x < 60 && y > 700) {
    }
  if (y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length - 1]) {
    mTouchTracking=TRACKING_HOME;
  }
 else {
    mTouchTracking=TRACKING_FLING;
    mMotionDownRawX=(int)ev.getRawX();
    mMotionDownRawY=(int)ev.getRawY();
    if (mRotateMove) {
      mRollo.mState.newPositionX=ev.getRawY() / mDefines.SCREEN_WIDTH_PX;
    }
 else {
      mRollo.mState.newPositionX=ev.getRawX() / mDefines.SCREEN_WIDTH_PX;
    }
    mRollo.mState.newTouchDown=1;
    if (!mRollo.checkClickOK()) {
      mRollo.clearSelectedIcon();
    }
 else {
      mDownIconIndex=mCurrentIconIndex=mRollo.selectIcon(x,y,mRollo.mMessageProc.mPosX);
      if (mDownIconIndex < 0) {
        cancelLongPress();
      }
    }
    mRollo.mState.save();
    mRollo.move();
    mVelocity=VelocityTracker.obtain();
    mVelocity.addMovement(ev);
    mStartedScrolling=false;
  }
break;
case MotionEvent.ACTION_MOVE:
case MotionEvent.ACTION_OUTSIDE:
if (mTouchTracking == TRACKING_HOME) {
}
 else if (mTouchTracking == TRACKING_FLING) {
int rawX=(int)ev.getRawX();
int rawY=(int)ev.getRawY();
int slop;
if (mRotateMove) {
  slop=Math.abs(rawY - mMotionDownRawY);
}
 else {
  slop=Math.abs(rawX - mMotionDownRawX);
}
if (!mStartedScrolling && slop < mSlop) {
  mCurrentIconIndex=mRollo.chooseTappedIcon(x,y,mRollo.mMessageProc.mPosX);
  if (mDownIconIndex != mCurrentIconIndex) {
    cancelLongPress();
    mCurrentIconIndex=-1;
  }
}
 else {
  if (!mStartedScrolling) {
    cancelLongPress();
    mCurrentIconIndex=-1;
  }
  if (mRotateMove) {
    mRollo.mState.newPositionX=ev.getRawY() / mDefines.SCREEN_WIDTH_PX;
  }
 else {
    mRollo.mState.newPositionX=ev.getRawX() / mDefines.SCREEN_WIDTH_PX;
  }
  mRollo.mState.newTouchDown=1;
  mRollo.move();
  mStartedScrolling=true;
  mRollo.clearSelectedIcon();
  mVelocity.addMovement(ev);
  mRollo.mState.save();
}
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
if (mTouchTracking == TRACKING_HOME) {
if (action == MotionEvent.ACTION_UP) {
if (y > mRollo.mTouchYBorders[mRollo.mTouchYBorders.length - 1]) {
mLauncher.closeAllApps(true);
}
}
}
 else if (mTouchTracking == TRACKING_FLING) {
mRollo.mState.newTouchDown=0;
if (mRotateMove) {
mRollo.mState.newPositionX=ev.getRawY() / mDefines.SCREEN_WIDTH_PX;
}
 else {
mRollo.mState.newPositionX=ev.getRawX() / mDefines.SCREEN_WIDTH_PX;
}
mVelocity.computeCurrentVelocity(1000,mMaxFlingVelocity);
if (mRotateMove) {
mRollo.mState.flingVelocityX=mVelocity.getYVelocity() / mDefines.SCREEN_WIDTH_PX;
}
 else {
mRollo.mState.flingVelocityX=mVelocity.getXVelocity() / mDefines.SCREEN_WIDTH_PX;
}
mRollo.clearSelectedIcon();
mRollo.mState.save();
mRollo.fling();
if (mVelocity != null) {
mVelocity.recycle();
mVelocity=null;
}
}
mTouchTracking=TRACKING_NONE;
break;
}
return true;
}