Factor out InputMethodManager#forContext()

This CL aims to factor out InputMethodManager#forContext() and its
related methods.  This is still a mechanical refactoring hence there
should be no behavior change.

Bug: 115893206
Bug: 117594679
Bug: 118335706
Test: atest ActivityManagerMultiDisplayTests
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:android.view.inputmethod.InputMethodManagerTest
Change-Id: I457745e18bfbd3e2787c5b438eee962a1928326e
1 file changed