Page MenuHomePhabricator

D6959.id23470.diff
No OneTemporary

D6959.id23470.diff

diff --git a/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp b/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
--- a/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
+++ b/native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
@@ -13,6 +13,10 @@
#include <folly/json.h>
#include <future>
+#ifdef __ANDROID__
+#include <fbjni/fbjni.h>
+#endif
+
namespace comm {
using namespace facebook::react;
@@ -800,8 +804,15 @@
});
}
try {
- NotificationsCryptoModule::initializeNotificationsCryptoAccount(
- "Comm");
+ auto task = []() {
+ NotificationsCryptoModule::initializeNotificationsCryptoAccount(
+ "Comm");
+ };
+#ifdef __ANDROID__
+ facebook::jni::ThreadScope::WithClassLoader(std::move(task));
+#else
+ task();
+#endif
} catch (const std::exception &e) {
error = e.what();
}
@@ -833,8 +844,15 @@
}
try {
if (!error.size()) {
- notificationsKeysResult =
- NotificationsCryptoModule::getNotificationsIdentityKeys();
+ auto task = [&notificationsKeysResult]() {
+ notificationsKeysResult =
+ NotificationsCryptoModule::getNotificationsIdentityKeys();
+ };
+#ifdef __ANDROID__
+ facebook::jni::ThreadScope::WithClassLoader(std::move(task));
+#else
+ task();
+#endif
}
} catch (const std::exception &e) {
error = e.what();

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 1:40 AM (13 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2684513
Default Alt Text
D6959.id23470.diff (1 KB)

Event Timeline