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

Commit 1f3257d7 authored by Yohei Yukawa's avatar Yohei Yukawa Committed by Android (Google) Code Review
Browse files

Merge changes Iee47e374,Icc64942a

* changes:
  Use Context.getSystemService(Class<T>) for InputManager.
  Use Context.getSystemService(Class<T>) for InputMethodManager.
parents 259ce801 8ce2a538
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ public class NativeActivity extends Activity implements SurfaceHolder.Callback2,
        String funcname = "ANativeActivity_onCreate";
        ActivityInfo ai;

        mIMM = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
        mIMM = getSystemService(InputMethodManager.class);

        getWindow().takeSurface(this);
        getWindow().takeInputQueue(this);
+2 −4
Original line number Diff line number Diff line
@@ -505,8 +505,7 @@ public class SearchDialog extends Dialog {

        // We made sure the IME was displayed, so also make sure it is closed
        // when we go away.
        InputMethodManager imm = (InputMethodManager)getContext()
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        InputMethodManager imm = getContext().getSystemService(InputMethodManager.class);
        if (imm != null) {
            imm.hideSoftInputFromWindow(
                    getWindow().getDecorView().getWindowToken(), 0);
@@ -643,8 +642,7 @@ public class SearchDialog extends Dialog {
    public void onBackPressed() {
        // If the input method is covering the search dialog completely,
        // e.g. in landscape mode with no hard keyboard, dismiss just the input method
        InputMethodManager imm = (InputMethodManager)getContext()
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        InputMethodManager imm = getContext().getSystemService(InputMethodManager.class);
        if (imm != null && imm.isFullscreenMode() &&
                imm.hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(), 0)) {
            return;
+1 −2
Original line number Diff line number Diff line
@@ -61,8 +61,7 @@ public class FindActionModeCallback implements ActionMode.Callback, TextWatcher,
        setText("");
        mMatches = (TextView) mCustomView.findViewById(
                com.android.internal.R.id.matches);
        mInput = (InputMethodManager)
                context.getSystemService(Context.INPUT_METHOD_SERVICE);
        mInput = context.getSystemService(InputMethodManager.class);
        mResources = context.getResources();
    }

+2 −2
Original line number Diff line number Diff line
@@ -5755,8 +5755,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
            // The editor is off in its own window; we need to be
            // the one that does this.
            if (editorAction == EditorInfo.IME_ACTION_DONE) {
                InputMethodManager imm = (InputMethodManager)
                        getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
                InputMethodManager imm =
                        getContext().getSystemService(InputMethodManager.class);
                if (imm != null) {
                    imm.hideSoftInputFromWindow(getWindowToken(), 0);
                }
+4 −6
Original line number Diff line number Diff line
@@ -152,8 +152,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
     */
    private Runnable mShowImeRunnable = new Runnable() {
        public void run() {
            InputMethodManager imm = (InputMethodManager)
                    getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
            InputMethodManager imm = getContext().getSystemService(InputMethodManager.class);

            if (imm != null) {
                imm.showSoftInputUnchecked(0, null);
@@ -912,8 +911,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
            post(mShowImeRunnable);
        } else {
            removeCallbacks(mShowImeRunnable);
            InputMethodManager imm = (InputMethodManager)
                    getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
            InputMethodManager imm = getContext().getSystemService(InputMethodManager.class);

            if (imm != null) {
                imm.hideSoftInputFromWindow(getWindowToken(), 0);
@@ -1768,8 +1766,8 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
            super.onWindowFocusChanged(hasWindowFocus);

            if (hasWindowFocus && mSearchView.hasFocus() && getVisibility() == VISIBLE) {
                InputMethodManager inputManager = (InputMethodManager) getContext()
                        .getSystemService(Context.INPUT_METHOD_SERVICE);
                InputMethodManager inputManager =
                        getContext().getSystemService(InputMethodManager.class);
                inputManager.showSoftInput(this, 0);
                // If in landscape mode, then make sure that
                // the ime is in front of the dropdown.
Loading