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

Commit de3fe152 authored by Antonio Kantek's avatar Antonio Kantek
Browse files

Inline IMMS#getLastBindTimeLocked

This CL represents an internal refactoring and shouldn't introduce any
observable breakage.

Bug: 325515685
Test: atest FrameworksInputMethodSystemServerTests
Test: atest CtsInputMethodTestCases
Test: atest FrameworksServicesTests
Test: atest --host FrameworksInputMethodSystemServerTestsRavenwood
Change-Id: I8003a77d24160915fdeee0f630adffa7289a42c1
parent 921858a4
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -658,16 +658,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()?
     */
@@ -2376,7 +2366,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