* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
packageat.bitfire.davdroid.syncadapter
importandroid.content.Context
importandroidx.hilt.work.HiltWorker
importandroidx.work.Data
importandroidx.work.ExistingWorkPolicy
importandroidx.work.OneTimeWorkRequestBuilder
importandroidx.work.WorkManager
importandroidx.work.Worker
importandroidx.work.WorkerParameters
importat.bitfire.davdroid.log.Logger
importdagger.assisted.Assisted
importdagger.assisted.AssistedInject
importjava.util.concurrent.TimeUnit
importjava.util.logging.Level
/** Right after login to the cloud account, there is no guarantee the sync setup is finished, so user's might not see the calendar, task, contact accounts setup.
* To resolve this we need to try syncing for a specific time limit with a multiplying wait time.
* We need to use OneTimeWorker instead of PeriodicTimeWorker, because PeriodicTimWorker requires >= 15 min between it's job. But in our case, the job delays are in seconds.