Send correct coordinates for the spell checker

This results in the computation being done in native code
and the correct proximity being used.
Bug: 6181080

Change-Id: I08fa05c781d607e4feca2caeda353ec19c133a3d
diff --git a/native/src/proximity_info.cpp b/native/src/proximity_info.cpp
index 4d03f32..47f1376 100644
--- a/native/src/proximity_info.cpp
+++ b/native/src/proximity_info.cpp
@@ -130,6 +130,7 @@
 }
 
 bool ProximityInfo::isOnKey(const int keyId, const int x, const int y) {
+    if (keyId < 0) return true; // NOT_A_ID is -1, but return whenever < 0 just in case
     const int left = mKeyXCoordinates[keyId];
     const int top = mKeyYCoordinates[keyId];
     const int right = left + mKeyWidths[keyId] + 1;
@@ -138,6 +139,7 @@
 }
 
 int ProximityInfo::squaredDistanceToEdge(const int keyId, const int x, const int y) {
+    if (keyId < 0) return true; // NOT_A_ID is -1, but return whenever < 0 just in case
     const int left = mKeyXCoordinates[keyId];
     const int top = mKeyYCoordinates[keyId];
     const int right = left + mKeyWidths[keyId];
@@ -162,7 +164,7 @@
         const int keyIndex = getKeyIndex(c);
         const bool onKey = isOnKey(keyIndex, x, y);
         const int distance = squaredDistanceToEdge(keyIndex, x, y);
-        if (c >= KEYCODE_SPACE && (onKey || distance < MOST_COMMON_KEY_WIDTH_SQUARE)) {
+        if (onKey || distance < MOST_COMMON_KEY_WIDTH_SQUARE) {
             inputCodes[insertPos++] = c;
             if (insertPos >= MAX_PROXIMITY_CHARS_SIZE) {
                 if (DEBUG_DICT) {
@@ -211,7 +213,6 @@
     }
 }
 
-// TODO: Calculate nearby codes here.
 void ProximityInfo::setInputParams(const int32_t* inputCodes, const int inputLength,
         const int* xCoordinates, const int* yCoordinates) {
     memset(mInputCodes, 0,