Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java +11 −2 Original line number Original line Diff line number Diff line Loading @@ -403,6 +403,8 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged // activity A is focussed), we will not get a call of #insetsControlChanged, and // activity A is focussed), we will not get a call of #insetsControlChanged, and // therefore have to start the show animation from here // therefore have to start the show animation from here startAnimation(mImeRequestedVisible /* show */, false /* forceRestart */); startAnimation(mImeRequestedVisible /* show */, false /* forceRestart */); setVisibleDirectly(mImeRequestedVisible || mAnimation != null); } } } } Loading Loading @@ -540,6 +542,10 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged show ? ANIMATION_DURATION_SHOW_MS : ANIMATION_DURATION_HIDE_MS); show ? ANIMATION_DURATION_SHOW_MS : ANIMATION_DURATION_HIDE_MS); if (seek) { if (seek) { mAnimation.setCurrentFraction((seekValue - startY) / (endY - startY)); mAnimation.setCurrentFraction((seekValue - startY) / (endY - startY)); } else { // In some cases the value in onAnimationStart is zero, therefore setting it // explicitly to startY mAnimation.setCurrentFraction(0); } } mAnimation.addUpdateListener(animation -> { mAnimation.addUpdateListener(animation -> { Loading Loading @@ -621,6 +627,9 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged ImeTracker.PHASE_WM_ANIMATION_RUNNING); ImeTracker.PHASE_WM_ANIMATION_RUNNING); t.hide(animatingLeash); t.hide(animatingLeash); removeImeSurface(mDisplayId); removeImeSurface(mDisplayId); if (android.view.inputmethod.Flags.refactorInsetsController()) { setVisibleDirectly(false /* visible */); } ImeTracker.forLogging().onHidden(mStatsToken); ImeTracker.forLogging().onHidden(mStatsToken); } else if (mAnimationDirection == DIRECTION_SHOW && !mCancelled) { } else if (mAnimationDirection == DIRECTION_SHOW && !mCancelled) { ImeTracker.forLogging().onShown(mStatsToken); ImeTracker.forLogging().onShown(mStatsToken); Loading @@ -645,13 +654,13 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged animatingControl.release(SurfaceControl::release); animatingControl.release(SurfaceControl::release); } } }); }); if (!show) { if (!android.view.inputmethod.Flags.refactorInsetsController() && !show) { // When going away, queue up insets change first, otherwise any bounds changes // When going away, queue up insets change first, otherwise any bounds changes // can have a "flicker" of ime-provided insets. // can have a "flicker" of ime-provided insets. setVisibleDirectly(false /* visible */); setVisibleDirectly(false /* visible */); } } mAnimation.start(); mAnimation.start(); if (show) { if (!android.view.inputmethod.Flags.refactorInsetsController() && show) { // When showing away, queue up insets change last, otherwise any bounds changes // When showing away, queue up insets change last, otherwise any bounds changes // can have a "flicker" of ime-provided insets. // can have a "flicker" of ime-provided insets. setVisibleDirectly(true /* visible */); setVisibleDirectly(true /* visible */); Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java +11 −2 Original line number Original line Diff line number Diff line Loading @@ -403,6 +403,8 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged // activity A is focussed), we will not get a call of #insetsControlChanged, and // activity A is focussed), we will not get a call of #insetsControlChanged, and // therefore have to start the show animation from here // therefore have to start the show animation from here startAnimation(mImeRequestedVisible /* show */, false /* forceRestart */); startAnimation(mImeRequestedVisible /* show */, false /* forceRestart */); setVisibleDirectly(mImeRequestedVisible || mAnimation != null); } } } } Loading Loading @@ -540,6 +542,10 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged show ? ANIMATION_DURATION_SHOW_MS : ANIMATION_DURATION_HIDE_MS); show ? ANIMATION_DURATION_SHOW_MS : ANIMATION_DURATION_HIDE_MS); if (seek) { if (seek) { mAnimation.setCurrentFraction((seekValue - startY) / (endY - startY)); mAnimation.setCurrentFraction((seekValue - startY) / (endY - startY)); } else { // In some cases the value in onAnimationStart is zero, therefore setting it // explicitly to startY mAnimation.setCurrentFraction(0); } } mAnimation.addUpdateListener(animation -> { mAnimation.addUpdateListener(animation -> { Loading Loading @@ -621,6 +627,9 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged ImeTracker.PHASE_WM_ANIMATION_RUNNING); ImeTracker.PHASE_WM_ANIMATION_RUNNING); t.hide(animatingLeash); t.hide(animatingLeash); removeImeSurface(mDisplayId); removeImeSurface(mDisplayId); if (android.view.inputmethod.Flags.refactorInsetsController()) { setVisibleDirectly(false /* visible */); } ImeTracker.forLogging().onHidden(mStatsToken); ImeTracker.forLogging().onHidden(mStatsToken); } else if (mAnimationDirection == DIRECTION_SHOW && !mCancelled) { } else if (mAnimationDirection == DIRECTION_SHOW && !mCancelled) { ImeTracker.forLogging().onShown(mStatsToken); ImeTracker.forLogging().onShown(mStatsToken); Loading @@ -645,13 +654,13 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged animatingControl.release(SurfaceControl::release); animatingControl.release(SurfaceControl::release); } } }); }); if (!show) { if (!android.view.inputmethod.Flags.refactorInsetsController() && !show) { // When going away, queue up insets change first, otherwise any bounds changes // When going away, queue up insets change first, otherwise any bounds changes // can have a "flicker" of ime-provided insets. // can have a "flicker" of ime-provided insets. setVisibleDirectly(false /* visible */); setVisibleDirectly(false /* visible */); } } mAnimation.start(); mAnimation.start(); if (show) { if (!android.view.inputmethod.Flags.refactorInsetsController() && show) { // When showing away, queue up insets change last, otherwise any bounds changes // When showing away, queue up insets change last, otherwise any bounds changes // can have a "flicker" of ime-provided insets. // can have a "flicker" of ime-provided insets. setVisibleDirectly(true /* visible */); setVisibleDirectly(true /* visible */); Loading