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

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

Use consistent parameter/variable name for EditorInfo

There are several places where EditorInfo is still called "attribute"
in our code base.  Let's call them "editorInfo" or something like that
for better readability.

This is just a mechanical code clean-up.  There should be no behavior
change and compability concern.

Fix: 237008479
Test: presubmit
Change-Id: Idd147940c34ab5fd39b2d11b2acb1554c7d8f26d
parent 0004736c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -351,7 +351,7 @@ class IInputMethodWrapper extends IInputMethod.Stub
    @BinderThread
    @Override
    public void startInput(IBinder startInputToken, IRemoteInputConnection inputConnection,
            EditorInfo attribute, boolean restarting,
            EditorInfo editorInfo, boolean restarting,
            @InputMethodNavButtonFlags int navButtonFlags,
            @NonNull ImeOnBackInvokedDispatcher imeDispatcher) {
        if (mCancellationGroup == null) {
@@ -361,7 +361,7 @@ class IInputMethodWrapper extends IInputMethod.Stub
        final SomeArgs args = SomeArgs.obtain();
        args.arg1 = startInputToken;
        args.arg2 = inputConnection;
        args.arg3 = attribute;
        args.arg3 = editorInfo;
        args.argi1 = restarting ? 1 : 0;
        args.argi2 = navButtonFlags;
        args.arg4 = imeDispatcher;
+15 −15
Original line number Diff line number Diff line
@@ -796,10 +796,10 @@ public class InputMethodService extends AbstractInputMethodService {
         */
        @MainThread
        @Override
        public void startInput(InputConnection ic, EditorInfo attribute) {
            if (DEBUG) Log.v(TAG, "startInput(): editor=" + attribute);
        public void startInput(InputConnection ic, EditorInfo editorInfo) {
            if (DEBUG) Log.v(TAG, "startInput(): editor=" + editorInfo);
            Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMS.startInput");
            doStartInput(ic, attribute, false);
            doStartInput(ic, editorInfo, false);
            Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
        }

@@ -808,10 +808,10 @@ public class InputMethodService extends AbstractInputMethodService {
         */
        @MainThread
        @Override
        public void restartInput(InputConnection ic, EditorInfo attribute) {
            if (DEBUG) Log.v(TAG, "restartInput(): editor=" + attribute);
        public void restartInput(InputConnection ic, EditorInfo editorInfo) {
            if (DEBUG) Log.v(TAG, "restartInput(): editor=" + editorInfo);
            Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "IMS.restartInput");
            doStartInput(ic, attribute, true);
            doStartInput(ic, editorInfo, true);
            Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
        }

@@ -2315,11 +2315,11 @@ public class InputMethodService extends AbstractInputMethodService {
     * setup here.  You are guaranteed that {@link #onCreateInputView()} will
     * have been called some time before this function is called.
     * 
     * @param info Description of the type of text being edited.
     * @param editorInfo Description of the type of text being edited.
     * @param restarting Set to true if we are restarting input on the
     * same text field as before.
     */
    public void onStartInputView(EditorInfo info, boolean restarting) {
    public void onStartInputView(EditorInfo editorInfo, boolean restarting) {
        // Intentionally empty
    }
    
@@ -2360,11 +2360,11 @@ public class InputMethodService extends AbstractInputMethodService {
     * editor is hidden but wants to show its candidates UI as text is
     * entered through some other mechanism.
     * 
     * @param info Description of the type of text being edited.
     * @param editorInfo Description of the type of text being edited.
     * @param restarting Set to true if we are restarting input on the
     * same text field as before.
     */
    public void onStartCandidatesView(EditorInfo info, boolean restarting) {
    public void onStartCandidatesView(EditorInfo editorInfo, boolean restarting) {
        // Intentionally empty
    }
    
@@ -2902,7 +2902,7 @@ public class InputMethodService extends AbstractInputMethodService {
        unregisterCompatOnBackInvokedCallback();
    }

    void doStartInput(InputConnection ic, EditorInfo attribute, boolean restarting) {
    void doStartInput(InputConnection ic, EditorInfo editorInfo, boolean restarting) {
        if (!restarting && mInputStarted) {
            doFinishInput();
        }
@@ -2910,13 +2910,13 @@ public class InputMethodService extends AbstractInputMethodService {
                null /* icProto */);
        mInputStarted = true;
        mStartedInputConnection = ic;
        mInputEditorInfo = attribute;
        mInputEditorInfo = editorInfo;
        initialize();
        mInlineSuggestionSessionController.notifyOnStartInput(
                attribute == null ? null : attribute.packageName,
                attribute == null ? null : attribute.autofillId);
                editorInfo == null ? null : editorInfo.packageName,
                editorInfo == null ? null : editorInfo.autofillId);
        if (DEBUG) Log.v(TAG, "CALL: onStartInput");
        onStartInput(attribute, restarting);
        onStartInput(editorInfo, restarting);
        if (mDecorViewVisible) {
            if (mShowInputRequested) {
                if (DEBUG) Log.v(TAG, "CALL: onStartInputView");
+4 −4
Original line number Diff line number Diff line
@@ -182,13 +182,13 @@ public interface InputMethod {
     * @param inputConnection Optional specific input connection for
     * communicating with the text box; if null, you should use the generic
     * bound input connection.
     * @param info Information about the text box (typically, an EditText)
     * @param editorInfo Information about the text box (typically, an EditText)
     *        that requests input.
     * 
     * @see EditorInfo
     */
    @MainThread
    public void startInput(InputConnection inputConnection, EditorInfo info);
    public void startInput(InputConnection inputConnection, EditorInfo editorInfo);

    /**
     * This method is called when the state of this input method needs to be
@@ -201,13 +201,13 @@ public interface InputMethod {
     * @param inputConnection Optional specific input connection for
     * communicating with the text box; if null, you should use the generic
     * bound input connection.
     * @param attribute The attribute of the text box (typically, a EditText)
     * @param editorInfo The attribute of the text box (typically, a EditText)
     *        that requests input.
     * 
     * @see EditorInfo
     */
    @MainThread
    public void restartInput(InputConnection inputConnection, EditorInfo attribute);
    public void restartInput(InputConnection inputConnection, EditorInfo editorInfo);

    /**
     * This method is called when {@code {@link #startInput(InputConnection, EditorInfo)} or
+21 −21
Original line number Diff line number Diff line
@@ -446,7 +446,7 @@ public final class InputMethodManager {
     * the attributes that were last retrieved from the served view and given
     * to the input connection.
     */
    EditorInfo mCurrentTextBoxAttribute;
    EditorInfo mCurrentEditorInfo;
    /**
     * The InputConnection that was last retrieved from the served view.
     */
@@ -657,7 +657,7 @@ public final class InputMethodManager {
                    "InputMethodManager.DelegateImpl#startInput", InputMethodManager.this,
                    null /* icProto */);
            synchronized (mH) {
                mCurrentTextBoxAttribute = null;
                mCurrentEditorInfo = null;
                mCompletions = null;
                mServedConnecting = true;
                servedView = getServedViewLocked();
@@ -1598,7 +1598,7 @@ public final class InputMethodManager {

        checkFocus();
        synchronized (mH) {
            return hasServedByInputMethodLocked(view) && mCurrentTextBoxAttribute != null;
            return hasServedByInputMethodLocked(view) && mCurrentEditorInfo != null;
        }
    }

@@ -1608,7 +1608,7 @@ public final class InputMethodManager {
    public boolean isActive() {
        checkFocus();
        synchronized (mH) {
            return getServedViewLocked() != null && mCurrentTextBoxAttribute != null;
            return getServedViewLocked() != null && mCurrentEditorInfo != null;
        }
    }

@@ -1692,7 +1692,7 @@ public final class InputMethodManager {
     * to an input method
     */
    void clearConnectionLocked() {
        mCurrentTextBoxAttribute = null;
        mCurrentEditorInfo = null;
        if (mServedInputConnection != null) {
            mServedInputConnection.deactivate();
            mServedInputConnection = null;
@@ -2190,7 +2190,7 @@ public final class InputMethodManager {
    public boolean doInvalidateInput(@NonNull RemoteInputConnectionImpl inputConnection,
            @NonNull TextSnapshot textSnapshot, int sessionId) {
        synchronized (mH) {
            if (mServedInputConnection != inputConnection || mCurrentTextBoxAttribute == null) {
            if (mServedInputConnection != inputConnection || mCurrentEditorInfo == null) {
                // OK to ignore because the calling InputConnection is already abandoned.
                return true;
            }
@@ -2198,7 +2198,7 @@ public final class InputMethodManager {
                // IME is not yet bound to the client.  Need to fall back to the restartInput().
                return false;
            }
            final EditorInfo editorInfo = mCurrentTextBoxAttribute.createCopyInternal();
            final EditorInfo editorInfo = mCurrentEditorInfo.createCopyInternal();
            editorInfo.initialSelStart = mCursorSelStart = textSnapshot.getSelectionStart();
            editorInfo.initialSelEnd = mCursorSelEnd = textSnapshot.getSelectionEnd();
            mCursorCandStart = textSnapshot.getCompositionStart();
@@ -2337,7 +2337,7 @@ public final class InputMethodManager {
                    // This is not an error. Once IME binds (MSG_BIND), InputConnection is fully
                    // established. So we report this to interested recipients.
                    reportInputConnectionOpened(
                            mServedInputConnection.getInputConnection(), mCurrentTextBoxAttribute,
                            mServedInputConnection.getInputConnection(), mCurrentEditorInfo,
                            mServedInputConnectionHandler, view);
                }
                return false;
@@ -2345,12 +2345,12 @@ public final class InputMethodManager {

            // If we already have a text box, then this view is already
            // connected so we want to restart it.
            if (mCurrentTextBoxAttribute == null) {
            if (mCurrentEditorInfo == null) {
                startInputFlags |= StartInputFlags.INITIAL_CONNECTION;
            }

            // Hook 'em up and let 'er rip.
            mCurrentTextBoxAttribute = tba.createCopyInternal();
            mCurrentEditorInfo = tba.createCopyInternal();

            mServedConnecting = false;
            if (mServedInputConnection != null) {
@@ -2656,7 +2656,7 @@ public final class InputMethodManager {

        checkFocus();
        synchronized (mH) {
            if (!hasServedByInputMethodLocked(view) || mCurrentTextBoxAttribute == null
            if (!hasServedByInputMethodLocked(view) || mCurrentEditorInfo == null
                    || mCurrentInputMethodSession == null) {
                return;
            }
@@ -2713,7 +2713,7 @@ public final class InputMethodManager {
        final boolean focusChanged = servedView != nextServedView;
        checkFocus();
        synchronized (mH) {
            if (!hasServedByInputMethodLocked(view) || mCurrentTextBoxAttribute == null
            if (!hasServedByInputMethodLocked(view) || mCurrentEditorInfo == null
                    || mCurrentInputMethodSession == null) {
                return;
            }
@@ -2789,7 +2789,7 @@ public final class InputMethodManager {

        checkFocus();
        synchronized (mH) {
            if (!hasServedByInputMethodLocked(view) || mCurrentTextBoxAttribute == null
            if (!hasServedByInputMethodLocked(view) || mCurrentEditorInfo == null
                    || mCurrentInputMethodSession == null) {
                return;
            }
@@ -2821,7 +2821,7 @@ public final class InputMethodManager {

        checkFocus();
        synchronized (mH) {
            if (!hasServedByInputMethodLocked(view) || mCurrentTextBoxAttribute == null
            if (!hasServedByInputMethodLocked(view) || mCurrentEditorInfo == null
                    || mCurrentInputMethodSession == null) {
                return;
            }
@@ -2871,7 +2871,7 @@ public final class InputMethodManager {

        checkFocus();
        synchronized (mH) {
            if (!hasServedByInputMethodLocked(view) || mCurrentTextBoxAttribute == null
            if (!hasServedByInputMethodLocked(view) || mCurrentEditorInfo == null
                    || mCurrentInputMethodSession == null) {
                return;
            }
@@ -3597,11 +3597,11 @@ public final class InputMethodManager {
        p.println("  mServedView=" + getServedViewLocked());
        p.println("  mNextServedView=" + getNextServedViewLocked());
        p.println("  mServedConnecting=" + mServedConnecting);
        if (mCurrentTextBoxAttribute != null) {
            p.println("  mCurrentTextBoxAttribute:");
            mCurrentTextBoxAttribute.dump(p, "    ", false /* dumpExtras */);
        if (mCurrentEditorInfo != null) {
            p.println("  mCurrentEditorInfo:");
            mCurrentEditorInfo.dump(p, "    ", false /* dumpExtras */);
        } else {
            p.println("  mCurrentTextBoxAttribute: null");
            p.println("  mCurrentEditorInfo: null");
        }
        p.println("  mServedInputConnection=" + mServedInputConnection);
        p.println("  mServedInputConnectionHandler=" + mServedInputConnectionHandler);
@@ -3724,8 +3724,8 @@ public final class InputMethodManager {
            if (mCurRootView != null) {
                mCurRootView.dumpDebug(proto, VIEW_ROOT_IMPL);
            }
            if (mCurrentTextBoxAttribute != null) {
                mCurrentTextBoxAttribute.dumpDebug(proto, EDITOR_INFO);
            if (mCurrentEditorInfo != null) {
                mCurrentEditorInfo.dumpDebug(proto, EDITOR_INFO);
            }
            if (mImeInsetsConsumer != null) {
                mImeInsetsConsumer.dumpDebug(proto, IME_INSETS_SOURCE_CONSUMER);
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ oneway interface IInputMethod {
    void unbindInput();

    void startInput(in IBinder startInputToken, in IRemoteInputConnection inputConnection,
            in EditorInfo attribute, boolean restarting, int navigationBarFlags,
            in EditorInfo editorInfo, boolean restarting, int navigationBarFlags,
            in ImeOnBackInvokedDispatcher imeDispatcher);

    void onNavButtonFlagsChanged(int navButtonFlags);
Loading