Program: 193592
Project: 193592
Buggy source:
@Override public void onInputEvent(InputEvent event){
  if (!(event instanceof MotionEvent) || (event.getSource() & InputDevice.SOURCE_CLASS_POINTER) == 0) {
    return;
  }
  final MotionEvent motionEvent=(MotionEvent)event;
  boolean handled=false;
  try {
    if (mDragEnded) {
      handled=true;
      return;
    }
    final float newX=motionEvent.getRawX();
    final float newY=motionEvent.getRawY();
switch (motionEvent.getAction()) {
case MotionEvent.ACTION_DOWN:
{
        if (DEBUG_TASK_POSITIONING) {
          Slog.w(TAG,"String_Node_Str" + newX + "String_Node_Str"+ newY+ "String_Node_Str");
        }
      }
    break;
case MotionEvent.ACTION_MOVE:
{
    if (DEBUG_TASK_POSITIONING) {
      Slog.w(TAG,"String_Node_Str" + newX + "String_Node_Str"+ newY+ "String_Node_Str");
    }
synchronized (mService.mWindowMap) {
      mDragEnded=notifyMoveLocked(newX,newY);
    }
    Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER,"String_Node_Str");
    try {
      mService.mActivityManager.resizeTask(mTask.mTaskId,mWindowDragBounds,RESIZE_MODE_USER);
    }
 catch (    RemoteException e) {
    }
    Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);
  }
break;
case MotionEvent.ACTION_UP:
{
if (DEBUG_TASK_POSITIONING) {
  Slog.w(TAG,"String_Node_Str" + newX + "String_Node_Str"+ newY+ "String_Node_Str");
}
mDragEnded=true;
}
break;
case MotionEvent.ACTION_CANCEL:
{
if (DEBUG_TASK_POSITIONING) {
Slog.w(TAG,"String_Node_Str" + newX + "String_Node_Str"+ newY+ "String_Node_Str");
}
mDragEnded=true;
}
break;
}
if (mDragEnded) {
synchronized (mService.mWindowMap) {
endDragLocked();
}
try {
if (mResizing) {
mService.mActivityManager.resizeTask(mTask.mTaskId,mWindowDragBounds,RESIZE_MODE_USER_FORCED);
}
if (mCurrentDimSide != CTRL_NONE) {
final int createMode=mCurrentDimSide == CTRL_LEFT ? DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT : DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT;
mService.mActivityManager.moveTaskToDockedStack(mTask.mTaskId,createMode,true);
}
}
 catch (RemoteException e) {
}
mService.mH.sendEmptyMessage(H.FINISH_TASK_POSITIONING);
}
handled=true;
}
 catch (Exception e) {
Slog.e(TAG,"String_Node_Str",e);
}
 finally {
finishInputEvent(event,handled);
}
}

Fixed version (ground truth):
@Override public void onInputEvent(InputEvent event){
  if (!(event instanceof MotionEvent) || (event.getSource() & InputDevice.SOURCE_CLASS_POINTER) == 0) {
    return;
  }
  final MotionEvent motionEvent=(MotionEvent)event;
  boolean handled=false;
  try {
    if (mDragEnded) {
      handled=true;
      return;
    }
    final float newX=motionEvent.getRawX();
    final float newY=motionEvent.getRawY();
switch (motionEvent.getAction()) {
case MotionEvent.ACTION_DOWN:
{
        if (DEBUG_TASK_POSITIONING) {
          Slog.w(TAG,"String_Node_Str" + newX + "String_Node_Str"+ newY+ "String_Node_Str");
        }
      }
    break;
case MotionEvent.ACTION_MOVE:
{
    if (DEBUG_TASK_POSITIONING) {
      Slog.w(TAG,"String_Node_Str" + newX + "String_Node_Str"+ newY+ "String_Node_Str");
    }
synchronized (mService.mWindowMap) {
      mDragEnded=notifyMoveLocked(newX,newY);
      mTask.getBounds(mTmpRect);
    }
    if (!mTmpRect.equals(mWindowDragBounds)) {
      Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER,"String_Node_Str");
      try {
        mService.mActivityManager.resizeTask(mTask.mTaskId,mWindowDragBounds,RESIZE_MODE_USER);
      }
 catch (      RemoteException e) {
      }
      Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);
    }
  }
break;
case MotionEvent.ACTION_UP:
{
if (DEBUG_TASK_POSITIONING) {
  Slog.w(TAG,"String_Node_Str" + newX + "String_Node_Str"+ newY+ "String_Node_Str");
}
mDragEnded=true;
}
break;
case MotionEvent.ACTION_CANCEL:
{
if (DEBUG_TASK_POSITIONING) {
Slog.w(TAG,"String_Node_Str" + newX + "String_Node_Str"+ newY+ "String_Node_Str");
}
mDragEnded=true;
}
break;
}
if (mDragEnded) {
final boolean wasResizing=mResizing;
synchronized (mService.mWindowMap) {
endDragLocked();
}
try {
if (wasResizing) {
mService.mActivityManager.resizeTask(mTask.mTaskId,mWindowDragBounds,RESIZE_MODE_USER_FORCED);
}
if (mCurrentDimSide != CTRL_NONE) {
final int createMode=mCurrentDimSide == CTRL_LEFT ? DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT : DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT;
mService.mActivityManager.moveTaskToDockedStack(mTask.mTaskId,createMode,true);
}
}
 catch (RemoteException e) {
}
mService.mH.sendEmptyMessage(H.FINISH_TASK_POSITIONING);
}
handled=true;
}
 catch (Exception e) {
Slog.e(TAG,"String_Node_Str",e);
}
 finally {
finishInputEvent(event,handled);
}
}