From 2f45961beb86ec37c8bc4b73d2f8cb2ebdeab0fc Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Mon, 9 Mar 2020 20:41:50 -0700 Subject: [PATCH] Protect against View context not being a ThemedReactContext in AndroidTextInput in Android 4 Summary: See D19204032. In some cases the View might not have a ThemedReactContext, it may be wrapped, so we use a previously-created helper to get the correct context from the View or we throw a soft exception. Changelog: [Internal] Fabric change Reviewed By: mdvacca Differential Revision: D20355126 fbshipit-source-id: 469a3b7f8f2d3b98236f3170dd62c4a6e7e1e46f --- .../textinput/ReactTextInputManager.java | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java index fa7551fbf6a..6bfde5d42ec 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java @@ -1251,22 +1251,33 @@ public class ReactTextInputManager extends BaseViewManager