Add history and persistence support to Evaluator.
Bug: 31623549 Bug: 31686717 This version superficially works, but introduces a number of FIXME comments that should be repaired before shipping. It may not stand up well to monkey tests. Add ExpressionDB.java that encapsulates a SQLite database to hold the calculator history. Change Evaluator to support simultaneous evaluation of many different expressions, such as those in the history. In order to avoid UI thread blocking, the evaluator now loads referenced subexpression on demand, and multiple expressions can be evaluated simultaneously. We handle the concurrency somewhat optimistically, arranging to have concurrent evaluations not step on each other, at the expense of occasionally throwing away a redundant result. Change the expression serialization algorithm to make formulas more compact. Do this now to minimize annoying database format changes. Persist the saved clipboard and "memory" state. Add two buttons in landscape mode to allow minimal access to "memory". Since this involved a substantial rewrite of Evaluator.java, it includes some drive-by cleanups and minor bug fixes. Notably: mMsdIndex was apparently always recomputed, but never actually saved. Oops. This no doubt added a small amount of overhead. We updated the decimal conversion size limits, hopefully addressing b/30200325, possibly at some expense of slightly worse behavior on old 32-bit devices. Tests: Tested manually with a bit of added instrumentation. Ran existing automated tests. Change-Id: Ifae408d7b4b6cacd19f0e8f5aca146e9c653927e
Loading
Please register or sign in to comment