[API] Rearchitect ChangeManager to support CardContentProvider
Our API (CardContentProvider) does not support ChangeManager. It is infeasible to make CardContentProvider compatible with suspend due to Android limitations.
This affects some screens, widgets etc...
Some methods in CardContentProvider do yet not produce an OpChanges, and need to be updated/rewritten.
Proposed solution
- Decouple consumers/producers in
ChangeManager, primarily for use in the API- A non-blocking
publish(OpChanges)method can be used - Future: batching will be available
- Current methods continue to block until subscribers are notified.
- A non-blocking
- Update all methods in CardContentProvider to publish, publishing via a method similar to
notifySubscribersAllValuesChangediif anOpChangesis not available - Gradually transition away from
notifySubscribersAllValuesChanged* This notifies of more changes than necessary
For now, only the API would use the sync method, to ensure no ordering-related issues are introduced.
If you would like to work on the issue, let me know and I'll split (1) into a subtask
@david-allison I would like to work on this issue! Please let me know once you have split (1) the subtask so I can start working on it
- https://github.com/ankidroid/Anki-Android/issues/21102
@david-allison Should i start working on the remaining tasks or would you like to split (2 & 3) those into separate subtasks first?
I think 2, and a TODO on the method you use inside the API will be sufficient to close this