aboutsummaryrefslogtreecommitdiffstats
path: root/native/jni/com_android_inputmethod_keyboard_ProximityInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'native/jni/com_android_inputmethod_keyboard_ProximityInfo.cpp')
-rw-r--r--native/jni/com_android_inputmethod_keyboard_ProximityInfo.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/native/jni/com_android_inputmethod_keyboard_ProximityInfo.cpp b/native/jni/com_android_inputmethod_keyboard_ProximityInfo.cpp
index 07cee4053..595ea2fdc 100644
--- a/native/jni/com_android_inputmethod_keyboard_ProximityInfo.cpp
+++ b/native/jni/com_android_inputmethod_keyboard_ProximityInfo.cpp
@@ -32,18 +32,27 @@ static jint latinime_Keyboard_setProximityInfo(JNIEnv *env, jobject object,
jint maxProximityCharsSize, jint displayWidth, jint displayHeight, jint gridWidth,
jint gridHeight, jintArray proximityCharsArray, jint keyCount,
jintArray keyXCoordinateArray, jintArray keyYCoordinateArray, jintArray keyWidthArray,
- jintArray keyHeightArray, jintArray keyCharCodeArray, jint themeId) {
+ jintArray keyHeightArray, jintArray keyCharCodeArray,
+ jfloatArray sweetSpotCenterXArray, jfloatArray sweetSpotCenterYArray,
+ jfloatArray sweetSpotRadiusArray) {
jint *proximityChars = env->GetIntArrayElements(proximityCharsArray, NULL);
jint *keyXCoordinates = safeGetIntArrayElements(env, keyXCoordinateArray);
jint *keyYCoordinates = safeGetIntArrayElements(env, keyYCoordinateArray);
jint *keyWidths = safeGetIntArrayElements(env, keyWidthArray);
jint *keyHeights = safeGetIntArrayElements(env, keyHeightArray);
jint *keyCharCodes = safeGetIntArrayElements(env, keyCharCodeArray);
+ jfloat *sweetSpotCenterXs = safeGetFloatArrayElements(env, sweetSpotCenterXArray);
+ jfloat *sweetSpotCenterYs = safeGetFloatArrayElements(env, sweetSpotCenterYArray);
+ jfloat *sweetSpotRadii = safeGetFloatArrayElements(env, sweetSpotRadiusArray);
ProximityInfo *proximityInfo = new ProximityInfo(maxProximityCharsSize, displayWidth,
displayHeight, gridWidth, gridHeight, (const uint32_t*)proximityChars,
keyCount, (const int32_t*)keyXCoordinates, (const int32_t*)keyYCoordinates,
(const int32_t*)keyWidths, (const int32_t*)keyHeights, (const int32_t*)keyCharCodes,
- themeId);
+ (const float*)sweetSpotCenterXs, (const float*)sweetSpotCenterYs,
+ (const float*)sweetSpotRadii);
+ safeReleaseFloatArrayElements(env, sweetSpotRadiusArray, sweetSpotRadii);
+ safeReleaseFloatArrayElements(env, sweetSpotCenterYArray, sweetSpotCenterYs);
+ safeReleaseFloatArrayElements(env, sweetSpotCenterXArray, sweetSpotCenterXs);
safeReleaseIntArrayElements(env, keyCharCodeArray, keyCharCodes);
safeReleaseIntArrayElements(env, keyHeightArray, keyHeights);
safeReleaseIntArrayElements(env, keyWidthArray, keyWidths);
@@ -60,7 +69,8 @@ static void latinime_Keyboard_release(JNIEnv *env, jobject object, jint proximit
}
static JNINativeMethod sKeyboardMethods[] = {
- {"setProximityInfoNative", "(IIIII[II[I[I[I[I[II)I", (void*)latinime_Keyboard_setProximityInfo},
+ {"setProximityInfoNative", "(IIIII[II[I[I[I[I[I[F[F[F)I",
+ (void*)latinime_Keyboard_setProximityInfo},
{"releaseProximityInfoNative", "(I)V", (void*)latinime_Keyboard_release}
};