This version uses Robolectric so android.content.TextUtils works vs
the previous method of implementing the TextUtils logic in our codebase
just for testability
- fix api gradle deprecation, add warn comment in gradle wrapper
- buildtools 27.0.3 needs to be added w/license accepted
- install SDK API 16 to match emulator API 16, remove extra tools
- tools components entry twice per Travis docs
- only including build-tools 26.0.2 as it is default per my read
- only including one android API for the build
- removing non-existent extra-android-support
- changing from API-22 emulator to API-16 per performance documentation on web
- removing "no-skin" emulator argument as it is not supported
- upgrade to gradle 4.5.1 / gradle plugin 3.1.2
- alter gradle dependencies to modern fine-grained declarations
- move api build targetSdk to match main build targetSdk
Duplicate checking code does not pad checksum with leading zeroes as main AnkiDroid code does, causing fields with checksums starting with 0 to fail to match correctly.
* Throw exception if filtered deck specified as deck in insert(), update()
* Throw exception if deck insert for a name that already exists
* Use query() instead of rawQuery() in the notes database
* Change DECK_DYN to Boolean
* Add javadoc for missing fields in FlashCardsContract
* Compat V1 was only adding first duplicate to output array
* Compat V2 now clones NoteInfo objects before adding to multiple positions
* Made NoteInfo final to prevent subclasses breaking encapsulation
* Made NoteInfo constructor private so that it's only used as a container
* Also improved the javadoc and comments in some places
Decouple the URIs for libanki style querying vs. direct SQL querying.
This has the advantage of being more intuitive, and less susceptible to SQL injection attacks
For example: content://com.ichi2.anki.flashcards/notes?deckId=1234567890123
AddContentApi supports this with a new addNotes() method. The Api does the duplicate checking to make sure no duplicates are passed to bulkInsert().
These implementations check whether the provider supports these new features using a spec version code defined as a meta-data key of the provider in the manifest.
The new bulkInsert support for notes is 2000% faster (based on inserting 2100+ notes) than inserting notes one-by-one (as in the old way).