Program: 191478
Project: 191478
Buggy source:
private void startImeAdjustAnimation(boolean adjustedForIme,boolean adjustedForDivider,WindowState imeWin){
  mAnimatingForIme=true;
  mAnimationStarted=false;
  if (!mAnimatingForIme) {
    mAnimationStart=mAdjustedForIme ? 1 : 0;
    mDividerAnimationStart=mAdjustedForDivider ? 1 : 0;
    mLastAnimationProgress=mAnimationStart;
    mLastDividerProgress=mDividerAnimationStart;
  }
 else {
    mAnimationStart=mLastAnimationProgress;
    mDividerAnimationStart=mLastDividerProgress;
  }
  mAnimationTarget=adjustedForIme ? 1 : 0;
  mDividerAnimationTarget=adjustedForDivider ? 1 : 0;
  final ArrayList<TaskStack> stacks=mDisplayContent.getStacks();
  for (int i=stacks.size() - 1; i >= 0; --i) {
    final TaskStack stack=stacks.get(i);
    if (stack.isVisibleLocked() && stack.isAdjustedForIme()) {
      stack.beginImeAdjustAnimation();
    }
  }
  if (!mService.mWaitingForDrawn.isEmpty()) {
    mService.mH.removeMessages(H.WAITING_FOR_DRAWN_TIMEOUT);
    mService.mH.sendEmptyMessageDelayed(H.WAITING_FOR_DRAWN_TIMEOUT,IME_ADJUST_DRAWN_TIMEOUT);
    mAnimationStartDelayed=true;
    if (imeWin != null) {
      if (mDelayedImeWin != null) {
        mDelayedImeWin.mWinAnimator.endDelayingAnimationStart();
      }
      mDelayedImeWin=imeWin;
      imeWin.mWinAnimator.startDelayingAnimationStart();
    }
    mService.mWaitingForDrawnCallback=() -> {
      mAnimationStartDelayed=false;
      if (mDelayedImeWin != null) {
        mDelayedImeWin.mWinAnimator.endDelayingAnimationStart();
      }
      notifyAdjustedForImeChanged(adjustedForIme || adjustedForDivider,IME_ADJUST_ANIM_DURATION);
    }
;
  }
 else {
    notifyAdjustedForImeChanged(adjustedForIme || adjustedForDivider,IME_ADJUST_ANIM_DURATION);
  }
}

Fixed version (ground truth):
private void startImeAdjustAnimation(boolean adjustedForIme,boolean adjustedForDivider,WindowState imeWin){
  if (!mAnimatingForIme) {
    mAnimationStart=mAdjustedForIme ? 1 : 0;
    mDividerAnimationStart=mAdjustedForDivider ? 1 : 0;
    mLastAnimationProgress=mAnimationStart;
    mLastDividerProgress=mDividerAnimationStart;
  }
 else {
    mAnimationStart=mLastAnimationProgress;
    mDividerAnimationStart=mLastDividerProgress;
  }
  mAnimatingForIme=true;
  mAnimationStarted=false;
  mAnimationTarget=adjustedForIme ? 1 : 0;
  mDividerAnimationTarget=adjustedForDivider ? 1 : 0;
  final ArrayList<TaskStack> stacks=mDisplayContent.getStacks();
  for (int i=stacks.size() - 1; i >= 0; --i) {
    final TaskStack stack=stacks.get(i);
    if (stack.isVisibleLocked() && stack.isAdjustedForIme()) {
      stack.beginImeAdjustAnimation();
    }
  }
  if (!mService.mWaitingForDrawn.isEmpty()) {
    mService.mH.removeMessages(H.WAITING_FOR_DRAWN_TIMEOUT);
    mService.mH.sendEmptyMessageDelayed(H.WAITING_FOR_DRAWN_TIMEOUT,IME_ADJUST_DRAWN_TIMEOUT);
    mAnimationStartDelayed=true;
    if (imeWin != null) {
      if (mDelayedImeWin != null) {
        mDelayedImeWin.mWinAnimator.endDelayingAnimationStart();
      }
      mDelayedImeWin=imeWin;
      imeWin.mWinAnimator.startDelayingAnimationStart();
    }
    mService.mWaitingForDrawnCallback=() -> {
      mAnimationStartDelayed=false;
      if (mDelayedImeWin != null) {
        mDelayedImeWin.mWinAnimator.endDelayingAnimationStart();
      }
      notifyAdjustedForImeChanged(adjustedForIme || adjustedForDivider,IME_ADJUST_ANIM_DURATION);
    }
;
  }
 else {
    notifyAdjustedForImeChanged(adjustedForIme || adjustedForDivider,IME_ADJUST_ANIM_DURATION);
  }
}