summaryrefslogtreecommitdiff
path: root/jni
diff options
context:
space:
mode:
authorChang Li <licha@google.com>2020-10-08 01:27:20 +0100
committerTony Mak <tonymak@google.com>2020-10-08 10:51:35 +0000
commit4898a32e51a8a0af1118446e9c0d8a19b77ddd2b (patch)
tree28b3066e0cf0319b922a2d5007c7a3ce2e370907 /jni
parent06edbfae58fa80303b47bb062086ed9dca943f68 (diff)
downloadlibtextclassifier-4898a32e51a8a0af1118446e9c0d8a19b77ddd2b.tar.gz
Export TextClassifier code from google3 to AOSP.
Test: m TextClassifierService Change-Id: I5c86c82348f1866967393fa62d3eaa89faf144b3
Diffstat (limited to 'jni')
-rw-r--r--jni/com/google/android/textclassifier/ActionsSuggestionsModel.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/jni/com/google/android/textclassifier/ActionsSuggestionsModel.java b/jni/com/google/android/textclassifier/ActionsSuggestionsModel.java
index 8b6cf2e..0ddb01c 100644
--- a/jni/com/google/android/textclassifier/ActionsSuggestionsModel.java
+++ b/jni/com/google/android/textclassifier/ActionsSuggestionsModel.java
@@ -295,6 +295,14 @@ public final class ActionsSuggestionsModel implements AutoCloseable {
public ActionSuggestionOptions() {}
}
+ /**
+ * Retrieves the pointer to the native object. Note: Need to keep the {@code
+ * ActionsSuggestionsModel} alive as long as the pointer is used.
+ */
+ long getNativeModelPointer() {
+ return nativeGetNativeModelPtr(actionsModelPtr);
+ }
+
private static native long nativeNewActionsModel(int fd, byte[] serializedPreconditions);
private static native long nativeNewActionsModelFromPath(
@@ -325,4 +333,6 @@ public final class ActionsSuggestionsModel implements AutoCloseable {
boolean generateAndroidIntents);
private native void nativeCloseActionsModel(long ptr);
+
+ private native long nativeGetNativeModelPtr(long context);
}