Program: 195654
Project: 195654
Buggy source:
/** 
 * <p> Trigger the scrollbars to draw. When invoked this method starts an animation to fade the scrollbars out after a fixed delay. If a subclass provides animated scrolling, the start delay should equal the duration of the scrolling animation. </p> <p> The animation starts only if at least one of the scrollbars is enabled, as specified by   {@link #isHorizontalScrollBarEnabled()} and{@link #isVerticalScrollBarEnabled()}. When the animation is started, this method returns true, and false otherwise. If the animation is started, this method calls   {@link #invalidate()} if the invalidate parameteris set to true; in that case the caller should not call  {@link #invalidate()}. </p> <p> This method should be invoked everytime a subclass directly updates the scroll parameters. </p>
 * @param startDelay the delay, in milliseconds, after which the animationshould start; when the delay is 0, the animation starts immediately
 * @param invalidate Wheter this method should call invalidate
 * @return true if the animation is played, false otherwise
 * @see #scrollBy(int,int)
 * @see #scrollTo(int,int)
 * @see #isHorizontalScrollBarEnabled()
 * @see #isVerticalScrollBarEnabled()
 * @see #setHorizontalScrollBarEnabled(boolean)
 * @see #setVerticalScrollBarEnabled(boolean)
 */
protected boolean awakenScrollBars(int startDelay,boolean invalidate){
  final ScrollabilityCache scrollCache=mScrollCache;
  if (scrollCache == null || !scrollCache.fadeScrollBars) {
    return false;
  }
  if (scrollCache.scrollBar == null) {
    scrollCache.scrollBar=new ScrollBarDrawable();
  }
  if (isHorizontalScrollBarEnabled() || isVerticalScrollBarEnabled()) {
    if (invalidate) {
      postInvalidateOnAnimation();
    }
    if (scrollCache.state == ScrollabilityCache.OFF) {
      final int KEY_REPEAT_FIRST_DELAY=750;
      startDelay=Math.max(KEY_REPEAT_FIRST_DELAY,startDelay);
    }
    long fadeStartTime=AnimationUtils.currentAnimationTimeMillis() + startDelay;
    scrollCache.fadeStartTime=fadeStartTime;
    scrollCache.state=ScrollabilityCache.ON;
    if (mAttachInfo != null) {
      mAttachInfo.mHandler.removeCallbacks(scrollCache);
      mAttachInfo.mHandler.postAtTime(scrollCache,fadeStartTime);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * <p> Trigger the scrollbars to draw. When invoked this method starts an animation to fade the scrollbars out after a fixed delay. If a subclass provides animated scrolling, the start delay should equal the duration of the scrolling animation. </p> <p> The animation starts only if at least one of the scrollbars is enabled, as specified by   {@link #isHorizontalScrollBarEnabled()} and{@link #isVerticalScrollBarEnabled()}. When the animation is started, this method returns true, and false otherwise. If the animation is started, this method calls   {@link #invalidate()} if the invalidate parameteris set to true; in that case the caller should not call  {@link #invalidate()}. </p> <p> This method should be invoked every time a subclass directly updates the scroll parameters. </p>
 * @param startDelay the delay, in milliseconds, after which the animationshould start; when the delay is 0, the animation starts immediately
 * @param invalidate Whether this method should call invalidate
 * @return true if the animation is played, false otherwise
 * @see #scrollBy(int,int)
 * @see #scrollTo(int,int)
 * @see #isHorizontalScrollBarEnabled()
 * @see #isVerticalScrollBarEnabled()
 * @see #setHorizontalScrollBarEnabled(boolean)
 * @see #setVerticalScrollBarEnabled(boolean)
 */
protected boolean awakenScrollBars(int startDelay,boolean invalidate){
  final ScrollabilityCache scrollCache=mScrollCache;
  if (scrollCache == null || !scrollCache.fadeScrollBars) {
    return false;
  }
  if (scrollCache.scrollBar == null) {
    scrollCache.scrollBar=new ScrollBarDrawable();
  }
  if (isHorizontalScrollBarEnabled() || isVerticalScrollBarEnabled()) {
    if (invalidate) {
      postInvalidateOnAnimation();
    }
    if (scrollCache.state == ScrollabilityCache.OFF) {
      final int KEY_REPEAT_FIRST_DELAY=750;
      startDelay=Math.max(KEY_REPEAT_FIRST_DELAY,startDelay);
    }
    long fadeStartTime=AnimationUtils.currentAnimationTimeMillis() + startDelay;
    scrollCache.fadeStartTime=fadeStartTime;
    scrollCache.state=ScrollabilityCache.ON;
    if (mAttachInfo != null) {
      mAttachInfo.mHandler.removeCallbacks(scrollCache);
      mAttachInfo.mHandler.postAtTime(scrollCache,fadeStartTime);
    }
    return true;
  }
  return false;
}