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

Commit 5c53f0ca authored by Taran Singh's avatar Taran Singh
Browse files

Remove ImsConfigTracker#onBindInput precondition

It is expected the onIntialize() is called before onBindInput(), however
it's not precisely known why onBindInput() is being called prior to onIntialize().
Once possibility is it could be that onDestory() is being called
and init was skipped and call made it to onBindInput().

Replacing precondition with an early return should be safe here.

Fix: 223083664
Bug: 223443508
Test: atest CtsInputMethodTestCases

Change-Id: I8312d98b0349fbc661b6eb0f4c47bea25ffbb2a9
parent e2722fe9
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -63,8 +63,9 @@ public final class ImsConfigurationTracker {
     */
    @MainThread
    public void onBindInput(@Nullable Resources resources) {
        Preconditions.checkState(mInitialized,
                "onBindInput can be called only after onInitialize().");
        if (!mInitialized) {
            return;
        }
        if (mLastKnownConfig == null && resources != null) {
            mLastKnownConfig = new Configuration(resources.getConfiguration());
        }