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

Commit 75338fd3 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Declare IMM#mIInputContext with its concrete type

This is a small refactoring that changes no semantics but just reduces
some boilerplate code in InputMethodManager.

We know that IMM#mIInputContext is guaranteed to be an instance of
IInputConnectionWrapper, we can reduce some boilerplate code by using
its concrete class when declaring it.

Using its concrete type would also helps the runtime and AOT compiler
do optimizations such as devirtualization because
IInputConnectionWrapper is already declared as a final class.

Other that such code reduction and plausible performance implications,
there should be no behavior change in this CL.

Bug: 192412909
Test: presubmit
Change-Id: I2ee22292feeb6c806d2949bc05f2780923597e1b
parent c577086e
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -366,7 +366,7 @@ public final class InputMethodManager {
    final H mH;

    // Our generic input connection if the current target does not have its own.
    final IInputContext mIInputContext;
    private final IInputConnectionWrapper mIInputContext;

    private final int mDisplayId;

@@ -920,12 +920,9 @@ public final class InputMethodManager {
                            // that this happened and make sure our own editor's
                            // state is reset.
                            mRestartOnNextWindowFocus = true;
                            try {
                            // Note that finishComposingText() is allowed to run
                            // even when we are not active.
                            mIInputContext.finishComposingText();
                            } catch (RemoteException e) {
                            }
                        }
                        // Check focus again in case that "onWindowFocus" is called before
                        // handling this message.