Merge "Prevent exception when temporarily detaching the RemoteInputView's EditText." into sc-dev am: 0b2f05287c am: 21341b92c9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14938832

Change-Id: I283a2a84a43ede453219b6cf53fbef2b9a1b6525
This commit is contained in:
Jeff DeCew
2021-06-15 13:46:36 +00:00
committed by Automerger Merge Worker

View File

@@ -747,7 +747,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
super.dispatchStartTemporaryDetach();
// Detach the EditText temporarily such that it doesn't get onDetachedFromWindow and
// won't lose IME focus.
detachViewFromParent(mEditText);
final int iEditText = indexOfChild(mEditText);
if (iEditText != -1) {
detachViewFromParent(iEditText);
}
}
@Override