Skip to content

Commit 2bf0d54

Browse files
stepanhrudafacebook-github-bot
authored andcommitted
Only include ServerHost constant in debug builds
Summary: I recently changed the implementation of `getServerHost` to be more expensive. I am excluding it from constants in non-debug builds, since loading that module lies on a critical path. Reviewed By: axe-fb Differential Revision: D12982150 fbshipit-source-id: eaaa50418726dbb2da2d517d0810f39b0dc7fac2
1 parent be282b5 commit 2bf0d54

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import com.facebook.react.bridge.ReactApplicationContext;
1616
import com.facebook.react.bridge.ReactContextBaseJavaModule;
17+
import com.facebook.react.common.build.ReactBuildConfig;
1718
import com.facebook.react.module.annotations.ReactModule;
1819

1920
import java.util.HashMap;
@@ -69,7 +70,9 @@ public String getName() {
6970
constants.put("Serial", Build.SERIAL);
7071
constants.put("Fingerprint", Build.FINGERPRINT);
7172
constants.put("Model", Build.MODEL);
72-
constants.put("ServerHost", AndroidInfoHelpers.getServerHost());
73+
if (ReactBuildConfig.DEBUG) {
74+
constants.put("ServerHost", AndroidInfoHelpers.getServerHost());
75+
}
7376
constants.put("isTesting", "true".equals(System.getProperty(IS_TESTING)));
7477
constants.put("reactNativeVersion", ReactNativeVersion.VERSION);
7578
constants.put("uiMode", uiMode());

0 commit comments

Comments
 (0)