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

Commit 77c11a1f authored by Antonio Kantek's avatar Antonio Kantek Committed by Android (Google) Code Review
Browse files

Merge "Inline IMMS#getLastBindTimeLocked" into main

parents 8b6b4c82 de3fe152
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -650,16 +650,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        return userData.mBindingController.getCurMethodUid();
    }

    /**
     * Time that we last initiated a bind to the input method, to determine
     * if we should try to disconnect and reconnect to it.
     */
    @GuardedBy("ImfLock.class")
    private long getLastBindTimeLocked() {
        final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
        return userData.mBindingController.getLastBindTime();
    }

    /**
     * Have we called mCurMethod.bindInput()?
     */
@@ -2353,7 +2343,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                        InputBindResult.ResultCode.SUCCESS_WAITING_IME_SESSION,
                        null, null, null, getCurIdLocked(), getSequenceNumberLocked(), false);
            } else {
                long bindingDuration = SystemClock.uptimeMillis() - getLastBindTimeLocked();
                final long lastBindTime = userData.mBindingController.getLastBindTime();
                long bindingDuration = SystemClock.uptimeMillis() - lastBindTime;
                if (bindingDuration < TIME_TO_RECONNECT) {
                    // In this case we have connected to the service, but
                    // don't yet have its interface.  If it hasn't been too