Correct behavior with erroneous pasted text

Bug: 26747803

Generate an error if we try to evaluate an expression with trailing
unparsed text.  If we try to add an unparsed expression by
touching a keypad (not physical keyboard) button, we append the
text equivalent to the unparsed expression text.

Do not display instant results if there are unparsed characters.
This requires that we sometimes recompute the result even if the
unerlying parsed expression hasn't changed.

Some other minor cleanups:
Add haveUnprocessed() and simplify some of the logic related to
mUnprocessedChars.

Correctly return true in all cases in which we handle a physical
KeyEvent.

Use the modern version of getColor() to avoid annoying warning.

Change-Id: I99dd55204a646f10efc22b8f35ab19489226835b
2 files changed