Program: 200
Project: 200
Buggy source:
@Override public void setAppVisibility(IBinder token,boolean visible){
  if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,"String_Node_Str")) {
    throw new SecurityException("String_Node_Str");
  }
  AppWindowToken wtoken;
synchronized (mWindowMap) {
    wtoken=findAppWindowToken(token);
    if (wtoken == null) {
      Slog.w(TAG,"String_Node_Str" + token);
      return;
    }
    if (DEBUG_APP_TRANSITIONS || DEBUG_ORIENTATION) {
      RuntimeException e=null;
      if (!HIDE_STACK_CRAWLS) {
        e=new RuntimeException();
        e.fillInStackTrace();
      }
      Slog.v(TAG,"String_Node_Str" + token + "String_Node_Str"+ visible+ "String_Node_Str"+ mAppTransition+ "String_Node_Str"+ wtoken.hidden+ "String_Node_Str"+ wtoken.hiddenRequested,e);
    }
    if (okToDisplay() && mAppTransition.isTransitionSet()) {
      if (wtoken.hiddenRequested != visible) {
        return;
      }
      wtoken.hiddenRequested=!visible;
      if (!wtoken.startingDisplayed) {
        if (DEBUG_APP_TRANSITIONS)         Slog.v(TAG,"String_Node_Str" + wtoken);
        wtoken.mAppAnimator.setDummyAnimation();
      }
      mOpeningApps.remove(wtoken);
      mClosingApps.remove(wtoken);
      wtoken.waitingToShow=wtoken.waitingToHide=false;
      wtoken.inPendingTransaction=true;
      if (visible) {
        mOpeningApps.add(wtoken);
        wtoken.startingMoved=false;
        if (wtoken.hidden) {
          wtoken.allDrawn=false;
          wtoken.deferClearAllDrawn=false;
          wtoken.waitingToShow=true;
          if (wtoken.clientHidden) {
            wtoken.clientHidden=false;
            wtoken.sendAppVisibilityToClients();
          }
        }
      }
 else {
        mClosingApps.add(wtoken);
        if (!wtoken.hidden) {
          wtoken.waitingToHide=true;
        }
      }
      return;
    }
    final long origId=Binder.clearCallingIdentity();
    setTokenVisibilityLocked(wtoken,null,visible,AppTransition.TRANSIT_UNSET,true);
    wtoken.updateReportedVisibilityLocked();
    Binder.restoreCallingIdentity(origId);
  }
}

Fixed version (ground truth):
@Override public void setAppVisibility(IBinder token,boolean visible){
  if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,"String_Node_Str")) {
    throw new SecurityException("String_Node_Str");
  }
  AppWindowToken wtoken;
synchronized (mWindowMap) {
    wtoken=findAppWindowToken(token);
    if (wtoken == null) {
      Slog.w(TAG,"String_Node_Str" + token);
      return;
    }
    if (DEBUG_APP_TRANSITIONS || DEBUG_ORIENTATION) {
      RuntimeException e=null;
      if (!HIDE_STACK_CRAWLS) {
        e=new RuntimeException();
        e.fillInStackTrace();
      }
      Slog.v(TAG,"String_Node_Str" + token + "String_Node_Str"+ visible+ "String_Node_Str"+ mAppTransition+ "String_Node_Str"+ wtoken.hidden+ "String_Node_Str"+ wtoken.hiddenRequested,e);
    }
    if (okToDisplay() && mAppTransition.isTransitionSet()) {
      wtoken.hiddenRequested=!visible;
      if (!wtoken.startingDisplayed) {
        if (DEBUG_APP_TRANSITIONS)         Slog.v(TAG,"String_Node_Str" + wtoken);
        wtoken.mAppAnimator.setDummyAnimation();
      }
      mOpeningApps.remove(wtoken);
      mClosingApps.remove(wtoken);
      wtoken.waitingToShow=wtoken.waitingToHide=false;
      wtoken.inPendingTransaction=true;
      if (visible) {
        mOpeningApps.add(wtoken);
        wtoken.startingMoved=false;
        if (wtoken.hidden) {
          wtoken.allDrawn=false;
          wtoken.deferClearAllDrawn=false;
          wtoken.waitingToShow=true;
          if (wtoken.clientHidden) {
            wtoken.clientHidden=false;
            wtoken.sendAppVisibilityToClients();
          }
        }
      }
 else {
        mClosingApps.add(wtoken);
        if (!wtoken.hidden) {
          wtoken.waitingToHide=true;
        }
      }
      return;
    }
    final long origId=Binder.clearCallingIdentity();
    setTokenVisibilityLocked(wtoken,null,visible,AppTransition.TRANSIT_UNSET,true);
    wtoken.updateReportedVisibilityLocked();
    Binder.restoreCallingIdentity(origId);
  }
}