From bd017457e360236b89d3166710a668e5f33bc703 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Mon, 11 Dec 2017 08:55:19 +0200 Subject: [PATCH] execute ParseJail synchronously: allows to avoid synchronization deadlocks inside com.github.ericwlange:AndroidJSCore at JSContext instantiation --- .env.jenkins | 2 +- .../status/ethereum/module/StatusModule.java | 19 ++++++------------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.env.jenkins b/.env.jenkins index 024217e8b2..7a1321fe7c 100644 --- a/.env.jenkins +++ b/.env.jenkins @@ -7,4 +7,4 @@ MAINNET_NETWORKS_ENABLED=1 ERC20_ENABLED=1 OFFLINE_INBOX_ENABLED=0 LOG_LEVEL=debug -JSC_ENABLED=0 +JSC_ENABLED=1 diff --git a/modules/react-native-status/android/src/main/java/im/status/ethereum/module/StatusModule.java b/modules/react-native-status/android/src/main/java/im/status/ethereum/module/StatusModule.java index e798074859..6a05921b67 100644 --- a/modules/react-native-status/android/src/main/java/im/status/ethereum/module/StatusModule.java +++ b/modules/react-native-status/android/src/main/java/im/status/ethereum/module/StatusModule.java @@ -179,7 +179,7 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL String gethLogFileName = "geth.log"; jsonConfig.put("LogEnabled", false); jsonConfig.put("LogFile", gethLogFileName); - jsonConfig.put("LogLevel", "DEBUG"); + jsonConfig.put("LogLevel", "INFO"); jsonConfig.put("DataDir", root + customConfig.get("DataDir")); jsonConfig.put("NetworkId", customConfig.get("NetworkId")); try { @@ -509,23 +509,16 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL @ReactMethod public void parseJail(final String chatId, final String js, final Callback callback) { Log.d(TAG, "parseJail chatId:" + chatId); - Log.d(TAG, js); + //Log.d(TAG, js); if (!checkAvailability()) { callback.invoke(false); return; } - Thread thread = new Thread() { - @Override - public void run() { - String res = jail.parseJail(chatId, js); - Log.d(TAG, res); - Log.d(TAG, "endParseJail"); - callback.invoke(res); - } - }; - - thread.start(); + String res = jail.parseJail(chatId, js); + Log.d(TAG, res); + Log.d(TAG, "endParseJail"); + callback.invoke(res); } @ReactMethod