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
This commit is contained in:
Taran Singh
2022-03-08 18:49:01 +00:00
parent e2722fe948
commit 5c53f0ca67

View File

@@ -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());
}