diff options
| author | 2024-11-04 10:12:11 +0000 | |
|---|---|---|
| committer | 2024-11-04 11:36:20 +0000 | |
| commit | 893d0f9f016c94cf1b3634c4525d4a56a9d3d9c1 (patch) | |
| tree | ea7eb03a462e1c0064195e6deb1ed71a8a0b28d1 | |
| parent | daf9939d40d170229e78725e297121af8f7202b0 (diff) | |
Change ImeTracker phase in ImeInsetsSourceProvider to be more accurate
Also, updated some TODO's to match the tracking bug.
Test: None
Bug: 353463205
Flag: android.view.inputmethod.refactor_insets_controller
Change-Id: I1d1e9aa6b814a117dc0a020b4fbc3190ae895eb9
6 files changed, 17 insertions, 9 deletions
diff --git a/core/java/android/view/inputmethod/ImeTracker.java b/core/java/android/view/inputmethod/ImeTracker.java index 2ca62a0725df..dd32d57bd650 100644 --- a/core/java/android/view/inputmethod/ImeTracker.java +++ b/core/java/android/view/inputmethod/ImeTracker.java @@ -221,6 +221,7 @@ public interface ImeTracker { PHASE_WM_INVOKING_IME_REQUESTED_LISTENER, PHASE_CLIENT_ALREADY_HIDDEN, PHASE_CLIENT_VIEW_HANDLER_AVAILABLE, + PHASE_SERVER_UPDATE_CLIENT_VISIBILITY, }) @Retention(RetentionPolicy.SOURCE) @interface Phase {} @@ -430,6 +431,11 @@ public interface ImeTracker { * continue without. */ int PHASE_CLIENT_VIEW_HANDLER_AVAILABLE = ImeProtoEnums.PHASE_CLIENT_VIEW_HANDLER_AVAILABLE; + /** + * ImeInsetsSourceProvider sets the reported visibility of the caller/client window (either the + * app or the RemoteInsetsControlTarget). + */ + int PHASE_SERVER_UPDATE_CLIENT_VISIBILITY = ImeProtoEnums.PHASE_SERVER_UPDATE_CLIENT_VISIBILITY; /** * Called when an IME request is started. diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index 010437337ba1..d8483f721306 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -4969,7 +4969,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. final var userData = getUserData(userId); if (Flags.refactorInsetsController()) { setImeVisibilityOnFocusedWindowClient(false, userData, - null /* TODO(b329229469) check statsToken */); + null /* TODO(b/353463205) check statsToken */); } else { hideCurrentInputLocked(userData.mImeBindingState.mFocusedWindow, diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index e827f44cb2a2..07675b93a2aa 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -7072,7 +7072,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp @Override public void setImeInputTargetRequestedVisibility(boolean visible) { if (android.view.inputmethod.Flags.refactorInsetsController()) { - // TODO(b/329229469) we won't have the statsToken in all cases, but should still log + // TODO(b/353463205) we won't have the statsToken in all cases, but should still log try { mRemoteInsetsController.setImeInputTargetRequestedVisibility(visible); } catch (RemoteException e) { diff --git a/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java b/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java index e9c6e93891df..51e239bba447 100644 --- a/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java +++ b/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java @@ -254,7 +254,7 @@ final class ImeInsetsSourceProvider extends InsetsSourceProvider { // Refer WindowState#getImeControlTarget(). target = target.getWindow().getImeControlTarget(); } - // TODO(b/329229469) make sure that the statsToken of all callers is non-null (currently + // TODO(b/353463205) make sure that the statsToken of all callers is non-null (currently // not the case) super.updateControlForTarget(target, force, statsToken); if (Flags.refactorInsetsController()) { @@ -290,12 +290,14 @@ final class ImeInsetsSourceProvider extends InsetsSourceProvider { changed |= mDisplayContent.onImeInsetsClientVisibilityUpdate(); if (Flags.refactorInsetsController()) { if (changed) { + ImeTracker.forLogging().onProgress(statsToken, + ImeTracker.PHASE_SERVER_UPDATE_CLIENT_VISIBILITY); invokeOnImeRequestedChangedListener(mDisplayContent.getImeInputTarget(), statsToken); } else { - // TODO(b/329229469) change phase and check cancelled / failed + // TODO(b/353463205) check cancelled / failed ImeTracker.forLogging().onCancelled(statsToken, - ImeTracker.PHASE_CLIENT_REPORT_REQUESTED_VISIBLE_TYPES); + ImeTracker.PHASE_SERVER_UPDATE_CLIENT_VISIBILITY); } } return changed; @@ -460,7 +462,7 @@ final class ImeInsetsSourceProvider extends InsetsSourceProvider { // This can later become ready, so we don't want to cancel the pending request here. return; } - // TODO(b/329229469) check if this is still triggered, as we don't go into STATE_SHOW_IME + // TODO(b/353463205) check if this is still triggered, as we don't go into STATE_SHOW_IME // (DefaultImeVisibilityApplier) if (android.view.inputmethod.Flags.refactorInsetsController()) { // The IME is drawn, so call into {@link WindowState#notifyInsetsControlChanged} diff --git a/services/core/java/com/android/server/wm/InsetsStateController.java b/services/core/java/com/android/server/wm/InsetsStateController.java index 5dddf36a8d8b..4b2d45430bb4 100644 --- a/services/core/java/com/android/server/wm/InsetsStateController.java +++ b/services/core/java/com/android/server/wm/InsetsStateController.java @@ -317,9 +317,9 @@ class InsetsStateController { // aborted. provider.updateFakeControlTarget(target); } else { - // TODO(b/329229469) if the IME controlTarget changes, any pending requests should fail + // TODO(b/353463205) if the IME controlTarget changes, any pending requests should fail provider.updateControlForTarget(target, false /* force */, - null /* TODO(b/329229469) check if needed here */); + null /* TODO(b/353463205) check if needed here */); // Get control target again in case the provider didn't accept the one we passed to it. target = provider.getControlTarget(); diff --git a/services/core/java/com/android/server/wm/Session.java b/services/core/java/com/android/server/wm/Session.java index 077127c031e1..1bb4c41e79e0 100644 --- a/services/core/java/com/android/server/wm/Session.java +++ b/services/core/java/com/android/server/wm/Session.java @@ -715,7 +715,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient { if (embeddedWindow != null) { // If there is no WindowState for the IWindow, it could be still an // EmbeddedWindow. Therefore, check the EmbeddedWindowController as well - // TODO(b/329229469) Use different phase here + // TODO(b/353463205) Use different phase here ImeTracker.forLogging().onProgress(imeStatsToken, ImeTracker.PHASE_WM_UPDATE_REQUESTED_VISIBLE_TYPES); embeddedWindow.setRequestedVisibleTypes( |