mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-05 09:29:07 +08:00
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:
committed by
Facebook Github Bot
parent
dd8231ad63
commit
06956e83cd
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user