Back out "Try reduce flackiness of VeniceTest"

Summary:
Original commit changeset: 5af216e6bfa3

Changelog: [Internal]

Reviewed By: yungsters, mdvacca

Differential Revision: D26894424

fbshipit-source-id: 32cc4af2283ef9e80eaf57552c3dcfb3c1fa3c67
This commit is contained in:
Joshua Gross 2021-03-08 15:06:11 -08:00 коммит произвёл Facebook GitHub Bot
Родитель 64f6f5e618
Коммит de5e16f55c
11 изменённых файлов: 14 добавлений и 20 удалений

Просмотреть файл

@ -163,7 +163,7 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
ReactApplicationContext reactApplicationContext = getReactApplicationContextIfActiveOrWarn();
if (reactApplicationContext != null) {
reactApplicationContext.addLifecycleEventListenerAndCheckState(this);
reactApplicationContext.addLifecycleEventListener(this);
}
}

Просмотреть файл

@ -23,7 +23,6 @@ import com.facebook.react.bridge.queue.MessageQueueThread;
import com.facebook.react.bridge.queue.ReactQueueConfiguration;
import com.facebook.react.common.LifecycleState;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.annotations.VisibleForTesting;
import com.facebook.react.config.ReactFeatureFlags;
import java.lang.ref.WeakReference;
import java.util.concurrent.CopyOnWriteArraySet;
@ -183,14 +182,9 @@ public class ReactContext extends ContextWrapper {
return mLifecycleState;
}
@VisibleForTesting
public void addLifecycleEventListener(final LifecycleEventListener listener) {
mLifecycleEventListeners.add(listener);
}
public void addLifecycleEventListenerAndCheckState(final LifecycleEventListener listener) {
mLifecycleEventListeners.add(listener);
if (hasActiveCatalystInstance()) {
if (hasActiveCatalystInstance() || isBridgeless()) {
switch (mLifecycleState) {
case BEFORE_CREATE:
case BEFORE_RESUME:

Просмотреть файл

@ -176,7 +176,7 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
mEventDispatcher = eventDispatcher;
mShouldDeallocateEventDispatcher = false;
mEventBeatManager = eventBeatManager;
mReactApplicationContext.addLifecycleEventListenerAndCheckState(this);
mReactApplicationContext.addLifecycleEventListener(this);
}
public FabricUIManager(
@ -189,7 +189,7 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
mEventDispatcher = new EventDispatcherImpl(reactContext);
mShouldDeallocateEventDispatcher = true;
mEventBeatManager = eventBeatManager;
mReactApplicationContext.addLifecycleEventListenerAndCheckState(this);
mReactApplicationContext.addLifecycleEventListener(this);
}
// TODO (T47819352): Rename this to startSurface for consistency with xplat/iOS

Просмотреть файл

@ -157,7 +157,7 @@ public class AccessibilityInfoModule extends NativeAccessibilityInfoSpec
@Override
public void initialize() {
getReactApplicationContext().addLifecycleEventListenerAndCheckState(this);
getReactApplicationContext().addLifecycleEventListener(this);
updateAndSendTouchExplorationChangeEvent(mAccessibilityManager.isTouchExplorationEnabled());
updateAndSendReduceMotionChangeEvent();
}

Просмотреть файл

@ -68,7 +68,7 @@ public final class TimingModule extends NativeTimingSpec
@Override
public void initialize() {
getReactApplicationContext().addLifecycleEventListenerAndCheckState(this);
getReactApplicationContext().addLifecycleEventListener(this);
HeadlessJsTaskContext headlessJsTaskContext =
HeadlessJsTaskContext.getInstance(getReactApplicationContext());
headlessJsTaskContext.addTaskEventListener(this);

Просмотреть файл

@ -37,7 +37,7 @@ public class DeviceInfoModule extends NativeDeviceInfoSpec implements LifecycleE
DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(reactContext);
mFontScale = reactContext.getResources().getConfiguration().fontScale;
mReactApplicationContext = reactContext;
mReactApplicationContext.addLifecycleEventListenerAndCheckState(this);
mReactApplicationContext.addLifecycleEventListener(this);
}
public DeviceInfoModule(Context context) {

Просмотреть файл

@ -156,7 +156,7 @@ public class DialogModule extends NativeDialogManagerAndroidSpec implements Life
@Override
public void initialize() {
getReactApplicationContext().addLifecycleEventListenerAndCheckState(this);
getReactApplicationContext().addLifecycleEventListener(this);
}
@Override

Просмотреть файл

@ -105,7 +105,7 @@ public class FrescoModule extends ReactContextBaseJavaModule
@Override
public void initialize() {
super.initialize();
getReactApplicationContext().addLifecycleEventListenerAndCheckState(this);
getReactApplicationContext().addLifecycleEventListener(this);
if (!hasBeenInitialized()) {
if (mConfig == null) {
mConfig = getDefaultConfig(getReactApplicationContext());

Просмотреть файл

@ -56,8 +56,8 @@ public class ThemedReactContext extends ReactContext {
}
@Override
public void addLifecycleEventListenerAndCheckState(LifecycleEventListener listener) {
mReactApplicationContext.addLifecycleEventListenerAndCheckState(listener);
public void addLifecycleEventListener(LifecycleEventListener listener) {
mReactApplicationContext.addLifecycleEventListener(listener);
}
@Override

Просмотреть файл

@ -158,7 +158,7 @@ public class UIManagerModule extends ReactContextBaseJavaModule
mEventDispatcher,
minTimeLeftInFrameForNonBatchedOperationMs);
reactContext.addLifecycleEventListenerAndCheckState(this);
reactContext.addLifecycleEventListener(this);
}
@Deprecated
@ -180,7 +180,7 @@ public class UIManagerModule extends ReactContextBaseJavaModule
mEventDispatcher,
minTimeLeftInFrameForNonBatchedOperationMs);
reactContext.addLifecycleEventListenerAndCheckState(this);
reactContext.addLifecycleEventListener(this);
}
/**

Просмотреть файл

@ -104,7 +104,7 @@ public class EventDispatcherImpl implements EventDispatcher, LifecycleEventListe
public EventDispatcherImpl(ReactApplicationContext reactContext) {
mReactContext = reactContext;
mReactContext.addLifecycleEventListenerAndCheckState(this);
mReactContext.addLifecycleEventListener(this);
mReactEventEmitter = new ReactEventEmitter(mReactContext);
}