Program: 191842
Project: 191842
Buggy source:
/** 
 * Moves the specified task record to the input stack id. WARNING: This method performs an unchecked/raw move of the task and can leave the system in an unstable state if used incorrectly. Use   {@link #moveTaskToStackLocked} to perform safe task movement to a stack.
 * @param task Task to move.
 * @param stackId Id of stack to move task to.
 * @param toTop True if the task should be placed at the top of the stack.
 * @param forceFocus if focus should be moved to the new stack
 * @param reason Reason the task is been moved.
 * @return The stack the task was moved to.
 */
ActivityStack moveTaskToStackUncheckedLocked(TaskRecord task,int stackId,boolean toTop,boolean forceFocus,String reason){
  if (StackId.isMultiWindowStack(stackId) && !mService.mSupportsMultiWindow) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + task + "String_Node_Str"+ stackId);
  }
  final ActivityRecord r=task.getTopActivity();
  final ActivityStack prevStack=task.stack;
  final boolean wasFocused=isFocusedStack(prevStack) && (topRunningActivityLocked() == r);
  final boolean wasResumed=prevStack.mResumedActivity == r;
  final boolean wasFront=isFrontStack(prevStack) && (prevStack.topRunningActivityLocked() == r);
  if (stackId == DOCKED_STACK_ID && !task.isResizeable()) {
    stackId=(prevStack != null) ? prevStack.mStackId : FULLSCREEN_WORKSPACE_STACK_ID;
    Slog.w(TAG,"String_Node_Str" + task + "String_Node_Str"+ stackId+ "String_Node_Str");
  }
  task.mTemporarilyUnresizable=true;
  final ActivityStack stack=getStack(stackId,CREATE_IF_NEEDED,toTop);
  task.mTemporarilyUnresizable=false;
  mWindowManager.moveTaskToStack(task.taskId,stack.mStackId,toTop);
  stack.addTask(task,toTop,reason);
  stack.moveToFrontAndResumeStateIfNeeded(r,forceFocus || wasFocused || wasFront,wasResumed,reason);
  return stack;
}

Fixed version (ground truth):
/** 
 * Moves the specified task record to the input stack id. WARNING: This method performs an unchecked/raw move of the task and can leave the system in an unstable state if used incorrectly. Use   {@link #moveTaskToStackLocked} to perform safe task movement to a stack.
 * @param task Task to move.
 * @param stackId Id of stack to move task to.
 * @param toTop True if the task should be placed at the top of the stack.
 * @param forceFocus if focus should be moved to the new stack
 * @param reason Reason the task is been moved.
 * @return The stack the task was moved to.
 */
ActivityStack moveTaskToStackUncheckedLocked(TaskRecord task,int stackId,boolean toTop,boolean forceFocus,String reason){
  if (StackId.isMultiWindowStack(stackId) && !mService.mSupportsMultiWindow) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str" + task + "String_Node_Str"+ stackId);
  }
  final ActivityRecord r=task.topRunningActivityLocked();
  final ActivityStack prevStack=task.stack;
  final boolean wasFocused=isFocusedStack(prevStack) && (topRunningActivityLocked() == r);
  final boolean wasResumed=prevStack.mResumedActivity == r;
  final boolean wasFront=isFrontStack(prevStack) && (prevStack.topRunningActivityLocked() == r);
  if (stackId == DOCKED_STACK_ID && !task.isResizeable()) {
    stackId=(prevStack != null) ? prevStack.mStackId : FULLSCREEN_WORKSPACE_STACK_ID;
    Slog.w(TAG,"String_Node_Str" + task + "String_Node_Str"+ stackId+ "String_Node_Str");
  }
  task.mTemporarilyUnresizable=true;
  final ActivityStack stack=getStack(stackId,CREATE_IF_NEEDED,toTop);
  task.mTemporarilyUnresizable=false;
  mWindowManager.moveTaskToStack(task.taskId,stack.mStackId,toTop);
  stack.addTask(task,toTop,reason);
  stack.moveToFrontAndResumeStateIfNeeded(r,forceFocus || wasFocused || wasFront,wasResumed,reason);
  return stack;
}