Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3278521
D4065.id14183.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D4065.id14183.diff
View Options
diff --git a/native/android/app/src/cpp/MessageOperationsUtilitiesJNIHelper.cpp b/native/android/app/src/cpp/MessageOperationsUtilitiesJNIHelper.cpp
new file mode 100644
--- /dev/null
+++ b/native/android/app/src/cpp/MessageOperationsUtilitiesJNIHelper.cpp
@@ -0,0 +1,23 @@
+#include "MessageOperationsUtilitiesJNIHelper.h"
+#include "MessageOperationsUtilities.h"
+#include "SQLiteQueryExecutor.h"
+
+namespace comm {
+void MessageOperationsUtilitiesJNIHelper::storeMessageInfos(
+ facebook::jni::alias_ref<MessageOperationsUtilitiesJNIHelper> jThis,
+ facebook::jni::JString sqliteFilePath,
+ facebook::jni::JString rawMessageInfosString) {
+ std::string sqliteFilePathCpp = sqliteFilePath.toStdString();
+ std::string rawMessageInfosStringCpp = rawMessageInfosString.toStdString();
+ SQLiteQueryExecutor::initialize(sqliteFilePathCpp);
+ MessageOperationsUtilities::storeMessageInfos(rawMessageInfosStringCpp);
+}
+
+void MessageOperationsUtilitiesJNIHelper::registerNatives() {
+ javaClassStatic()->registerNatives({
+ makeNativeMethod(
+ "storeMessageInfos",
+ MessageOperationsUtilitiesJNIHelper::storeMessageInfos),
+ });
+}
+} // namespace comm
diff --git a/native/android/app/src/cpp/jsiInstaller.cpp b/native/android/app/src/cpp/jsiInstaller.cpp
--- a/native/android/app/src/cpp/jsiInstaller.cpp
+++ b/native/android/app/src/cpp/jsiInstaller.cpp
@@ -1,5 +1,6 @@
#include "CommCoreModule.h"
#include "GlobalNetworkSingletonJNIHelper.h"
+#include "MessageOperationsUtilitiesJNIHelper.h"
#include "SQLiteQueryExecutor.h"
#include "ThreadOperationsJNIHelper.h"
#include "jniHelpers.h"
@@ -54,5 +55,6 @@
CommHybrid::registerNatives();
comm::GlobalNetworkSingletonJNIHelper::registerNatives();
comm::ThreadOperationsJNIHelper::registerNatives();
+ comm::MessageOperationsUtilitiesJNIHelper::registerNatives();
});
}
diff --git a/native/android/app/src/main/java/app/comm/android/fbjni/MessageOperationsUtilities.java b/native/android/app/src/main/java/app/comm/android/fbjni/MessageOperationsUtilities.java
new file mode 100644
--- /dev/null
+++ b/native/android/app/src/main/java/app/comm/android/fbjni/MessageOperationsUtilities.java
@@ -0,0 +1,6 @@
+package app.comm.android.fbjni;
+
+public class MessageOperationsUtilities {
+ public static native void
+ storeMessageInfos(String sqliteFilePath, String rawMessageInfosString);
+}
diff --git a/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageOperationsUtilitiesJNIHelper.h b/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageOperationsUtilitiesJNIHelper.h
new file mode 100644
--- /dev/null
+++ b/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageOperationsUtilitiesJNIHelper.h
@@ -0,0 +1,18 @@
+#pragma once
+
+#include <fbjni/fbjni.h>
+
+namespace comm {
+class MessageOperationsUtilitiesJNIHelper
+ : public facebook::jni::JavaClass<MessageOperationsUtilitiesJNIHelper> {
+public:
+ static auto constexpr kJavaDescriptor =
+ "Lapp/comm/android/fbjni/MessageOperationsUtilities;";
+
+ static void storeMessageInfos(
+ facebook::jni::alias_ref<MessageOperationsUtilitiesJNIHelper> jThis,
+ facebook::jni::JString sqliteFilePath,
+ facebook::jni::JString rawMessageInfosString);
+ static void registerNatives();
+};
+} // namespace comm
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 8:24 AM (21 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2516543
Default Alt Text
D4065.id14183.diff (3 KB)
Attached To
Mode
D4065: Implement JNI files to use MessageOperationUtilities in CommNotificationsHandler on Android
Attached
Detach File
Event Timeline
Log In to Comment