summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Taran Singh <tarandeep@google.com> 2022-03-08 18:49:01 +0000
committer Taran Singh <tarandeep@google.com> 2022-03-09 18:25:38 +0000
commit5c53f0ca67a54b80e648e9e4896c348701745895 (patch)
tree142ed9f9e8c587bf119b35143df610a46ac4542c
parente2722fe948b428ccc4679ce9466618a773225ebb (diff)
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
-rw-r--r--core/java/android/inputmethodservice/ImsConfigurationTracker.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/inputmethodservice/ImsConfigurationTracker.java b/core/java/android/inputmethodservice/ImsConfigurationTracker.java
index 3c788884371b..30ef0a2a6f7f 100644
--- a/core/java/android/inputmethodservice/ImsConfigurationTracker.java
+++ b/core/java/android/inputmethodservice/ImsConfigurationTracker.java
@@ -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());
}