From 2a7fd4612358e206c829bcb83053598ffb77bdff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cosmin=20B=C4=83ie=C8=99?= Date: Thu, 20 Jul 2023 17:48:06 +0200 Subject: [PATCH] PHASE_IME_APPLY_VISIBILITY_INSETS_CONSUMER timeout Fixes a timeout at PHASE_IME_APPLY_VISIBILITY_INSETS_CONSUMER by moving the progress call into the InputMethodPrivilegedOperations, and adding a fail call as well. Test: n/a Bug: 292092249 Change-Id: If7472c9ce408d58784b80f4cf1e3ae039c282986 --- core/java/android/inputmethodservice/InputMethodService.java | 2 -- .../internal/inputmethod/InputMethodPrivilegedOperations.java | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 44fed677318cf..60b11b4251846 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -2986,8 +2986,6 @@ public class InputMethodService extends AbstractInputMethodService { ImeTracing.getInstance().triggerServiceDump( "InputMethodService#applyVisibilityInInsetsConsumerIfNecessary", mDumper, null /* icProto */); - ImeTracker.forLogging().onProgress(mCurStatsToken, - ImeTracker.PHASE_IME_APPLY_VISIBILITY_INSETS_CONSUMER); mPrivOps.applyImeVisibilityAsync(setVisible ? mCurShowInputToken : mCurHideInputToken, setVisible, mCurStatsToken); } diff --git a/core/java/com/android/internal/inputmethod/InputMethodPrivilegedOperations.java b/core/java/com/android/internal/inputmethod/InputMethodPrivilegedOperations.java index 8a5c7ef18621d..30ebbe2bb111c 100644 --- a/core/java/com/android/internal/inputmethod/InputMethodPrivilegedOperations.java +++ b/core/java/com/android/internal/inputmethod/InputMethodPrivilegedOperations.java @@ -386,8 +386,12 @@ public final class InputMethodPrivilegedOperations { @Nullable ImeTracker.Token statsToken) { final IInputMethodPrivilegedOperations ops = mOps.getAndWarnIfNull(); if (ops == null) { + ImeTracker.forLogging().onFailed(statsToken, + ImeTracker.PHASE_IME_APPLY_VISIBILITY_INSETS_CONSUMER); return; } + ImeTracker.forLogging().onProgress(statsToken, + ImeTracker.PHASE_IME_APPLY_VISIBILITY_INSETS_CONSUMER); try { ops.applyImeVisibilityAsync(showOrHideInputToken, setVisible, statsToken); } catch (RemoteException e) {