ViewRootImpl: peek IME source instead of creating it

Fixes an issue where getting the IME source to check its
visibility unintentionally lazily created it.

Fixes: 208200189
Test: manual
Change-Id: Ib36082b393215fc59e299dea30d3315f3748ca02
This commit is contained in:
Adrian Roos
2021-11-30 15:06:06 +01:00
parent 96d821aa4e
commit bf551fe111

View File

@@ -8411,7 +8411,7 @@ public final class ViewRootImpl implements ViewParent,
if (mTranslator != null) {
mTranslator.translateInsetsStateInScreenToAppWindow(insetsState);
}
if (insetsState != null && insetsState.getSource(ITYPE_IME).isVisible()) {
if (insetsState != null && insetsState.getSourceOrDefaultVisibility(ITYPE_IME)) {
ImeTracing.getInstance().triggerClientDump("ViewRootImpl#dispatchInsetsChanged",
getInsetsController().getHost().getInputMethodManager(), null /* icProto */);
}
@@ -8436,7 +8436,7 @@ public final class ViewRootImpl implements ViewParent,
mTranslator.translateInsetsStateInScreenToAppWindow(insetsState);
mTranslator.translateSourceControlsInScreenToAppWindow(activeControls);
}
if (insetsState != null && insetsState.getSource(ITYPE_IME).isVisible()) {
if (insetsState != null && insetsState.getSourceOrDefaultVisibility(ITYPE_IME)) {
ImeTracing.getInstance().triggerClientDump("ViewRootImpl#dispatchInsetsControlChanged",
getInsetsController().getHost().getInputMethodManager(), null /* icProto */);
}