Simplify getImmDelegate in ImeFocusController

This CL undoes part of [1] making removing a local variable.

[1]: Id4c85be1c0eab51f167ba00fc355386f852c424d

Test: make
Change-Id: I6b890e5536c17dd53722e2c3a781c85dd9d6bdf0
(cherry picked from commit d90033999f)
Merged-In:I6b890e5536c17dd53722e2c3a781c85dd9d6bdf0
This commit is contained in:
Nikolas Havrikov
2022-02-16 15:41:36 +01:00
committed by Cherrypicker Worker
parent 1755df787d
commit 87d1af1d80

View File

@@ -54,13 +54,11 @@ public final class ImeFocusController {
@NonNull
private InputMethodManagerDelegate getImmDelegate() {
InputMethodManagerDelegate delegate = mDelegate;
if (delegate != null) {
return delegate;
if (mDelegate == null) {
mDelegate = mViewRootImpl.mContext.getSystemService(
InputMethodManager.class).getDelegate();
}
delegate = mViewRootImpl.mContext.getSystemService(InputMethodManager.class).getDelegate();
mDelegate = delegate;
return delegate;
return mDelegate;
}
/** Called when the view root is moved to a different display. */