From a9427152d2473d953f0f08da0aa82cd212da89b1 Mon Sep 17 00:00:00 2001 From: Michael Klimushyn <mklim@google.com> Date: Mon, 30 Sep 2019 14:00:56 -0700 Subject: [PATCH] Downgrade InputMethodManager getFallbackIMM logs Previously the IMM was logging error and warning logs every single time it attempted to use an IMM method and ended up with the fallback IMM. This is both extremely noisy since the IMM is accessed multiple times per second in the case of the user typing and a little misleading since this isn't truly an error condition on its own. Downgrade the log to a VERBOSE log. This will still show up for apps when in development but is less likely to wander into bug reports for released apps. Bug: 141884160 Fixes: 141884160 Test: Manually. Trigerred error condition and verified log level. Change-Id: If25ef81c6b74679ebfa725f0c98e0bc633399e70 --- core/java/android/view/inputmethod/InputMethodManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index 032af1c5c7b58..6420d71216cdb 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -525,16 +525,16 @@ public final class InputMethodManager { final InputMethodManager fallbackImm = viewRootImpl.mContext.getSystemService(InputMethodManager.class); if (fallbackImm == null) { - Log.e(TAG, "b/117267690: Failed to get non-null fallback IMM. view=" + view); + Log.v(TAG, "b/117267690: Failed to get non-null fallback IMM. view=" + view); return null; } if (fallbackImm.mDisplayId != viewRootDisplayId) { - Log.e(TAG, "b/117267690: Failed to get fallback IMM with expected displayId=" + Log.v(TAG, "b/117267690: Failed to get fallback IMM with expected displayId=" + viewRootDisplayId + " actual IMM#displayId=" + fallbackImm.mDisplayId + " view=" + view); return null; } - Log.w(TAG, "b/117267690: Display ID mismatch found." + Log.v(TAG, "b/117267690: Display ID mismatch found." + " ViewRootImpl displayId=" + viewRootDisplayId + " InputMethodManager displayId=" + mDisplayId + ". Use the right InputMethodManager instance to avoid performance overhead.", -- GitLab