Program: 193097
Project: 193097
Buggy source:
private boolean transferStartingWindow(IBinder transferFrom,AppWindowToken wtoken){
  if (transferFrom == null) {
    return false;
  }
  AppWindowToken ttoken=findAppWindowToken(transferFrom);
  if (ttoken == null) {
    return false;
  }
  WindowState startingWindow=ttoken.startingWindow;
  if (startingWindow != null) {
    mSkipAppTransitionAnimation=true;
    if (DEBUG_STARTING_WINDOW)     Slog.v(TAG_WM,"String_Node_Str" + startingWindow + "String_Node_Str"+ ttoken+ "String_Node_Str"+ wtoken);
    final long origId=Binder.clearCallingIdentity();
    wtoken.startingData=ttoken.startingData;
    wtoken.startingView=ttoken.startingView;
    wtoken.startingDisplayed=ttoken.startingDisplayed;
    ttoken.startingDisplayed=false;
    wtoken.startingWindow=startingWindow;
    wtoken.reportedVisible=ttoken.reportedVisible;
    ttoken.startingData=null;
    ttoken.startingView=null;
    ttoken.startingWindow=null;
    ttoken.startingMoved=true;
    startingWindow.mToken=wtoken;
    startingWindow.mRootToken=wtoken;
    startingWindow.mAppToken=wtoken;
    if (DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE || DEBUG_STARTING_WINDOW) {
      Slog.v(TAG_WM,"String_Node_Str" + startingWindow);
    }
    startingWindow.getWindowList().remove(startingWindow);
    mWindowsChanged=true;
    if (DEBUG_ADD_REMOVE)     Slog.v(TAG_WM,"String_Node_Str" + startingWindow + "String_Node_Str"+ ttoken);
    ttoken.windows.remove(startingWindow);
    ttoken.allAppWindows.remove(startingWindow);
    addWindowToListInOrderLocked(startingWindow,true);
    if (ttoken.allDrawn) {
      wtoken.allDrawn=true;
      wtoken.deferClearAllDrawn=ttoken.deferClearAllDrawn;
    }
    if (ttoken.firstWindowDrawn) {
      wtoken.firstWindowDrawn=true;
    }
    if (!ttoken.hidden) {
      wtoken.hidden=false;
      wtoken.hiddenRequested=false;
    }
    if (wtoken.clientHidden != ttoken.clientHidden) {
      wtoken.clientHidden=ttoken.clientHidden;
      wtoken.sendAppVisibilityToClients();
    }
    ttoken.mAppAnimator.transferCurrentAnimation(wtoken.mAppAnimator,startingWindow.mWinAnimator);
    updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,true);
    getDefaultDisplayContentLocked().layoutNeeded=true;
    mWindowPlacerLocked.performSurfacePlacement();
    Binder.restoreCallingIdentity(origId);
    return true;
  }
 else   if (ttoken.startingData != null) {
    if (DEBUG_STARTING_WINDOW)     Slog.v(TAG_WM,"String_Node_Str" + ttoken + "String_Node_Str"+ wtoken);
    wtoken.startingData=ttoken.startingData;
    ttoken.startingData=null;
    ttoken.startingMoved=true;
    Message m=mH.obtainMessage(H.ADD_STARTING,wtoken);
    mH.sendMessageAtFrontOfQueue(m);
    return true;
  }
  final AppWindowAnimator tAppAnimator=ttoken.mAppAnimator;
  final AppWindowAnimator wAppAnimator=wtoken.mAppAnimator;
  if (tAppAnimator.thumbnail != null) {
    if (wAppAnimator.thumbnail != null) {
      wAppAnimator.thumbnail.destroy();
    }
    wAppAnimator.thumbnail=tAppAnimator.thumbnail;
    wAppAnimator.thumbnailX=tAppAnimator.thumbnailX;
    wAppAnimator.thumbnailY=tAppAnimator.thumbnailY;
    wAppAnimator.thumbnailLayer=tAppAnimator.thumbnailLayer;
    wAppAnimator.thumbnailAnimation=tAppAnimator.thumbnailAnimation;
    tAppAnimator.thumbnail=null;
  }
  return false;
}

Fixed version (ground truth):
private boolean transferStartingWindow(IBinder transferFrom,AppWindowToken wtoken){
  if (transferFrom == null) {
    return false;
  }
  AppWindowToken ttoken=findAppWindowToken(transferFrom);
  if (ttoken == null) {
    return false;
  }
  WindowState startingWindow=ttoken.startingWindow;
  if (startingWindow != null && ttoken.startingView != null) {
    mSkipAppTransitionAnimation=true;
    if (DEBUG_STARTING_WINDOW)     Slog.v(TAG_WM,"String_Node_Str" + startingWindow + "String_Node_Str"+ ttoken+ "String_Node_Str"+ wtoken);
    final long origId=Binder.clearCallingIdentity();
    wtoken.startingData=ttoken.startingData;
    wtoken.startingView=ttoken.startingView;
    wtoken.startingDisplayed=ttoken.startingDisplayed;
    ttoken.startingDisplayed=false;
    wtoken.startingWindow=startingWindow;
    wtoken.reportedVisible=ttoken.reportedVisible;
    ttoken.startingData=null;
    ttoken.startingView=null;
    ttoken.startingWindow=null;
    ttoken.startingMoved=true;
    startingWindow.mToken=wtoken;
    startingWindow.mRootToken=wtoken;
    startingWindow.mAppToken=wtoken;
    if (DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE || DEBUG_STARTING_WINDOW) {
      Slog.v(TAG_WM,"String_Node_Str" + startingWindow);
    }
    startingWindow.getWindowList().remove(startingWindow);
    mWindowsChanged=true;
    if (DEBUG_ADD_REMOVE)     Slog.v(TAG_WM,"String_Node_Str" + startingWindow + "String_Node_Str"+ ttoken);
    ttoken.windows.remove(startingWindow);
    ttoken.allAppWindows.remove(startingWindow);
    addWindowToListInOrderLocked(startingWindow,true);
    if (ttoken.allDrawn) {
      wtoken.allDrawn=true;
      wtoken.deferClearAllDrawn=ttoken.deferClearAllDrawn;
    }
    if (ttoken.firstWindowDrawn) {
      wtoken.firstWindowDrawn=true;
    }
    if (!ttoken.hidden) {
      wtoken.hidden=false;
      wtoken.hiddenRequested=false;
    }
    if (wtoken.clientHidden != ttoken.clientHidden) {
      wtoken.clientHidden=ttoken.clientHidden;
      wtoken.sendAppVisibilityToClients();
    }
    ttoken.mAppAnimator.transferCurrentAnimation(wtoken.mAppAnimator,startingWindow.mWinAnimator);
    updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,true);
    getDefaultDisplayContentLocked().layoutNeeded=true;
    mWindowPlacerLocked.performSurfacePlacement();
    Binder.restoreCallingIdentity(origId);
    return true;
  }
 else   if (ttoken.startingData != null) {
    if (DEBUG_STARTING_WINDOW)     Slog.v(TAG_WM,"String_Node_Str" + ttoken + "String_Node_Str"+ wtoken);
    wtoken.startingData=ttoken.startingData;
    ttoken.startingData=null;
    ttoken.startingMoved=true;
    Message m=mH.obtainMessage(H.ADD_STARTING,wtoken);
    mH.sendMessageAtFrontOfQueue(m);
    return true;
  }
  final AppWindowAnimator tAppAnimator=ttoken.mAppAnimator;
  final AppWindowAnimator wAppAnimator=wtoken.mAppAnimator;
  if (tAppAnimator.thumbnail != null) {
    if (wAppAnimator.thumbnail != null) {
      wAppAnimator.thumbnail.destroy();
    }
    wAppAnimator.thumbnail=tAppAnimator.thumbnail;
    wAppAnimator.thumbnailX=tAppAnimator.thumbnailX;
    wAppAnimator.thumbnailY=tAppAnimator.thumbnailY;
    wAppAnimator.thumbnailLayer=tAppAnimator.thumbnailLayer;
    wAppAnimator.thumbnailAnimation=tAppAnimator.thumbnailAnimation;
    tAppAnimator.thumbnail=null;
  }
  return false;
}