Loading api/current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -12480,6 +12480,7 @@ package android.inputmethodservice { method public void setBackDisposition(int); method public void setCandidatesView(android.view.View); method public void setCandidatesViewShown(boolean); method public void setCursorAnchorMonitorMode(int); method public void setExtractView(android.view.View); method public void setExtractViewShown(boolean); method public void setInputView(android.view.View); Loading @@ -12491,6 +12492,8 @@ package android.inputmethodservice { field public static final int BACK_DISPOSITION_DEFAULT = 0; // 0x0 field public static final int BACK_DISPOSITION_WILL_DISMISS = 2; // 0x2 field public static final int BACK_DISPOSITION_WILL_NOT_DISMISS = 1; // 0x1 field public static final int CURSOR_ANCHOR_MONITOR_MODE_CURSOR_RECT = 1; // 0x1 field public static final int CURSOR_ANCHOR_MONITOR_MODE_NONE = 0; // 0x0 } public class InputMethodService.InputMethodImpl extends android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodImpl { core/java/android/inputmethodservice/InputMethodService.java +17 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,16 @@ public class InputMethodService extends AbstractInputMethodService { */ public static final int IME_VISIBLE = 0x2; /** * The IME does not require cursor/anchor position. */ public static final int CURSOR_ANCHOR_MONITOR_MODE_NONE = 0x0; /** * The IME expects that {@link #onUpdateCursor(Rect)} is called back. */ public static final int CURSOR_ANCHOR_MONITOR_MODE_CURSOR_RECT = 0x1; InputMethodManager mImm; int mTheme = 0; Loading Loading @@ -1701,6 +1711,13 @@ public class InputMethodService extends AbstractInputMethodService { // Intentionally empty } /** * Update the cursor/anthor monitor mode. */ public void setCursorAnchorMonitorMode(int monitorMode) { mImm.setCursorAnchorMonitorMode(mToken, monitorMode); } /** * Close this input method's soft input area, removing it from the display. * The input method will continue running, but the user can no longer use Loading core/java/android/view/inputmethod/InputMethodManager.java +42 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import com.android.internal.view.InputBindResult; import android.content.Context; import android.graphics.Rect; import android.inputmethodservice.InputMethodService; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; Loading @@ -41,13 +42,13 @@ import android.util.Pools.Pool; import android.util.Pools.SimplePool; import android.util.PrintWriterPrinter; import android.util.Printer; import android.util.SparseArray; import android.view.InputChannel; import android.view.InputEvent; import android.view.InputEventSender; import android.view.KeyEvent; import android.view.View; import android.view.ViewRootImpl; import android.util.SparseArray; import java.io.FileDescriptor; import java.io.PrintWriter; Loading Loading @@ -334,6 +335,11 @@ public final class InputMethodManager { InputChannel mCurChannel; ImeInputEventSender mCurSender; /** * The current cursor/anchor monitor mode. */ int mCursorAnchorMonitorMode = InputMethodService.CURSOR_ANCHOR_MONITOR_MODE_NONE; final Pool<PendingEvent> mPendingEventPool = new SimplePool<PendingEvent>(20); final SparseArray<PendingEvent> mPendingEvents = new SparseArray<PendingEvent>(20); Loading @@ -346,6 +352,7 @@ public final class InputMethodManager { static final int MSG_SEND_INPUT_EVENT = 5; static final int MSG_TIMEOUT_INPUT_EVENT = 6; static final int MSG_FLUSH_INPUT_EVENT = 7; static final int SET_CURSOR_ANCHOR_MONITOR_MODE = 8; class H extends Handler { H(Looper looper) { Loading Loading @@ -476,6 +483,12 @@ public final class InputMethodManager { finishedInputEvent(msg.arg1, false, false); return; } case SET_CURSOR_ANCHOR_MONITOR_MODE: { synchronized (mH) { mCursorAnchorMonitorMode = msg.arg1; } return; } } } } Loading Loading @@ -540,6 +553,11 @@ public final class InputMethodManager { public void setActive(boolean active) { mH.sendMessage(mH.obtainMessage(MSG_SET_ACTIVE, active ? 1 : 0, 0)); } @Override public void setCursorAnchorMonitorMode(int monitorMode) { mH.sendMessage(mH.obtainMessage(SET_CURSOR_ANCHOR_MONITOR_MODE, monitorMode, 0)); } }; final InputConnection mDummyInputConnection = new BaseInputConnection(this, false); Loading Loading @@ -1465,8 +1483,29 @@ public final class InputMethodManager { * of the input editor's cursor in its window. */ public boolean isWatchingCursor(View view) { if (!isActive(view)) { return false; } synchronized (mH) { return mCursorAnchorMonitorMode == InputMethodService.CURSOR_ANCHOR_MONITOR_MODE_CURSOR_RECT; } } /** * Set cursor/anchor monitor mode via {@link com.android.server.InputMethodManagerService}. * This is an internal method for {@link android.inputmethodservice.InputMethodService} and * should never be used from IMEs and applications. * * @hide */ public void setCursorAnchorMonitorMode(IBinder imeToken, int monitorMode) { try { mService.setCursorAnchorMonitorMode(imeToken, monitorMode); } catch (RemoteException e) { throw new RuntimeException(e); } } /** * Report the current cursor location in its window. Loading core/java/com/android/internal/view/IInputMethodClient.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -27,4 +27,5 @@ oneway interface IInputMethodClient { void onBindMethod(in InputBindResult res); void onUnbindMethod(int sequence); void setActive(boolean active); void setCursorAnchorMonitorMode(int monitorMode); } core/java/com/android/internal/view/IInputMethodManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -78,4 +78,5 @@ interface IInputMethodManager { void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes); int getInputMethodWindowVisibleHeight(); oneway void notifyTextCommitted(); void setCursorAnchorMonitorMode(in IBinder token, int monitorMode); } Loading
api/current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -12480,6 +12480,7 @@ package android.inputmethodservice { method public void setBackDisposition(int); method public void setCandidatesView(android.view.View); method public void setCandidatesViewShown(boolean); method public void setCursorAnchorMonitorMode(int); method public void setExtractView(android.view.View); method public void setExtractViewShown(boolean); method public void setInputView(android.view.View); Loading @@ -12491,6 +12492,8 @@ package android.inputmethodservice { field public static final int BACK_DISPOSITION_DEFAULT = 0; // 0x0 field public static final int BACK_DISPOSITION_WILL_DISMISS = 2; // 0x2 field public static final int BACK_DISPOSITION_WILL_NOT_DISMISS = 1; // 0x1 field public static final int CURSOR_ANCHOR_MONITOR_MODE_CURSOR_RECT = 1; // 0x1 field public static final int CURSOR_ANCHOR_MONITOR_MODE_NONE = 0; // 0x0 } public class InputMethodService.InputMethodImpl extends android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodImpl {
core/java/android/inputmethodservice/InputMethodService.java +17 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,16 @@ public class InputMethodService extends AbstractInputMethodService { */ public static final int IME_VISIBLE = 0x2; /** * The IME does not require cursor/anchor position. */ public static final int CURSOR_ANCHOR_MONITOR_MODE_NONE = 0x0; /** * The IME expects that {@link #onUpdateCursor(Rect)} is called back. */ public static final int CURSOR_ANCHOR_MONITOR_MODE_CURSOR_RECT = 0x1; InputMethodManager mImm; int mTheme = 0; Loading Loading @@ -1701,6 +1711,13 @@ public class InputMethodService extends AbstractInputMethodService { // Intentionally empty } /** * Update the cursor/anthor monitor mode. */ public void setCursorAnchorMonitorMode(int monitorMode) { mImm.setCursorAnchorMonitorMode(mToken, monitorMode); } /** * Close this input method's soft input area, removing it from the display. * The input method will continue running, but the user can no longer use Loading
core/java/android/view/inputmethod/InputMethodManager.java +42 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import com.android.internal.view.InputBindResult; import android.content.Context; import android.graphics.Rect; import android.inputmethodservice.InputMethodService; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; Loading @@ -41,13 +42,13 @@ import android.util.Pools.Pool; import android.util.Pools.SimplePool; import android.util.PrintWriterPrinter; import android.util.Printer; import android.util.SparseArray; import android.view.InputChannel; import android.view.InputEvent; import android.view.InputEventSender; import android.view.KeyEvent; import android.view.View; import android.view.ViewRootImpl; import android.util.SparseArray; import java.io.FileDescriptor; import java.io.PrintWriter; Loading Loading @@ -334,6 +335,11 @@ public final class InputMethodManager { InputChannel mCurChannel; ImeInputEventSender mCurSender; /** * The current cursor/anchor monitor mode. */ int mCursorAnchorMonitorMode = InputMethodService.CURSOR_ANCHOR_MONITOR_MODE_NONE; final Pool<PendingEvent> mPendingEventPool = new SimplePool<PendingEvent>(20); final SparseArray<PendingEvent> mPendingEvents = new SparseArray<PendingEvent>(20); Loading @@ -346,6 +352,7 @@ public final class InputMethodManager { static final int MSG_SEND_INPUT_EVENT = 5; static final int MSG_TIMEOUT_INPUT_EVENT = 6; static final int MSG_FLUSH_INPUT_EVENT = 7; static final int SET_CURSOR_ANCHOR_MONITOR_MODE = 8; class H extends Handler { H(Looper looper) { Loading Loading @@ -476,6 +483,12 @@ public final class InputMethodManager { finishedInputEvent(msg.arg1, false, false); return; } case SET_CURSOR_ANCHOR_MONITOR_MODE: { synchronized (mH) { mCursorAnchorMonitorMode = msg.arg1; } return; } } } } Loading Loading @@ -540,6 +553,11 @@ public final class InputMethodManager { public void setActive(boolean active) { mH.sendMessage(mH.obtainMessage(MSG_SET_ACTIVE, active ? 1 : 0, 0)); } @Override public void setCursorAnchorMonitorMode(int monitorMode) { mH.sendMessage(mH.obtainMessage(SET_CURSOR_ANCHOR_MONITOR_MODE, monitorMode, 0)); } }; final InputConnection mDummyInputConnection = new BaseInputConnection(this, false); Loading Loading @@ -1465,8 +1483,29 @@ public final class InputMethodManager { * of the input editor's cursor in its window. */ public boolean isWatchingCursor(View view) { if (!isActive(view)) { return false; } synchronized (mH) { return mCursorAnchorMonitorMode == InputMethodService.CURSOR_ANCHOR_MONITOR_MODE_CURSOR_RECT; } } /** * Set cursor/anchor monitor mode via {@link com.android.server.InputMethodManagerService}. * This is an internal method for {@link android.inputmethodservice.InputMethodService} and * should never be used from IMEs and applications. * * @hide */ public void setCursorAnchorMonitorMode(IBinder imeToken, int monitorMode) { try { mService.setCursorAnchorMonitorMode(imeToken, monitorMode); } catch (RemoteException e) { throw new RuntimeException(e); } } /** * Report the current cursor location in its window. Loading
core/java/com/android/internal/view/IInputMethodClient.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -27,4 +27,5 @@ oneway interface IInputMethodClient { void onBindMethod(in InputBindResult res); void onUnbindMethod(int sequence); void setActive(boolean active); void setCursorAnchorMonitorMode(int monitorMode); }
core/java/com/android/internal/view/IInputMethodManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -78,4 +78,5 @@ interface IInputMethodManager { void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes); int getInputMethodWindowVisibleHeight(); oneway void notifyTextCommitted(); void setCursorAnchorMonitorMode(in IBinder token, int monitorMode); }