Setup mobile config and create experiment for using overflowInset in Android

Summary:
The previous diff shows how `overflowInset` could improve hit test algorithm performance. This diff adds experiment to it in order to:

1. Understand the perf improvement in production
2. Provide quick way to rollback in production -- the changes are used by FB4A as well as VR
3. The changes will pass more instructions over JNI, which may have impact on perf.

To share the MC param values in both Java and C++ side, the value is hosted by `ReactFeatureFlags` and fetched in `FbReactInstanceHolder`.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33179310

fbshipit-source-id: 327100d41f7b5a668ff0d2afabcdd1fc16cb5a18
This commit is contained in:
Xin Chen
2021-12-20 18:43:47 -08:00
committed by Facebook GitHub Bot
parent bc9168d4ca
commit b4dab1a537
4 changed files with 35 additions and 5 deletions
@@ -17,6 +17,7 @@ import android.view.ViewGroup;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.react.touch.ReactHitSlopView;
import java.util.ArrayList;
import java.util.EnumSet;
@@ -185,7 +186,8 @@ public class TouchTargetHelper {
if (view instanceof ReactOverflowViewWithInset) {
// If the touch point is outside of the overflowinset for the view, we can safely ignore
// it.
if (!isTouchPointInViewWithOverflowInset(eventCoords[0], eventCoords[1], view)) {
if (ReactFeatureFlags.doesUseOverflowInset()
&& !isTouchPointInViewWithOverflowInset(eventCoords[0], eventCoords[1], view)) {
return null;
}