mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix race condition in FabricUIManager.StartSurface method
Summary: This diff fixes a race condition in the execution of FabricUIManager.StartSurface method. The rootcause is that startSurface is executing getViewportOffset from a background thread. changelog: [internal] Reviewed By: shergin Differential Revision: D25617154 fbshipit-source-id: 9351201088164e74bb0b9454e30651e1de0da912
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d51cc6b5e6
commit
5a37773e53
@@ -27,6 +27,7 @@ import android.view.ViewTreeObserver;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.UiThread;
|
||||
import com.facebook.common.logging.FLog;
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.infer.annotation.ThreadConfined;
|
||||
@@ -418,6 +419,7 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
|
||||
return mState;
|
||||
}
|
||||
|
||||
@UiThread
|
||||
public static Point getViewportOffset(View v) {
|
||||
int[] locationInWindow = new int[2];
|
||||
v.getLocationInWindow(locationInWindow);
|
||||
|
||||
Reference in New Issue
Block a user