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

Commit 1d6784b9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Clarify that InputMethod.attachToken() can be called at most once"

parents 5f5e662f 674cc4be
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -450,11 +450,13 @@ public class InputMethodService extends AbstractInputMethodService {
        @MainThread
        @Override
        public void attachToken(IBinder token) {
            if (mToken == null) {
            if (mToken != null) {
                throw new IllegalStateException(
                        "attachToken() must be called at most once. token=" + token);
            }
            mToken = token;
            mWindow.setToken(token);
        }
        }

        /**
         * {@inheritDoc}
+4 −4
Original line number Diff line number Diff line
@@ -87,9 +87,9 @@ public interface InputMethod {
     * This token <strong>must not</strong> be passed to applications, since
     * it grants special priviledges that should not be given to applications.
     *
     * <p>Note: to protect yourself from malicious clients, you should only
     * accept the first token given to you.  Any after that may come from the
     * client.
     * <p>The system guarantees that this method is called back between
     * {@link InputMethodService#onCreate()} and {@link InputMethodService#onDestroy()}
     * at most once.
     */
    @MainThread
    public void attachToken(IBinder token);