Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d5c40d8 authored by satok's avatar satok
Browse files

Send key information even when the touch position correction is not triggered.

Bug: 4343280
Change-Id: Id24935f9f0f66ebaa799bb92537d842033427c4c
parent 02e70cf9
Loading
Loading
Loading
Loading
+24 −24
Original line number Original line Diff line number Diff line
@@ -124,20 +124,22 @@ public class ProximityInfo {
        final float[] sweetSpotCenterXs;
        final float[] sweetSpotCenterXs;
        final float[] sweetSpotCenterYs;
        final float[] sweetSpotCenterYs;
        final float[] sweetSpotRadii;
        final float[] sweetSpotRadii;
        final boolean calculateSweetSpotParams;

        if (touchPositionCorrection != null && touchPositionCorrection.isValid()) {
        for (int i = 0; i < keyCount; ++i) {
            sweetSpotCenterXs = new float[keyCount];
            sweetSpotCenterYs = new float[keyCount];
            sweetSpotRadii = new float[keyCount];
            calculateSweetSpotParams = true;
            for (int i = 0; i < keyCount; i++) {
            final Key key = keys[i];
            final Key key = keys[i];
            keyXCoordinates[i] = key.mX;
            keyXCoordinates[i] = key.mX;
            keyYCoordinates[i] = key.mY;
            keyYCoordinates[i] = key.mY;
            keyWidths[i] = key.mWidth;
            keyWidths[i] = key.mWidth;
            keyHeights[i] = key.mHeight;
            keyHeights[i] = key.mHeight;
            keyCharCodes[i] = key.mCode;
            keyCharCodes[i] = key.mCode;
                if (calculateSweetSpotParams) {
        }

        if (touchPositionCorrection != null && touchPositionCorrection.isValid()) {
            sweetSpotCenterXs = new float[keyCount];
            sweetSpotCenterYs = new float[keyCount];
            sweetSpotRadii = new float[keyCount];
            for (int i = 0; i < keyCount; i++) {
                final Key key = keys[i];
                final Rect hitBox = key.mHitBox;
                final Rect hitBox = key.mHitBox;
                final int row = hitBox.top / mKeyHeight;
                final int row = hitBox.top / mKeyHeight;
                if (row < touchPositionCorrection.mRadii.length) {
                if (row < touchPositionCorrection.mRadii.length) {
@@ -154,10 +156,8 @@ public class ProximityInfo {
                            hitBoxWidth * hitBoxWidth + hitBoxHeight * hitBoxHeight);
                            hitBoxWidth * hitBoxWidth + hitBoxHeight * hitBoxHeight);
                }
                }
            }
            }
            }
        } else {
        } else {
            sweetSpotCenterXs = sweetSpotCenterYs = sweetSpotRadii = null;
            sweetSpotCenterXs = sweetSpotCenterYs = sweetSpotRadii = null;
            calculateSweetSpotParams = false;
        }
        }


        mNativeProximityInfo = setProximityInfoNative(mLocaleStr, MAX_PROXIMITY_CHARS_SIZE,
        mNativeProximityInfo = setProximityInfoNative(mLocaleStr, MAX_PROXIMITY_CHARS_SIZE,