Program: 192510
Project: 192510
Buggy source:
private void startActivateAnimation(final boolean reverse){
  if (!isAttachedToWindow()) {
    return;
  }
  int widthHalf=mBackgroundNormal.getWidth() / 2;
  int heightHalf=mBackgroundNormal.getActualHeight() / 2;
  float radius=(float)Math.sqrt(widthHalf * widthHalf + heightHalf * heightHalf);
  Animator animator;
  if (reverse) {
    animator=ViewAnimationUtils.createCircularReveal(mBackgroundNormal,widthHalf,heightHalf,radius,0);
  }
 else {
    animator=ViewAnimationUtils.createCircularReveal(mBackgroundNormal,widthHalf,heightHalf,0,radius);
  }
  mBackgroundNormal.setVisibility(View.VISIBLE);
  Interpolator interpolator;
  Interpolator alphaInterpolator;
  if (!reverse) {
    interpolator=Interpolators.LINEAR_OUT_SLOW_IN;
    alphaInterpolator=Interpolators.LINEAR_OUT_SLOW_IN;
  }
 else {
    interpolator=ACTIVATE_INVERSE_INTERPOLATOR;
    alphaInterpolator=ACTIVATE_INVERSE_ALPHA_INTERPOLATOR;
  }
  animator.setInterpolator(interpolator);
  animator.setDuration(ACTIVATE_ANIMATION_LENGTH);
  if (reverse) {
    mBackgroundNormal.setAlpha(1f);
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        if (mDimmed) {
          mBackgroundNormal.setVisibility(View.INVISIBLE);
        }
      }
    }
);
    animator.start();
  }
 else {
    mBackgroundNormal.setAlpha(0.4f);
    animator.start();
  }
  mBackgroundNormal.animate().alpha(reverse ? 0f : 1f).setInterpolator(alphaInterpolator).setUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      float animatedFraction=animation.getAnimatedFraction();
      if (reverse) {
        animatedFraction=1.0f - animatedFraction;
      }
      setNormalBackgroundVisibilityAmount(animatedFraction);
    }
  }
).setDuration(ACTIVATE_ANIMATION_LENGTH);
}

Fixed version (ground truth):
private void startActivateAnimation(final boolean reverse){
  if (!isAttachedToWindow()) {
    return;
  }
  int widthHalf=mBackgroundNormal.getWidth() / 2;
  int heightHalf=mBackgroundNormal.getActualHeight() / 2;
  float radius=(float)Math.sqrt(widthHalf * widthHalf + heightHalf * heightHalf);
  Animator animator;
  if (reverse) {
    animator=ViewAnimationUtils.createCircularReveal(mBackgroundNormal,widthHalf,heightHalf,radius,0);
  }
 else {
    animator=ViewAnimationUtils.createCircularReveal(mBackgroundNormal,widthHalf,heightHalf,0,radius);
  }
  mBackgroundNormal.setVisibility(View.VISIBLE);
  Interpolator interpolator;
  Interpolator alphaInterpolator;
  if (!reverse) {
    interpolator=Interpolators.LINEAR_OUT_SLOW_IN;
    alphaInterpolator=Interpolators.LINEAR_OUT_SLOW_IN;
  }
 else {
    interpolator=ACTIVATE_INVERSE_INTERPOLATOR;
    alphaInterpolator=ACTIVATE_INVERSE_ALPHA_INTERPOLATOR;
  }
  animator.setInterpolator(interpolator);
  animator.setDuration(ACTIVATE_ANIMATION_LENGTH);
  if (reverse) {
    mBackgroundNormal.setAlpha(1f);
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        updateBackground();
      }
    }
);
    animator.start();
  }
 else {
    mBackgroundNormal.setAlpha(0.4f);
    animator.start();
  }
  mBackgroundNormal.animate().alpha(reverse ? 0f : 1f).setInterpolator(alphaInterpolator).setUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      float animatedFraction=animation.getAnimatedFraction();
      if (reverse) {
        animatedFraction=1.0f - animatedFraction;
      }
      setNormalBackgroundVisibilityAmount(animatedFraction);
    }
  }
).setDuration(ACTIVATE_ANIMATION_LENGTH);
}