diff options
| author | 2024-02-06 15:37:19 +0100 | |
|---|---|---|
| committer | 2024-02-13 18:22:55 +0100 | |
| commit | 02c3e3fef9c9d48772108cc4425cdc492ea9a3ec (patch) | |
| tree | 2acfc7a4f664f1c044013d94fa89d3db9bbd194f | |
| parent | a60c144b83026e6a95f94aa712ba089eec91d456 (diff) | |
Cancel pre-existing PHASE_WM_SHOW_IME_RUNNER
This treats any pre-existing statsToken at PHASE_WM_SHOW_IME_RUNNER as
canceled instead of failed, and also adds a new
PHASE_WM_ABORT_SHOW_IME_POST_LAYOUT to tell this apart from
abortShowImePostLayout, where the request actually fails.
Test: show IME in launcher and check ImeTracker logs
Bug: 324053104
Change-Id: I810ac6b5f47eb3b6e104410d99ffc1cea87545db
| -rw-r--r-- | core/java/android/view/inputmethod/ImeTracker.java | 9 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java | 8 |
2 files changed, 11 insertions, 6 deletions
diff --git a/core/java/android/view/inputmethod/ImeTracker.java b/core/java/android/view/inputmethod/ImeTracker.java index 31c03632665b..74e1d10cdd44 100644 --- a/core/java/android/view/inputmethod/ImeTracker.java +++ b/core/java/android/view/inputmethod/ImeTracker.java @@ -180,7 +180,8 @@ public interface ImeTracker { PHASE_CLIENT_ANIMATION_RUNNING, PHASE_CLIENT_ANIMATION_CANCEL, PHASE_CLIENT_ANIMATION_FINISHED_SHOW, - PHASE_CLIENT_ANIMATION_FINISHED_HIDE + PHASE_CLIENT_ANIMATION_FINISHED_HIDE, + PHASE_WM_ABORT_SHOW_IME_POST_LAYOUT, }) @Retention(RetentionPolicy.SOURCE) @interface Phase {} @@ -239,7 +240,7 @@ public interface ImeTracker { /** Applied the IME visibility. */ int PHASE_SERVER_APPLY_IME_VISIBILITY = ImeProtoEnums.PHASE_SERVER_APPLY_IME_VISIBILITY; - /** Created the show IME runner. */ + /** Started the show IME runner. */ int PHASE_WM_SHOW_IME_RUNNER = ImeProtoEnums.PHASE_WM_SHOW_IME_RUNNER; /** Ready to show IME. */ @@ -318,6 +319,10 @@ public interface ImeTracker { /** Finished the IME window insets hide animation. */ int PHASE_CLIENT_ANIMATION_FINISHED_HIDE = ImeProtoEnums.PHASE_CLIENT_ANIMATION_FINISHED_HIDE; + /** Aborted the request to show the IME post layout. */ + int PHASE_WM_ABORT_SHOW_IME_POST_LAYOUT = + ImeProtoEnums.PHASE_WM_ABORT_SHOW_IME_POST_LAYOUT; + /** * Creates an IME show request tracking token. * diff --git a/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java b/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java index e8a4c1c5c3d3..ea31e632cfb8 100644 --- a/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java +++ b/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java @@ -222,8 +222,8 @@ final class ImeInsetsSourceProvider extends InsetsSourceProvider { @Nullable ImeTracker.Token statsToken) { boolean targetChanged = isTargetChangedWithinActivity(imeTarget); mImeRequester = imeTarget; - // There was still a stats token, so that request presumably failed. - ImeTracker.forLogging().onFailed( + // Cancel the pre-existing stats token, if any. + ImeTracker.forLogging().onCancelled( mImeRequesterStatsToken, ImeTracker.PHASE_WM_SHOW_IME_RUNNER); mImeRequesterStatsToken = statsToken; if (targetChanged) { @@ -300,8 +300,8 @@ final class ImeInsetsSourceProvider extends InsetsSourceProvider { mImeRequester = null; mIsImeLayoutDrawn = false; mShowImeRunner = null; - ImeTracker.forLogging().onCancelled( - mImeRequesterStatsToken, ImeTracker.PHASE_WM_SHOW_IME_RUNNER); + ImeTracker.forLogging().onFailed( + mImeRequesterStatsToken, ImeTracker.PHASE_WM_ABORT_SHOW_IME_POST_LAYOUT); mImeRequesterStatsToken = null; } |