If the user gestures a word, then hits backspace in
disapproval, and gestures about the same thing again,
make sure that we don't suggest the same thing again.
Bug: 7549311
Change-Id: I793bc4df7c3841fa8f2f4146707c26e873f374c1
There are two problems here. The first one is the tests would send
an invalid unicode character. Although we could want dicttool to
handle this more gracefully, it's fine for now.
The second problem is much more serious. If a node has more than
128 children, then the java code will crash trying to read the
dictionary back because of a bug that this change fixes. In
theory, it's possible that happens when we try to load the user
history dictionary back from the disk - native code is not affected
so there is no other point that may cause a problem.
In the practice, that means you'd need to have 129 words with a
common prefix (including empty string) but all different after
this. It's almost impossible with Google Keyboard since there are
only so many keys on the keyboard that you can make a word out
of, and then again you'd have to do it repeatedly until it
actually enters the user history dictionary, wait for it to get
saved on the disk.
The bad news is, if you manage to get this far, the keyboard will
crash every time and won't be able to get up until you clear
data for the package.
The good news is, the dictionary itself is not corrupted and only
the reading code is wrong. So updating to a newer version would
actually even recover from this situation.
All in all, considering how almost-impossible this is to trigger,
I don't think even a single user actually did hit this bug.
Bug: 8583091
Change-Id: Iabb2a7f47cbd9ed3193d2a3487318d280753e071
This uses the old suggestions. It does not try to recompute
new suggestions if there are no old suggestions yet: this is
coming in a later change.
If there are no suggestions, this shows the word itself
as a suggestion.
Bug: 8084810
Change-Id: I4c2e25df0ff3673be1825f57a0c19a9d23d47a48
Calls to LatinIME#onStartInputViewInternal log important information
about the context in which an IME is used. This is reported as a
single LogStatement. Previously, this was not placed into a separate
LogUnit, and was mixed in with general word data. This change wraps
this LogStatement in its own LogUnit.
Change-Id: I0fecd41c8a1de622a764cc4b5d6902336697046c
The ResearchLogger reports whether a build is a release build or not
to avoid polluting data with IME debugging work by developers.
Previously this was done by checking a constant flag, which was also
serving the dual purpose of masking out debug code in release builds.
This change introduces a heuristic to determine whether a build was
created by a developer (using the package versionName), and annotating
the data sent to the server appropriately.
Change-Id: Icbad17c66b703cabf6d23d05e2c7c41bcceaae45
Both bugs only affect debug mode. One has the wrong object tested
with equals, the other has the iteration failing in some cases.
Change-Id: Ie9100d257a3f9e3be340cf3e38116f63417bdc1a