Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c211f567 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Show logs when an app tries to show the IME

In order for us to be able to easily narrow down bugs that say
  "IMEs stopped being shown up"
this CL temporarily enables good-old debug messages to logcat whenever
an app is trying to show the IME with the following two APIs:

  * InputMethodManager#showSoftInput()
  * InsetsController#show(ime())

With these logs, we can easily see if the app was actually trying to
show the IME or something went wrong before the app calls these APIs.

Hopefully one day we can remove these Log.d() as part of our on-going
effort to improve IME debugging (Bug 154348613).

Bug: 171597353
Bug: 171637033
Bug: 171792138
Bug: 172731591
Test: adb logcat -s InputMethodManager:D InsetsController:D
Change-Id: I67a790f9d98d6131aaf04e4bb98d2a28873d3424
parent 2894862a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -828,6 +828,9 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation

    @VisibleForTesting
    public void show(@InsetsType int types, boolean fromIme) {
        if ((types & ime()) != 0) {
            Log.d(TAG, "show(ime(), fromIme=" + fromIme + ")");
        }
        if (fromIme) {
            ImeTracing.getInstance().triggerDump();
            Trace.asyncTraceEnd(TRACE_TAG_VIEW, "IC.showRequestFromApiToImeReady", 0);
+2 −0
Original line number Diff line number Diff line
@@ -1672,10 +1672,12 @@ public final class InputMethodManager {
        checkFocus();
        synchronized (mH) {
            if (!hasServedByInputMethodLocked(view)) {
                Log.w(TAG, "Ignoring showSoftInput() as view=" + view + " is not served.");
                return false;
            }

            try {
                Log.d(TAG, "showSoftInput() view=" + view + " flags=" + flags);
                return mService.showSoftInput(
                        mClient, view.getWindowToken(), flags, resultReceiver);
            } catch (RemoteException e) {