Commit graph

2087 commits

Author SHA1 Message Date
Ricki Hirner 7f62148c75 Disable configuration cache for release builds (closes bitfireAT/davx5#263) (bitfireAT/davx5#269) 2023-05-17 18:13:27 +02:00
Sunik Kupfer a072cf0404 Add last synced time to collection properties (bitfireAT/davx5#260)
* Add last synced time to collection properties

* Show last synced time for every to the collection relevant authority

* Try finding the application name for given package name

* Resolve authority to package name before finding application label

* Use AndroidViewModel instead of ViewModel; change model LiveData to val

* Rewrite to Compose, use relative time description

---------

Co-authored-by: Ricki Hirner <hirner@bitfire.at>
2023-05-17 18:13:27 +02:00
Ricki Hirner 5aff37a9a6 Add style guide 2023-05-17 18:13:27 +02:00
Ricki Hirner 2f1757bb78 Version bump to 4.3.3-beta.2
- minor workflow changes
2023-05-17 18:13:27 +02:00
Ricki Hirner 34cc3ac670 Update ical4android (increase minimum jtx Board version) and vcard4android (fixes NoYearOfEra bug) 2023-05-17 18:13:27 +02:00
Ricki Hirner 55ee89529f Update dependencies, including cert4android and vcard4android 2023-05-17 18:07:17 +02:00
Ricki Hirner 83b5b939e1 Add issue template file so that we can enable issues for ourselves 2023-05-12 11:25:37 +02:00
Ricki Hirner b543dc9332 Fetch translations from Transifex 2023-05-12 10:50:46 +02:00
Ricki Hirner 28466ace46 Version bump to 4.3.3-beta.1 2023-05-12 10:49:38 +02:00
Sunik Kupfer 63f51c4b42 Account settings migration 13 to 14 (bitfireAT/davx5#262)
* AccountSettings: prevent redundant calls, move migrations to separate class

* Don't create AccountSettings while migrating

* Double thread sleep time to wait for sync framework to get disabled, and update logging

* Remove manual testing helper

* Fix tests

---------

Co-authored-by: Ricki Hirner <hirner@bitfire.at>
2023-05-12 10:23:47 +02:00
Ricki Hirner 8ac8971293 Update dav4jvm (WebDAV timestamps), ical4android (jtx geofence x radius), Github workflow actions 2023-05-12 00:14:05 +02:00
Arnau Mora 9748b75671 Fixed toast threading (bitfireAT/davx5#256)
* 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>
2023-05-11 18:41:07 +02:00
Sunik Kupfer 2ebb40b152 Implement proper network check before manual sync (bitfireAT/davx5#259)
* 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>
2023-05-11 18:40:29 +02:00
Ricki Hirner 5cbf14fa27 Update ical4android to fix TZ with negative DST (Google Europe/Dublin) bug 2023-05-10 13:21:12 +02:00
Ricki Hirner 2ff4b35bdb Use configuration cache to improve build speed (closes bitfireAT/davx5#248) (bitfireAT/davx5#255)
- 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
2023-05-10 13:20:57 +02:00
Ricki Hirner 7b2ffeb98e Update dependencies 2023-05-09 12:36:45 +02:00
Ricki Hirner 9917f7131a Comment out AccountSettingsTest for now because they cause strange failures 2023-05-07 08:03:21 +02:00
Ricki Hirner 1c474df606 Version bump to 4.3.3-alpha.1 2023-05-07 08:03:21 +02:00
Ricki Hirner c3cd970581 Use Jetpack Compose for AboutLibraries (bitfireAT/davx5#246)
- 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
2023-05-07 08:03:21 +02:00
Ricki Hirner 0bed00c05a Handle InvalidAccountException in SyncAdapterService 2023-05-07 08:03:21 +02:00
Sunik Kupfer f9d6bb153c Workmanager scheduled sync (bitfireAT/davx5#216)
Closes bitfireAT/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>
2023-05-07 08:03:21 +02:00
Ricki Hirner 299fb27af4
Fetch translations from Transifex 2023-05-02 14:06:43 +02:00
Ricki Hirner 9c51dadce8
Version bump to 4.3.2 2023-05-02 13:57:31 +02:00
Ricki Hirner ae3f5c8bab
Fix ProGuard rules for R8 (AGP 8.0) 2023-05-01 11:00:37 +02:00
Ricki Hirner aa063adaba
Upgrade gradle, AGP, dependencies 2023-04-29 22:50:18 +02:00
Sunik Kupfer c5b02d2bde
Log warning if principal URL does not provide CalDAV/CardDAV service (bitfireAT/davx5#242)
* 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>
2023-04-20 14:01:30 +02:00
Arnau Mora 61b6cd5e2e
Disabled GPS feature requirement (bitfireAT/davx5#241)
* Disabled GPS feature requirement

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>

* Updated GPS feature comment

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>

---------

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
2023-04-18 11:11:04 +02:00
Ricki Hirner aecabb9845
Update dependencies 2023-04-13 11:25:51 +02:00
Michael Biebl 16573e9ea6
Sync interval failure (#235)
* Fix log message

* Log a warning if repairing the sync interval failed
2023-04-12 11:41:24 +02:00
Ricki Hirner e2bfda71bc
Use large runners for CI Android tests (#306) 2023-04-12 11:39:32 +02:00
Ricki Hirner 133d155b94
Update ical4android; CI: use gradle/gradle-build-action for caching 2023-03-31 16:12:20 +02:00
Sunik Kupfer 874ad7b1c6
Handle error responses when querying principals for display names (closes bitfireAT/#237) (bitfireAT/#238)
* Add test with inaccessible principal

* Catch and log exceptions where server resource is inaccessible

* Catch and log every HttpException
2023-03-31 13:29:20 +02:00
Sunik Kupfer fc17d0ed69
SettingsActivity resync now uses SyncWorker (bitfireAT/davx5#226)
* 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>
2023-03-28 16:59:36 +02:00
Ricki Hirner 2f8340a646
SyncManager: fix logging string that always talked about address data even for events/tasks 2023-03-24 11:52:19 +01:00
Ricki Hirner 6050396a45
Update Transformations to new syntax (androidx.lifecycle:lifecycle-viewmodel-ktx:2.6) 2023-03-24 10:46:42 +01:00
Ricki Hirner 2503d92dca
Update dependencies, including ical4android (now ignores invalid properties)
Closes bitfireAT/davx5#165
2023-03-23 17:09:37 +01:00
Ricki Hirner 983a142670
Add CodeQL security scanning (#296)
* Create .github/workflows/codeql.yml

* Build explicitly instead of using autobuild (because it doesn't work)

* Checkout submodules and cache Java dependencies
2023-03-23 11:29:29 +01:00
Arnau Mora a3a8317b2f
Fix fetching list of translators (bitfireAT/davx5#232)
* 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>
2023-03-21 15:46:58 +01:00
Ricki Hirner 880abf024c
Fetch translations from Transifex 2023-03-20 13:10:34 +01:00
Ricki Hirner 83936b97ea
Bump version to 4.3.1.1 2023-03-20 12:58:10 +01:00
Ricki Hirner 50dbd66d3a
Version bump to 4.3.1 2023-03-13 18:01:20 +01:00
Arnau Mora 17fb1168cc
Generate locales with Locator (bitfireAT/davx5#218)
* Added locator plugin

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>

* Removed old generator

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>

* Updated source sets

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>

* Added locator submodule

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>

* Removed locator submodule

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>

* Moving scripts

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>

* Update dependencies

* Added `LocatorPlugin`

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>

* Fixed locales generation

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>

* Removed buildSrc

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>

* Using plugin from Jitpack

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>

* Using plugin from Gradle

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>

* Removed comment

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>

* Remove jitpack

---------

Signed-off-by: Arnau Mora <arnyminer.z@gmail.com>
Co-authored-by: Ricki Hirner <hirner@bitfire.at>
2023-03-13 18:01:13 +01:00
Ricki Hirner 89a698e7b2
Bump version to 4.3.1-beta.1 2023-03-02 13:11:09 +01:00
Ricki Hirner 6dd0af2d7a
Update Kotlin and gradle plugin 2023-03-02 13:11:08 +01:00
Patrick Lang 29a97c85ff
Fixed language selector icon for night mode (bitfireAT/davx5#223)
Update ic_language.xml

Replaced tint by  android:tint="?attr/colorControlNormal">
2023-03-02 13:11:01 +01:00
Sunik Kupfer 9fee782968
Check sync workers properly (closes bitfireAT/davx5#217) (bitfireAT/davx5#220)
* 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>
2023-02-28 10:28:52 +01:00
Sunik Kupfer fe7a928064
Provide owner url in jtx collection (bitfireAT/davx5#221)
* 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>
2023-02-28 10:28:46 +01:00
Ricki Hirner 54c6117ba2
Update dependencies 2023-02-28 10:28:29 +01:00
Arnau Mora fffb029362
Fixed missing languages and wrong display (bitfireAT/davx5#214)
* 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>
2023-02-28 10:28:19 +01:00
Sunik Kupfer b83d116f40
show real name of davowner (bitfireAT/davx5#208)
* 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>
2023-02-20 13:29:56 +01:00