To take advantage of some of the new nested virtualization capabilities
of some of the images in Travis, you must be using the newest LTS
release of Ubuntu, 18.04 Bionic Beaver.
However, the Travis image of Bionic does not include support for JDK 8,
which we need to utilize the Android SDK manager. To circumvent this
issue, we change from the "android" language type to "generic", and take
care of both the JDK and the Android SDK ourselves.
As such, this commit makes the following changes:
* Switch `dist` from `trusty` to `bionic`
* Switch `language` from `android` to `generic`
* Enable the use of `sudo`
* Install libpulse0 for emulator audio
* Set up KVM inside the allocated Travis image
* Use Gravis repository to download and install Java
* Version android-wait-for-emulator in our repo
* Download and install the Android SDK ourselves
* Switch to `emulator-headless` for the x86 emulators
Since we're free to switch Java versions as we please, we can finally
support JDK 11 by switching to it after starting our emulator.
The error was sent in this line:
7235a5bc66/AnkiDroid/src/main/java/com/ichi2/async/DeckTask.java (L857)
where searchResult is null.
It's value is the result of col.findCardsForCardBrowser
this method simply returns the value returned by the Finder#findCardsForCardBrowser
The value returned by the finder itself findCardsForCardBrowser sends
null if the task was cancelled. However, the value returned is still
used by findCardsForCardBrowser. So I ensure that it's not null, but
an empty list.
For the sake of readability, I added in Ankidroid Anki's method called
Parent. I added it in Deck instead of sched, because first it makes
more sens. And in python it was a nested function, which is not proper
in java.
Here is a silly problem with porting Python code to Java. Sometimes,
it does not work the same way at all. When I committed
504d96a99d I didn't pay attention to was
the value of dues.get(nid) when nid is not in dues. And actually, the
value is None. Which means that it can't be converted to a long. And
thus raised an exception.
I also realized that the line `due = dues.get(nid);` was present twice
in the code, which makes no sens in the first place. So this second
occurrence is now removed.
This commit port to Ankidroid a PR I just did on anki's
library. arthurmilchior/anki@3f45de87b3.
https://github.com/dae/anki/pull/339
Once again, I tested this by trying to reproduce the bug with this new
version of ankidroid and checking that the bug does not exists
in this version; and that all due numbers were correctly generated.
This commit port current Anki code to Ankidroid. It ensures that when
a note is edited, and the edit generate new card, those new cards
obtain the same due value as their siblings.
The bug was reported (by me) as #5456. And I tested this correction
simply by trying to reproduce the bug with this new code, and checking
that it does not occur anymore.
This commit simultaneously corrects two problems, in which Ankidroid
differs from Anki.
When a standard model is constructed, Anki add random symbols only if
the model's name is already used in the collection. This is now the
case in Ankidroid too.
When a model of name m is cloned, if "m - copy" already exists, then a
random string is appended. This is now the case in Ankidroid too.
* catch and report TTS errors
implement onError() to report a Toast with some hints to the user
in case the TTS engine returns an error.
From API 21 upwards we would also have the error code available
for further details on what happened.
* Display Snackbar for failing TTS
In case TTS output fails display a Snackbar with an error
message and a help link pointing to the FAQ with recovery
instructions.
jacoco 0.8.4 -> 0.8.5 started failing fast for all errors, but
it turns out that there were certain configurations (present in
typical android instrumented test situations) where certain failures
(like inability to write /jacoco.exec) had no consequence because actual
output went to a different directory (like /data/data/<package>/**/*.ec)
solution is to package a properties file that instructs the jacoco-agent
used to boot the app to not attempt it's normal output
Before this commit, in ModelManager, the addField method's type
contained `throws ConfirmModSchemaException`.
This method add variants not sending exception:
* for new models,
* when mod is already changed.
I added a private method, so that the actual work can be factorized.
Answer feature request #5542
This has been tested by starting Ankidroid, openining the Browser with
a real collection, and checking that I can select interval and see
their values correctly.
Tested-by: Arthur Milchior <Arthur@Milchior.fr>