* Fixed toast threading
* Added `AndroidViewModel.context`
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
* Moved to `AndroidViewModel`
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
* Changed error invocation
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
* Added back constructor inject
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
* Save Application with val instead of util method
* Use LiveData for error message
---------
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Co-authored-by: Ricki Hirner <hirner@bitfire.at>
* Implement proper network check before manual sync
Do a proper connectivity check, to show a message to the user, about the sync being scheduled for when connectivity is available, before enqueueing the SyncWorker.
* Update the sync status in accounts adapter to include pending syncs
This is relevant for when a manual sync is triggered without connectivity.
* Replace Toast by Snackbar
* Replace ViewModel by AndroidViewModel
---------
Co-authored-by: Ricki Hirner <hirner@bitfire.at>
- disable per-app language preference for now (will be enabled again with bitfireAT/davx5#245)
- disable Jetifier (doesn't seem to be explicitly required for in-app rating API anymore)
- remove Locator dependency
- update ical4android
- add JetPack Compose dependencies
- use existing XML theme as Compose MdcTheme
- update AboutLibraries to newest version (uses Compose)
- embed AboutLibraries Compose into existing Fragment layout
ClosesbitfireAT/davx5#14
* extract WorkManager util functions and kdoc
* add PeriodicSyncWorker
* refactor and some kdoc
* use PeriodicSyncWorker and add todos
* allow SyncAdapter arguments to be passed to SyncWorker and have re-synchronization use SyncWorker
* handle sync cancellation in AccountSetting migration
* handle sync cancellation when account is renamed
* remove sync frameworks global sync setting and sync state awareness for the GUI
* Observe sync worker status in AccountListFragment
* Create setup for stepwise refactor of the sync adapters. This should keep the app from failing to build.
* Create new abstract BaseSyncer class for generic sync code. Adapt consumers and tests to use the new class.
* Move calender sync code to new CalenderSyncer class which is independent from the sync framework
* In CalendarSyncAdapterService pass sync requests from Sync Adapter Framework to SyncWorker
* Use CalenderSyncer in SyncWorker
* Move contacts sync code to new ContactsSyncer class.
* Move address book sync code to new AddressBookSyncer class
* Move jtx sync code to new JtxSyncer class
* Move tasks sync code to new TaskSyncer class
* Remove duplicate code in inherited sync adapters.
* Remove refactoring helper interface, duplicate generic sync code and some linting.
* Adapt tests for new Syncer class and move to the new package
* Remove remaining duplicate code in SyncAdapterService, add todos and edit kdoc.
* Move all the single line sync adapter services into one file.
* Remove concurrent sync runner code and its test, as we now use WorkManagers one time work requests.
* Remove SAF manual sync flag usage where unnecessary.
* Drop ability to prioritise collections for sync, as not used and hindering removal of sync adapter arguments.
* Pass simple string array to SyncWorker instead of bundle to simplify code.
* Restructure work query code.
* Get debug info from account settings and WorkManager.
* Write tests for PeriodicSyncWorker
* Test account creation will set a default sync interval for CardDAV and CalDAV
* Throw an exception if accountManager returns null for sync interval value
* Do proper interval check and add tests for AccountSettings
* Use work manager query to determine whether work is in a specific state
* [WIP] Add test to check that task provider is configured correctly on account creation
* Edit test checking that task sync is configured correctly on account creation with/without installed task app(s), by mocking TaskUtil
* Edit test such that it does not require a flaky flag
* Remove periodic sync when tasks app is uninstalled
* Bring back content triggered syncs
* Rename enqueueSyncWorker method to enqueue only for clarity
* Enable SyncAdapterFramework to cancel running SyncWorker
* Add test ensuring that SyncWorker.onStopped() interrupts the running sync thread
* Add retry policy sync on soft errors
* Check users sync conditions before enqueueing SyncWorker
* Add test for whether user sync conditions are treated correctly and kdoc
* Rename ambiguous shorthand "SAF" to "SyncFramework", as SAF usually means StorageAccessFramework
* Migration: Disable sync framework periodic syncs when interval is changed for specified authority
* Add Workers info to debug info
* Use WorkInfo.runAttemptCount to fail work after 20 soft errors
* Notify user if retry limit for soft errors has been reached
* Remove left over concurrency sync run tests prevention
* Migration: Continue to remove periodic sync framework syncs until user migration to PeriodicSyncWorker syncs is complete
* Kdoc and small changes
* Migration: Change to hard migration strategy
* Drop repairSyncIntervals method in favor of hard migration strategy
* Improve debug info of workers
* Remove sync framework periodic syncs, created by enabling content triggered syncs
* Change minimum sync interval to 15 min; minor other changes
* Fix tests
* Implement requested changes and update kdoc
* Add network connectivity restrictions to PeriodicSyncWorker
* Minor changes
* Move back sync classes to syncadapter package for now (can be separated later)
* Add KDoc
* Changes from review
* Rename test methods
* Add back global sync status warning
Co-authored-by: Ricki Hirner <hirner@bitfire.at>
* Log warning if principal URL does not provide CalDAV/CardDAV service
* Unified log messages for identical cases
---------
Co-authored-by: Ricki Hirner <hirner@bitfire.at>
* Alter the SyncWorker sync request to allow passing sync arguments along
* Request sync in SettingsActivity via SyncWorker instead of ContentResolver
* Don't use catch-all arguments as worker arguments
---------
Co-authored-by: Ricki Hirner <hirner@bitfire.at>
* Changed `password` with `token`
Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
* Fetch script: don't use --minimum-perc 20 because it's in .tx/config
---------
Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
Co-authored-by: Ricki Hirner <hirner@bitfire.at>
* check sync workers properly
* Move utils around
* Merge live data, instead of observing in view, to recalculate account list.
* Update LiveData with same value
* Remove unused context property.
---------
Co-authored-by: Ricki Hirner <hirner@bitfire.at>
* provide owner url in jtx collection
* Updated contract, added owner displayname to collections sync
* Update ical4android
---------
Co-authored-by: Patrick Lang <72232737+patrickunterwegs@users.noreply.github.com>
* Displaying language with `displayName` instead of `displayLanguage`
Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
* Added languages from `davdroid`
Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
* Fixed wrong locale tags
Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
* Using Map instead of list for language loading
Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
* Typo
Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
* Changed language loading logic
Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
* Improved docs
Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
* Moved method from `LangUtils`
Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
* Using regex
Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
* Added test for `resourceQualifierToLanguageTag`
Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
---------
Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
* add principal table with dao
* add principal table with dao
* collection saves ownerId instead of owner URL
* save and refresh principals
* show display name of collection owner in GUI
* show only the owner name (preferably) or respective url
* remove principals which do not own any collections
* Don't mock AppDatabase
* ensure we are really dealing with a principal and save it even without its display name
* ensure owner label is hidden when neither owner-displayname nor owner-url are available
* save principal urls without trailing slash
* use a custom query to find principals without collections
* Some changes
- insertOrUpdateByUrl
- don't explicitly set id=0 when not necessary,
- make it work when there are already entries with trailing slahes
- added TODOs
* Small changes
- Update principal only if display name changed
- Rename methods
- Kdoc
- Tests
* stop using simple methods with vague names
* rename method insertOrUpdateOrGet to insertOrUpdate and leave existing kdoc for explanation
---------
Co-authored-by: Ricki Hirner <hirner@bitfire.at>
* adapted JtxSyncManager, added new method in LocalJtxCollection
* minor code improvement
* inserting recurring entry as well, as the series might not have been processed yet
* version bump (preliminarily)
* version bump (preliminarily)
* Enabled automatic popup of the custom certificate dialog
Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
* Use chaining instead of .let
---------
Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
Co-authored-by: Ricki Hirner <hirner@bitfire.at>