Skip to content

Commit 925330b

Browse files
Peter Arganyalloy
authored andcommitted
Fix animations in OSS debug builds by modifying Platform.isTesting() behaviour
Summary: In D14244606 I "fixed" `Platform.isTesting()` in JS. By fixed, I made it return true when running SSTs. People in OSS complained about this in discord and [github](facebook#27010). The problem is that this call returns true whenever an RN project references Detox in the build.gradle file. In practice, this has been really annoying, because it has disabled animations in debug builds, due to D13811035. The fix is to be more specific, and look for the exact screenshot test activity. I haven't explicitly verified this doesn't trigger from Detox, but it shouldn't. I'll coordinate on the github issue to verify. Changelog: [Android][Fixed] Fix animations in OSS debug builds by modifying `Platform.isTesting()` behaviour Reviewed By: TheSavior Differential Revision: D19384098 fbshipit-source-id: 22c885219f2c00f5dcc3b930b068bfd2ad7e4b8e
1 parent d68013d commit 925330b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public void invalidate() {}
9393

9494
private Boolean isRunningScreenshotTest() {
9595
try {
96-
Class.forName("android.support.test.rule.ActivityTestRule");
96+
Class.forName("com.facebook.testing.react.screenshots.ReactAppScreenshotTestActivity");
9797
return true;
9898
} catch (ClassNotFoundException ignored) {
9999
return false;

0 commit comments

Comments
 (0)