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

Commit 8a75baf9 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Stop logging RuntimeException in IMMS#onTransact()

InputMethodManagerService has had a custom hook in its #onTransact()
to log all RuntimeException except for SecurityException, probably to
be able to catch newly introduced runtime exceptions with wtf logging.

However, we haven't actually checked the log, and having a logcat
message like

  Input Method Manager Crash

is just confusing, especially when testing such an edge case in CTS.

Let's simply drop this mechanism in favor of simplicity.

Fix: 156756151
Test: manually done as follows
 1. build aosp_bluejay-trunk_staging-userdebug and flash it
 2. adb logcat -c
 3. test CtsInputMethodTestCases:InputMethodSubtypeTest
 4. adb logcat -s InputMethodManagerService:E
   -> There is no message like "Input Method Manager Crash"
Change-Id: I773ccc7ab305a496195b78966ea97522796db8d7
parent 4018e543
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -92,7 +92,6 @@ import android.os.IBinder;
import android.os.LocaleList;
import android.os.Looper;
import android.os.Message;
import android.os.Parcel;
import android.os.Process;
import android.os.RemoteException;
import android.os.ResultReceiver;
@@ -1870,21 +1869,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                        false /* enabledOnly */));
    }

    @Override
    public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
            throws RemoteException {
        try {
            return super.onTransact(code, data, reply, flags);
        } catch (RuntimeException e) {
            // The input method manager only throws security exceptions, so let's
            // log all others.
            if (!(e instanceof SecurityException)) {
                Slog.wtf(TAG, "Input Method Manager Crash", e);
            }
            throw e;
        }
    }

    /**
     * TODO(b/32343335): The entire systemRunning() method needs to be revisited.
     */