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

Commit 02970511 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

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
parent b6011c1c
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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.
+3 −3
Original line number Diff line number Diff line
@@ -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);
            }
+1 −1
Original line number Diff line number Diff line
@@ -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.");
+1 −1
Original line number Diff line number Diff line
@@ -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);
}
+3 −3
Original line number Diff line number Diff line
@@ -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);
            }
        }
    }
Loading