Program: 192931
Project: 192931
Buggy source:
/** 
 * Choose the correct animation and set it to the passed WindowState.
 * @param transit If AppTransition.TRANSIT_PREVIEW_DONE and the app window has been drawnthen the animation will be app_starting_exit. Any other value loads the animation from the switch statement below.
 * @param isEntrance The animation type the last time this was called. Used to keep fromloading the same animation twice.
 * @return true if an animation has been loaded.
 */
boolean applyAnimationLocked(int transit,boolean isEntrance){
  if ((mLocalAnimating && mAnimationIsEntrance == isEntrance) || mKeyguardGoingAwayAnimation) {
    if (mAnimation != null && mKeyguardGoingAwayAnimation && transit == WindowManagerPolicy.TRANSIT_PREVIEW_DONE) {
      applyFadeoutDuringKeyguardExitAnimation();
    }
    return true;
  }
  if (mService.okToDisplay()) {
    int anim=mPolicy.selectAnimationLw(mWin,transit);
    int attr=-1;
    Animation a=null;
    if (anim != 0) {
      a=anim != -1 ? AnimationUtils.loadAnimation(mContext,anim) : null;
    }
 else {
switch (transit) {
case WindowManagerPolicy.TRANSIT_ENTER:
        attr=com.android.internal.R.styleable.WindowAnimation_windowEnterAnimation;
      break;
case WindowManagerPolicy.TRANSIT_EXIT:
    attr=com.android.internal.R.styleable.WindowAnimation_windowExitAnimation;
  break;
case WindowManagerPolicy.TRANSIT_SHOW:
attr=com.android.internal.R.styleable.WindowAnimation_windowShowAnimation;
break;
case WindowManagerPolicy.TRANSIT_HIDE:
attr=com.android.internal.R.styleable.WindowAnimation_windowHideAnimation;
break;
}
if (attr >= 0) {
a=mService.mAppTransition.loadAnimationAttr(mWin.mAttrs,attr);
}
}
if (DEBUG_ANIM) Slog.v(TAG,"String_Node_Str" + this + "String_Node_Str"+ anim+ "String_Node_Str"+ Integer.toHexString(attr)+ "String_Node_Str"+ a+ "String_Node_Str"+ transit+ "String_Node_Str"+ isEntrance+ "String_Node_Str"+ Debug.getCallers(3));
if (a != null) {
if (DEBUG_ANIM) {
RuntimeException e=null;
if (!HIDE_STACK_CRAWLS) {
e=new RuntimeException();
e.fillInStackTrace();
}
Slog.v(TAG,"String_Node_Str" + a + "String_Node_Str"+ this,e);
}
setAnimation(a);
mAnimationIsEntrance=isEntrance;
}
}
 else {
clearAnimation();
}
return mAnimation != null;
}

Fixed version (ground truth):
/** 
 * Choose the correct animation and set it to the passed WindowState.
 * @param transit If AppTransition.TRANSIT_PREVIEW_DONE and the app window has been drawnthen the animation will be app_starting_exit. Any other value loads the animation from the switch statement below.
 * @param isEntrance The animation type the last time this was called. Used to keep fromloading the same animation twice.
 * @return true if an animation has been loaded.
 */
boolean applyAnimationLocked(int transit,boolean isEntrance){
  if ((mLocalAnimating && mAnimationIsEntrance == isEntrance) || mKeyguardGoingAwayAnimation) {
    if (mAnimation != null && mKeyguardGoingAwayAnimation && transit == WindowManagerPolicy.TRANSIT_PREVIEW_DONE) {
      applyFadeoutDuringKeyguardExitAnimation();
    }
    return true;
  }
  if (mService.okToDisplay()) {
    int anim=mPolicy.selectAnimationLw(mWin,transit);
    int attr=-1;
    Animation a=null;
    if (anim != 0) {
      a=anim != -1 ? AnimationUtils.loadAnimation(mContext,anim) : null;
    }
 else {
switch (transit) {
case WindowManagerPolicy.TRANSIT_ENTER:
        attr=com.android.internal.R.styleable.WindowAnimation_windowEnterAnimation;
      break;
case WindowManagerPolicy.TRANSIT_EXIT:
    attr=com.android.internal.R.styleable.WindowAnimation_windowExitAnimation;
  break;
case WindowManagerPolicy.TRANSIT_SHOW:
attr=com.android.internal.R.styleable.WindowAnimation_windowShowAnimation;
break;
case WindowManagerPolicy.TRANSIT_HIDE:
attr=com.android.internal.R.styleable.WindowAnimation_windowHideAnimation;
break;
}
if (attr >= 0) {
a=mService.mAppTransition.loadAnimationAttr(mWin.mAttrs,attr);
}
}
if (DEBUG_ANIM) Slog.v(TAG,"String_Node_Str" + this + "String_Node_Str"+ anim+ "String_Node_Str"+ Integer.toHexString(attr)+ "String_Node_Str"+ a+ "String_Node_Str"+ transit+ "String_Node_Str"+ isEntrance+ "String_Node_Str"+ Debug.getCallers(3));
if (a != null) {
if (DEBUG_ANIM) logWithStack(TAG,"String_Node_Str" + a + "String_Node_Str"+ this);
setAnimation(a);
mAnimationIsEntrance=isEntrance;
}
}
 else {
clearAnimation();
}
return mAnimation != null;
}