Program: 196479
Project: 196479
Buggy source:
private void updateState(boolean animate){
  int nextState=mState;
  if (mState == STATE_UNSET) {
    nextState=mTrustManaged ? STATE_ENTERING : STATE_GONE;
  }
 else   if (mState == STATE_GONE) {
    if (mTrustManaged)     nextState=STATE_ENTERING;
  }
 else   if (mState == STATE_ENTERING) {
    if (!mTrustManaged)     nextState=STATE_EXITING;
  }
 else   if (mState == STATE_VISIBLE) {
    if (!mTrustManaged)     nextState=STATE_EXITING;
  }
 else   if (mState == STATE_EXITING) {
    if (mTrustManaged)     nextState=STATE_ENTERING;
  }
  if (!animate) {
    if (nextState == STATE_ENTERING)     nextState=STATE_VISIBLE;
    if (nextState == STATE_EXITING)     nextState=STATE_GONE;
  }
  if (nextState != mState) {
    if (mCurAnimator != null) {
      mCurAnimator.cancel();
      mCurAnimator=null;
    }
    if (nextState == STATE_GONE) {
      mCurAlpha=0;
      mCurInnerRadius=mInnerRadiusEnter;
    }
 else     if (nextState == STATE_ENTERING) {
      mCurAnimator=makeEnterAnimator(mCurInnerRadius,mCurAlpha);
      if (mState == STATE_UNSET) {
        mCurAnimator.setStartDelay(ENTERING_FROM_UNSET_START_DELAY);
      }
    }
 else     if (nextState == STATE_VISIBLE) {
      mCurAlpha=ALPHA_VISIBLE_MAX;
      mCurInnerRadius=mInnerRadiusVisibleMax;
      mCurAnimator=mVisibleAnimator;
    }
 else     if (nextState == STATE_EXITING) {
      mCurAnimator=makeExitAnimator(mCurInnerRadius,mCurAlpha);
    }
    mState=nextState;
    if (mCurAnimator != null) {
      mCurAnimator.start();
    }
 else {
      invalidateSelf();
    }
  }
}

Fixed version (ground truth):
private void updateState(boolean allowTransientState){
  if (!mAnimating) {
    return;
  }
  int nextState=mState;
  if (mState == STATE_UNSET) {
    nextState=mTrustManaged ? STATE_ENTERING : STATE_GONE;
  }
 else   if (mState == STATE_GONE) {
    if (mTrustManaged)     nextState=STATE_ENTERING;
  }
 else   if (mState == STATE_ENTERING) {
    if (!mTrustManaged)     nextState=STATE_EXITING;
  }
 else   if (mState == STATE_VISIBLE) {
    if (!mTrustManaged)     nextState=STATE_EXITING;
  }
 else   if (mState == STATE_EXITING) {
    if (mTrustManaged)     nextState=STATE_ENTERING;
  }
  if (!allowTransientState) {
    if (nextState == STATE_ENTERING)     nextState=STATE_VISIBLE;
    if (nextState == STATE_EXITING)     nextState=STATE_GONE;
  }
  if (nextState != mState) {
    if (mCurAnimator != null) {
      mCurAnimator.cancel();
      mCurAnimator=null;
    }
    if (nextState == STATE_GONE) {
      mCurAlpha=0;
      mCurInnerRadius=mInnerRadiusEnter;
    }
 else     if (nextState == STATE_ENTERING) {
      mCurAnimator=makeEnterAnimator(mCurInnerRadius,mCurAlpha);
      if (mState == STATE_UNSET) {
        mCurAnimator.setStartDelay(ENTERING_FROM_UNSET_START_DELAY);
      }
    }
 else     if (nextState == STATE_VISIBLE) {
      mCurAlpha=ALPHA_VISIBLE_MAX;
      mCurInnerRadius=mInnerRadiusVisibleMax;
      mCurAnimator=mVisibleAnimator;
    }
 else     if (nextState == STATE_EXITING) {
      mCurAnimator=makeExitAnimator(mCurInnerRadius,mCurAlpha);
    }
    mState=nextState;
    if (mCurAnimator != null) {
      mCurAnimator.start();
    }
    invalidateSelf();
  }
}