expose IS_TESTING for Platform module

Summary: Introduced IS_TESTING flag on Platform module for android as well. This is useful for testing environment.

Reviewed By: mmmulani

Differential Revision: D4429662

fbshipit-source-id: 33711d7fb5666f0bac8aee444b71261f7f12770f
This commit is contained in:
Kevin Gozali authored and Facebook Github Bot committed 2017-01-19 14:28:30 -08:00
1 parent dd8231ad63
commit 06956e83cd
2 files changed
+7

No files matched your search

@@ -25,6 +25,8 @@ import javax.annotation.Nullable;
@ReactModule(name = "AndroidConstants")
public class AndroidInfoModule extends BaseJavaModule {
private static final String IS_TESTING = "IS_TESTING";
@Override
public String getName() {
return "AndroidConstants";
@@ -35,6 +37,7 @@ public class AndroidInfoModule extends BaseJavaModule {
HashMap<String, Object> constants = new HashMap<>();
constants.put("Version", Build.VERSION.SDK_INT);
constants.put("ServerHost", AndroidInfoHelpers.getServerHost());
constants.put("isTesting", "true".equals(System.getProperty(IS_TESTING)));
return constants;
}
}