Program: 88296
Project: 88296
Buggy source:
@Override public boolean onTouchEvent(MotionEvent me){
  final int pointerCount=me.getPointerCount();
  final int action=me.getAction();
  boolean result=false;
  final long now=me.getEventTime();
  if (pointerCount > 1 && mOldPointerCount > 1) {
    return true;
  }
  if (action == MotionEvent.ACTION_DOWN)   mSwipeTracker.clear();
  mSwipeTracker.addMovement(me);
  if (mAbortKey && action != MotionEvent.ACTION_DOWN && action != MotionEvent.ACTION_CANCEL) {
    return true;
  }
  mCancelGestureDetector=(pointerCount > 1);
  if (mGestureDetector.onTouchEvent(me)) {
    showPreview(NOT_A_KEY);
    mHandler.cancelKeyTimers();
    return true;
  }
  if (mMiniKeyboardOnScreen && action != MotionEvent.ACTION_CANCEL) {
    return true;
  }
  if (mHandler.isInKeyRepeat()) {
    if (pointerCount == 1 && action == MotionEvent.ACTION_MOVE) {
      return true;
    }
 else {
      mHandler.cancelKeyRepeatTimer();
    }
  }
  if (pointerCount != mOldPointerCount) {
    if (pointerCount == 1) {
      MotionEvent down=MotionEvent.obtain(now,now,MotionEvent.ACTION_DOWN,me.getX(),me.getY(),me.getMetaState());
      result=onModifiedTouchEvent(down);
      down.recycle();
      if (action == MotionEvent.ACTION_UP) {
        result=onModifiedTouchEvent(me);
      }
    }
 else {
      MotionEvent up=MotionEvent.obtain(now,now,MotionEvent.ACTION_UP,mOldPointerX,mOldPointerY,me.getMetaState());
      result=onModifiedTouchEvent(up);
      up.recycle();
    }
    mOldPointerCount=pointerCount;
  }
 else {
    if (pointerCount == 1) {
      result=onModifiedTouchEvent(me);
      mOldPointerX=me.getX();
      mOldPointerY=me.getY();
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent me){
  final int pointerCount=me.getPointerCount();
  final int action=me.getAction();
  boolean result=false;
  final long now=me.getEventTime();
  if (pointerCount > 1 && mOldPointerCount > 1) {
    return true;
  }
  if (action == MotionEvent.ACTION_DOWN)   mSwipeTracker.clear();
  mSwipeTracker.addMovement(me);
  if (mAbortKey && action != MotionEvent.ACTION_DOWN && action != MotionEvent.ACTION_CANCEL) {
    return true;
  }
  mCancelGestureDetector=(pointerCount > 1);
  if (mGestureDetector.onTouchEvent(me)) {
    showPreview(NOT_A_KEY);
    mHandler.cancelKeyTimers();
    return true;
  }
  if (mMiniKeyboardOnScreen && action != MotionEvent.ACTION_CANCEL) {
    return true;
  }
  if (mHandler.isInKeyRepeat()) {
    if (pointerCount > 1) {
      mHandler.cancelKeyRepeatTimer();
    }
 else     if (action == MotionEvent.ACTION_MOVE) {
      return true;
    }
  }
  if (pointerCount != mOldPointerCount) {
    if (pointerCount == 1) {
      MotionEvent down=MotionEvent.obtain(now,now,MotionEvent.ACTION_DOWN,me.getX(),me.getY(),me.getMetaState());
      result=onModifiedTouchEvent(down);
      down.recycle();
      if (action == MotionEvent.ACTION_UP) {
        result=onModifiedTouchEvent(me);
      }
    }
 else {
      MotionEvent up=MotionEvent.obtain(now,now,MotionEvent.ACTION_UP,mOldPointerX,mOldPointerY,me.getMetaState());
      result=onModifiedTouchEvent(up);
      up.recycle();
    }
    mOldPointerCount=pointerCount;
  }
 else {
    if (pointerCount == 1) {
      result=onModifiedTouchEvent(me);
      mOldPointerX=me.getX();
      mOldPointerY=me.getY();
    }
  }
  return result;
}