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

Commit 321550e7 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Move trace points to IMMS#onSessionCreated()

This is a follow up CL to our previous CL [1], which introduced
invocations of Trace.trace{Begin,End} into

  InputMethodManagerService.MethodCallback#sessionCreated()

with trace tag:

  "IMMS.sessionCreated".

In order to inline InputMethodManagerService.MethodCallback,

this CL moves these Trace.trace{Begin,End} to

  InputMethodManagerService#onSessionCreated(),

with renaming the tag to

  "IMMS.onSessionCreated".

Other than that, there is no observable behavior change in this CL.

 [1]: I586341426916f9b9e0f1efe988894621972da4ff
      d663b621

Bug: 167947940
Bug: 192412909
Test: presubmit
Change-Id: I4135737825befff9e696f47c153a209de4adb0e3
parent daeda6e7
Loading
Loading
Loading
Loading
+30 −26
Original line number Diff line number Diff line
@@ -1478,14 +1478,12 @@ public class InputMethodManagerService extends IInputMethodManager.Stub

        @Override
        public void sessionCreated(IInputMethodSession session) {
            Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMMS.sessionCreated");
            final long ident = Binder.clearCallingIdentity();
            try {
                mParentIMMS.onSessionCreated(mMethod, session, mChannel);
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
            Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
        }
    }

@@ -2539,11 +2537,14 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        mCaller.obtainMessageI(MSG_NOTIFY_IME_UID_TO_AUDIO_SERVICE, uid).sendToTarget();
    }

    void onSessionCreated(IInputMethod method, IInputMethodSession session,
            InputChannel channel) {
    @BinderThread
    void onSessionCreated(IInputMethod method, IInputMethodSession session, InputChannel channel) {
        Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMMS.onSessionCreated");
        try {
            synchronized (ImfLock.class) {
                if (mUserSwitchHandlerTask != null) {
                // We have a pending user-switching task so it's better to just ignore this session.
                    // We have a pending user-switching task so it's better to just ignore this
                    // session.
                    channel.dispose();
                    return;
                }
@@ -2567,6 +2568,9 @@ public class InputMethodManagerService extends IInputMethodManager.Stub

            // Session abandoned.  Close its associated input channel.
            channel.dispose();
        } finally {
            Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
        }
    }

    @GuardedBy("ImfLock.class")