Loading core/java/android/text/style/SuggestionSpan.java +1 −1 Original line number Diff line number Diff line Loading @@ -420,7 +420,7 @@ public class SuggestionSpan extends CharacterStyle implements ParcelableSpan { intent.putExtra(SuggestionSpan.SUGGESTION_SPAN_PICKED_HASHCODE, hashCode()); context.sendBroadcast(intent); } else { InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = context.getSystemService(InputMethodManager.class); if (imm != null) { imm.notifySuggestionPicked(this, original, index); } Loading core/java/android/view/View.java +5 −5 Original line number Diff line number Diff line Loading @@ -7315,7 +7315,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, // Here we check whether we still need the default focus highlight, and switch it on/off. switchDefaultFocusHighlight(); InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = getContext().getSystemService(InputMethodManager.class); if (!gainFocus) { if (isPressed()) { setPressed(false); Loading Loading @@ -12476,7 +12476,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mPrivateFlags3 &= ~PFLAG3_TEMPORARY_DETACH; onFinishTemporaryDetach(); if (hasWindowFocus() && hasFocus()) { InputMethodManager.getInstance().focusIn(this); getContext().getSystemService(InputMethodManager.class).focusIn(this); } notifyEnterOrExitForAutoFillIfNeeded(true); } Loading Loading @@ -12867,7 +12867,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * focus, false otherwise. */ public void onWindowFocusChanged(boolean hasWindowFocus) { InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = getContext().getSystemService(InputMethodManager.class); if (!hasWindowFocus) { if (isPressed()) { setPressed(false); Loading Loading @@ -17932,7 +17932,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, rebuildOutline(); if (isFocused()) { InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = getContext().getSystemService(InputMethodManager.class); if (imm != null) { imm.focusIn(this); } Loading Loading @@ -18515,7 +18515,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, onDetachedFromWindow(); onDetachedFromWindowInternal(); InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = getContext().getSystemService(InputMethodManager.class); if (imm != null) { imm.onViewDetachedFromWindow(this); } core/java/android/view/ViewRootImpl.java +4 −4 Original line number Diff line number Diff line Loading @@ -2579,7 +2579,7 @@ public final class ViewRootImpl implements ViewParent, .mayUseInputMethod(mWindowAttributes.flags); if (imTarget != mLastWasImTarget) { mLastWasImTarget = imTarget; InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = mContext.getSystemService(InputMethodManager.class); if (imm != null && imTarget) { imm.onPreWindowFocus(mView, hasWindowFocus); imm.onPostWindowFocus(mView, mView.findFocus(), Loading Loading @@ -2695,7 +2695,7 @@ public final class ViewRootImpl implements ViewParent, mLastWasImTarget = WindowManager.LayoutParams .mayUseInputMethod(mWindowAttributes.flags); InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = mContext.getSystemService(InputMethodManager.class); if (imm != null && mLastWasImTarget && !isInLocalFocusMode()) { imm.onPreWindowFocus(mView, hasWindowFocus); } Loading Loading @@ -4329,7 +4329,7 @@ public final class ViewRootImpl implements ViewParent, enqueueInputEvent(event, null, 0, true); } break; case MSG_CHECK_FOCUS: { InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = mContext.getSystemService(InputMethodManager.class); if (imm != null) { imm.checkFocus(); } Loading Loading @@ -4871,7 +4871,7 @@ public final class ViewRootImpl implements ViewParent, @Override protected int onProcess(QueuedInputEvent q) { if (mLastWasImTarget && !isInLocalFocusMode()) { InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = mContext.getSystemService(InputMethodManager.class); if (imm != null) { final InputEvent event = q.mEvent; if (DEBUG_IMF) Log.v(mTag, "Sending input event to IME: " + event); Loading core/java/android/view/WindowManagerGlobal.java +1 −1 Original line number Diff line number Diff line Loading @@ -468,7 +468,7 @@ public final class WindowManagerGlobal { View view = root.getView(); if (view != null) { InputMethodManager imm = InputMethodManager.getInstance(); InputMethodManager imm = view.getContext().getSystemService(InputMethodManager.class); if (imm != null) { imm.windowDismissed(mViews.get(index).getWindowToken()); } Loading core/java/android/view/inputmethod/InputMethodManager.java +4 −2 Original line number Diff line number Diff line Loading @@ -665,10 +665,12 @@ public final class InputMethodManager { } /** * Private optimization: retrieve the global InputMethodManager instance, * if it exists. * Private optimization: retrieve the global InputMethodManager instance, if it exists. * @hide * @deprecated Use {@link Context#getSystemService(Class)} instead. This method cannot fully * support multi-display scenario. */ @Deprecated @UnsupportedAppUsage public static InputMethodManager peekInstance() { return sInstance; Loading Loading
core/java/android/text/style/SuggestionSpan.java +1 −1 Original line number Diff line number Diff line Loading @@ -420,7 +420,7 @@ public class SuggestionSpan extends CharacterStyle implements ParcelableSpan { intent.putExtra(SuggestionSpan.SUGGESTION_SPAN_PICKED_HASHCODE, hashCode()); context.sendBroadcast(intent); } else { InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = context.getSystemService(InputMethodManager.class); if (imm != null) { imm.notifySuggestionPicked(this, original, index); } Loading
core/java/android/view/View.java +5 −5 Original line number Diff line number Diff line Loading @@ -7315,7 +7315,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, // Here we check whether we still need the default focus highlight, and switch it on/off. switchDefaultFocusHighlight(); InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = getContext().getSystemService(InputMethodManager.class); if (!gainFocus) { if (isPressed()) { setPressed(false); Loading Loading @@ -12476,7 +12476,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mPrivateFlags3 &= ~PFLAG3_TEMPORARY_DETACH; onFinishTemporaryDetach(); if (hasWindowFocus() && hasFocus()) { InputMethodManager.getInstance().focusIn(this); getContext().getSystemService(InputMethodManager.class).focusIn(this); } notifyEnterOrExitForAutoFillIfNeeded(true); } Loading Loading @@ -12867,7 +12867,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * focus, false otherwise. */ public void onWindowFocusChanged(boolean hasWindowFocus) { InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = getContext().getSystemService(InputMethodManager.class); if (!hasWindowFocus) { if (isPressed()) { setPressed(false); Loading Loading @@ -17932,7 +17932,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, rebuildOutline(); if (isFocused()) { InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = getContext().getSystemService(InputMethodManager.class); if (imm != null) { imm.focusIn(this); } Loading Loading @@ -18515,7 +18515,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, onDetachedFromWindow(); onDetachedFromWindowInternal(); InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = getContext().getSystemService(InputMethodManager.class); if (imm != null) { imm.onViewDetachedFromWindow(this); }
core/java/android/view/ViewRootImpl.java +4 −4 Original line number Diff line number Diff line Loading @@ -2579,7 +2579,7 @@ public final class ViewRootImpl implements ViewParent, .mayUseInputMethod(mWindowAttributes.flags); if (imTarget != mLastWasImTarget) { mLastWasImTarget = imTarget; InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = mContext.getSystemService(InputMethodManager.class); if (imm != null && imTarget) { imm.onPreWindowFocus(mView, hasWindowFocus); imm.onPostWindowFocus(mView, mView.findFocus(), Loading Loading @@ -2695,7 +2695,7 @@ public final class ViewRootImpl implements ViewParent, mLastWasImTarget = WindowManager.LayoutParams .mayUseInputMethod(mWindowAttributes.flags); InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = mContext.getSystemService(InputMethodManager.class); if (imm != null && mLastWasImTarget && !isInLocalFocusMode()) { imm.onPreWindowFocus(mView, hasWindowFocus); } Loading Loading @@ -4329,7 +4329,7 @@ public final class ViewRootImpl implements ViewParent, enqueueInputEvent(event, null, 0, true); } break; case MSG_CHECK_FOCUS: { InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = mContext.getSystemService(InputMethodManager.class); if (imm != null) { imm.checkFocus(); } Loading Loading @@ -4871,7 +4871,7 @@ public final class ViewRootImpl implements ViewParent, @Override protected int onProcess(QueuedInputEvent q) { if (mLastWasImTarget && !isInLocalFocusMode()) { InputMethodManager imm = InputMethodManager.peekInstance(); InputMethodManager imm = mContext.getSystemService(InputMethodManager.class); if (imm != null) { final InputEvent event = q.mEvent; if (DEBUG_IMF) Log.v(mTag, "Sending input event to IME: " + event); Loading
core/java/android/view/WindowManagerGlobal.java +1 −1 Original line number Diff line number Diff line Loading @@ -468,7 +468,7 @@ public final class WindowManagerGlobal { View view = root.getView(); if (view != null) { InputMethodManager imm = InputMethodManager.getInstance(); InputMethodManager imm = view.getContext().getSystemService(InputMethodManager.class); if (imm != null) { imm.windowDismissed(mViews.get(index).getWindowToken()); } Loading
core/java/android/view/inputmethod/InputMethodManager.java +4 −2 Original line number Diff line number Diff line Loading @@ -665,10 +665,12 @@ public final class InputMethodManager { } /** * Private optimization: retrieve the global InputMethodManager instance, * if it exists. * Private optimization: retrieve the global InputMethodManager instance, if it exists. * @hide * @deprecated Use {@link Context#getSystemService(Class)} instead. This method cannot fully * support multi-display scenario. */ @Deprecated @UnsupportedAppUsage public static InputMethodManager peekInstance() { return sInstance; Loading