From 0297051162193ef2b7d906409868e404f77e4c31 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Thu, 5 Jun 2014 16:16:18 +0900 Subject: [PATCH] Trivial method renaming for notifyTextCommitted This CL does not change existing behavior but only renames notifyTextCommitted with notifyUserAction so that we can use not only text commit but also other actions such as just typing a character will be used as a trigger to update the IME rotation order for better IME switching experience. BUG: 7043015 Change-Id: I7f3e13a7226ef0dceee82b67e8a0d8536f7e9807 --- .../android/view/inputmethod/BaseInputConnection.java | 3 +-- .../android/view/inputmethod/InputMethodManager.java | 6 +++--- .../InputMethodSubtypeSwitchingController.java | 2 +- .../com/android/internal/view/IInputMethodManager.aidl | 2 +- .../com/android/server/InputMethodManagerService.java | 6 +++--- .../bridge/android/BridgeIInputMethodManager.java | 9 ++++----- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/core/java/android/view/inputmethod/BaseInputConnection.java b/core/java/android/view/inputmethod/BaseInputConnection.java index cccfa78544e8e..a74e3a0521051 100644 --- a/core/java/android/view/inputmethod/BaseInputConnection.java +++ b/core/java/android/view/inputmethod/BaseInputConnection.java @@ -602,8 +602,7 @@ public class BaseInputConnection implements InputConnection { beginBatchEdit(); if (!composing && !TextUtils.isEmpty(text)) { - // Notify the text is committed by the user to InputMethodManagerService - mIMM.notifyTextCommitted(); + mIMM.notifyUserAction(); } // delete composing text set previously. diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index f874eb7b6107b..70f905d0397f2 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -1913,13 +1913,13 @@ public final class InputMethodManager { } /** - * Notify the current IME commits text + * Notify that a user took some action with this input method. * @hide */ - public void notifyTextCommitted() { + public void notifyUserAction() { synchronized (mH) { try { - mService.notifyTextCommitted(); + mService.notifyUserAction(); } catch (RemoteException e) { Log.w(TAG, "IME died: " + mCurId, e); } diff --git a/core/java/com/android/internal/inputmethod/InputMethodSubtypeSwitchingController.java b/core/java/com/android/internal/inputmethod/InputMethodSubtypeSwitchingController.java index 7dbde699b4fa5..fdd24a6b9e665 100644 --- a/core/java/com/android/internal/inputmethod/InputMethodSubtypeSwitchingController.java +++ b/core/java/com/android/internal/inputmethod/InputMethodSubtypeSwitchingController.java @@ -468,7 +468,7 @@ public class InputMethodSubtypeSwitchingController { return new InputMethodSubtypeSwitchingController(settings, context); } - public void onCommitTextLocked(InputMethodInfo imi, InputMethodSubtype subtype) { + public void onUserActionLocked(InputMethodInfo imi, InputMethodSubtype subtype) { if (mController == null) { if (DEBUG) { Log.e(TAG, "mController shouldn't be null."); diff --git a/core/java/com/android/internal/view/IInputMethodManager.aidl b/core/java/com/android/internal/view/IInputMethodManager.aidl index 5336174abddb2..4590520610aa4 100644 --- a/core/java/com/android/internal/view/IInputMethodManager.aidl +++ b/core/java/com/android/internal/view/IInputMethodManager.aidl @@ -77,6 +77,6 @@ interface IInputMethodManager { boolean setInputMethodEnabled(String id, boolean enabled); void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes); int getInputMethodWindowVisibleHeight(); - oneway void notifyTextCommitted(); + oneway void notifyUserAction(); void setCursorAnchorMonitorMode(in IBinder token, int monitorMode); } diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java index 11d6a5582158d..251247c26b9ca 100644 --- a/services/core/java/com/android/server/InputMethodManagerService.java +++ b/services/core/java/com/android/server/InputMethodManagerService.java @@ -2310,14 +2310,14 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } @Override - public void notifyTextCommitted() { + public void notifyUserAction() { if (DEBUG) { - Slog.d(TAG, "Got the notification of commitText"); + Slog.d(TAG, "Got the notification of a user action"); } synchronized (mMethodMap) { final InputMethodInfo imi = mMethodMap.get(mCurMethodId); if (imi != null) { - mSwitchingController.onCommitTextLocked(imi, mCurrentSubtype); + mSwitchingController.onUserActionLocked(imi, mCurrentSubtype); } } } diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java index 0bb7fc27d5a2e..66268f28602a6 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java @@ -135,7 +135,6 @@ public class BridgeIInputMethodManager implements IInputMethodManager { @Override public void setImeWindowStatus(IBinder arg0, int arg1, int arg2) throws RemoteException { // TODO Auto-generated method stub - } @Override @@ -197,25 +196,25 @@ public class BridgeIInputMethodManager implements IInputMethodManager { } @Override - public boolean switchToNextInputMethod(IBinder arg0, boolean arg1) throws RemoteException { + public boolean switchToNextInputMethod(IBinder arg0, boolean arg1) throws RemoteException { // TODO Auto-generated method stub return false; } @Override - public boolean shouldOfferSwitchingToNextInputMethod(IBinder arg0) throws RemoteException { + public boolean shouldOfferSwitchingToNextInputMethod(IBinder arg0) throws RemoteException { // TODO Auto-generated method stub return false; } @Override - public int getInputMethodWindowVisibleHeight() throws RemoteException { + public int getInputMethodWindowVisibleHeight() throws RemoteException { // TODO Auto-generated method stub return 0; } @Override - public void notifyTextCommitted() throws RemoteException { + public void notifyUserAction() throws RemoteException { // TODO Auto-generated method stub }