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

Commit 9a21937d authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Let ImeTrackerService use our own Handler

This is a preparation before making

  InputMethodManagerService#mImeDrawsImeNavBarRes

per-user instance.

While ImeTrackerService has been using the main thread since it was
originally introduced [1], I guess there was no strong reason to not
use other thread. Let's just use IMMS#mHandler in favor of simplicity.

There should be no semantic change in this CL.

 [1]: I432bab2de58a9df2c421bb00946ab211de445660
      89f36a77

Bug: 345519864
Test: presubmit
Flag: Flag: EXEMPT refactor
Change-Id: Ief87250b8892fefcc645d2324ef5b73e3bab3cb5
parent 083bbcfe
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.annotation.Nullable;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.util.Log;
import android.view.inputmethod.ImeTracker;

@@ -70,8 +69,8 @@ public final class ImeTrackerService extends IImeTracker.Stub {

    private final Object mLock = new Object();

    ImeTrackerService(@NonNull Looper looper) {
        mHandler = new Handler(looper, null /* callback */, true /* async */);
    ImeTrackerService(@NonNull Handler handler) {
        mHandler = handler;
    }

    @NonNull
+1 −3
Original line number Diff line number Diff line
@@ -90,7 +90,6 @@ import android.os.Debug;
import android.os.Handler;
import android.os.IBinder;
import android.os.LocaleList;
import android.os.Looper;
import android.os.Message;
import android.os.Process;
import android.os.RemoteException;
@@ -1258,8 +1257,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                mIoHandler = Handler.createAsync(ioThread.getLooper());
            }
            SystemLocaleWrapper.onStart(context, this::onActionLocaleChanged, mHandler);
            mImeTrackerService = new ImeTrackerService(serviceThreadForTesting != null
                    ? serviceThreadForTesting.getLooper() : Looper.getMainLooper());
            mImeTrackerService = new ImeTrackerService(mHandler);
            // Note: SettingsObserver doesn't register observers in its constructor.
            mSettingsObserver = new SettingsObserver(mHandler);
            mWindowManagerInternal = LocalServices.getService(WindowManagerInternal.class);