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

Commit 97eaa543 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Don't count Spacer into histograms

Change-Id: I202a25da4e1a722aa35c57665d73bc5990404c4e
parent 27d9c6f7
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -84,11 +84,16 @@ public class KeyboardParams {

    public void onAddKey(final Key newKey) {
        final Key key = (mKeysCache != null) ? mKeysCache.get(newKey) : newKey;
        final boolean zeroWidthSpacer = key.isSpacer() && key.mWidth == 0;
        if (!zeroWidthSpacer) {
        final boolean isSpacer = key.isSpacer();
        if (isSpacer && key.mWidth == 0) {
            // Ignore zero width {@link Spacer}.
            return;
        }
        mKeys.add(key);
            updateHistogram(key);
        if (isSpacer) {
            return;
        }
        updateHistogram(key);
        if (key.mCode == Constants.CODE_SHIFT) {
            mShiftKeys.add(key);
        }