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

Commit 67a7f002 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Remove a redundant check from IMM#isAcceptingText()

This is a follow up CL to my previous CL [1], which rewrote

  InputMethodManager#isAcceptingText()

with a newly introduced internal method

  RemoteInputConnectionImpl#isFinished().

What I overlooked was the fact that

  mServedInputConnection.isFinished()

is guaranteed to return "true" while

  InputMethodManager#mServedInputConnection

is nonnull.  Let's simplify the logic.

This is a safe clean up.  There must be no observable behavior change.

 [1]: Ic5fbc6213ad62df95fc0b7eef18bab1fd9fbdbf1
      d1ff9740

Bug: 234882948
Test: presubmit
Change-Id: Icee431b05108aa607ea0a56c683a361399b7583e
parent 79420036
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1767,7 +1767,7 @@ public final class InputMethodManager {
    public boolean isAcceptingText() {
    public boolean isAcceptingText() {
        checkFocus();
        checkFocus();
        synchronized (mH) {
        synchronized (mH) {
            return mServedInputConnection != null && !mServedInputConnection.isFinished();
            return mServedInputConnection != null;
        }
        }
    }
    }


+1 −1
Original line number Original line Diff line number Diff line
@@ -208,7 +208,7 @@ final class RemoteInputConnectionImpl extends IRemoteInputConnection.Stub {
     * @return {@code true} until the target {@link InputConnection} receives
     * @return {@code true} until the target {@link InputConnection} receives
     * {@link InputConnection#closeConnection()} as a result of {@link #deactivate()}.
     * {@link InputConnection#closeConnection()} as a result of {@link #deactivate()}.
     */
     */
    public boolean isFinished() {
    private boolean isFinished() {
        synchronized (mLock) {
        synchronized (mLock) {
            return mFinished;
            return mFinished;
        }
        }