FileUtils is being used for other non android projects
and hence breaks when built. Instead use the log statements
at caller to record Log.e messages. Hence there is no side
effect here.
Bug:22042371
Change-Id: Ieb100006ff38e013bc30542637465f58bfc0f2f2
This will ensure that a new (or upgraded) keyboard instance will know which
dictionaries are available for download so it requests missing dictionaries.
In addition, we increment the database version number to ensure upgrades of
existing Fava instances start with a clean slate.
Bug 22069694.
Change-Id: Id71310412682543a3931f9c5c03cb0369fa7b9ac
If it doesn't match, mark it broken. It means the dictionary pack
will try to install it again next time it updates. We may want to
rethink this.
Bug: 13125743
Change-Id: I0eb547aa7066bed8cb00c009debbafe9181c37ad
Some were never closed, other closed twice. This change
makes all Cursor instances behave, having the #close()
call in a finally{} clause, and puts the burden of closing
the cursor squarely on the creator rather than in the
called methods.
There is however one exception that is beyond the scope
of this change: UserDictionarySettings have a Cursor
member, it's never closed, and fixing the problem is not
obvious. This change adds a TODO for now.
It's not very clear if this change actually helps with
bug#12670151, but it may be related and it's a good
think to do anyway.
Bug: 12670151
Change-Id: I87cc44387e7dee3da1488671b93a28d9d73f7dc0
Emit a trace when a new dictionary is copied to LatinIME
successfully, not just when it fails. That will help diagnosing
some problems by being able to ensure this step succeeded
looking at the log.
This does not happen often (like, maybe 3 times at device
activation, and once every few weeks afterwards), so I think
the extra line in the log is more than acceptable.
Change-Id: I1674bc22d950a7be801076c5aa7e8bbebccab14b
There is no reason not to contact the dictionary provider
when we don't have internet permission or when the URL
is empty. It knows how to handle both these cases.
Bug: 9388602
Change-Id: I30c4540551ad2f5e527d3acd1842bbd749feca89
Upon invoking the settings of the dictionary pack with an unknown
client, we now launch an intent to ask the client to make itself known.
This change also includes the code that receives this intent and
acts upon it.
Bug: 8492879
Change-Id: I2c6496dea845646961ecafcf64e282cb93ee91dc
Improve a slew of logging statements, and put commands that we don't
expect to need protecting against exceptions out of a try {} block.
This is a followup to Id3dc510a
Change-Id: Idc6f419ac095b5b0f2d6862d58926ef888cb34e6
This creates a new DictionaryInfoUtils class and moves a bunch
of static methods there for later usage.
Change-Id: Iecb0643e6029a7be36bd6cb36aa918c40e6d8c6a
In this kind of series of calls, it's possible that an outer call to a
constructor fails, but the inner succeeded.
Example:
try {
is = new A(new B());
} finally {
if (null != is) is.close();
}
In this case, if new B() succeeds but new A() throws an
exception, is stays null and the intermediate object is never
closed. This is what was happening in this instance.
Bug: 7377336
Change-Id: I3fae9fec1135244982fcf5098c76d93f3e0f2add
This introduces a new textual format for the dictionary that combines
words, bigrams and shortcuts to avoid complexity. It is also extensible
to n-grams to fool-prof for the future, and easier to read than XML.
Bug: 7388540
Change-Id: I942bbad51bd0c905a5a54c278667563fd6dd66ec
When a dictionary changes locale, we need to remove the file
that corresponds to the old version. It has a different path
than the new one, so we have to search for it explicitly.
Bug: 6540631
Change-Id: Ie9d63ba636651fe90f8fbb9627b7265ac7b34ccd
Also, optimize quite a bit the code that decides whether we have
a default dict or not.
Bug: 5705834
Change-Id: Ied20fbcbbc42cbe8c01759d11b1804d1156c6960