Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit 2cfedd96 authored by Fahim M. Choudhury's avatar Fahim M. Choudhury
Browse files

feat: sync Mail app when Murena SSO migration completes

After a successful Murena SSO migration, trigger a synchronization
of mail accounts to ensure they use OAuth.
parent c89d8748
Loading
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import androidx.lifecycle.Observer
import androidx.lifecycle.viewModelScope
import at.bitfire.davdroid.Constants
import at.bitfire.davdroid.InvalidAccountException
import at.bitfire.davdroid.MailAccountSyncHelper
import at.bitfire.davdroid.R
import at.bitfire.davdroid.databinding.LoginAccountDetailsBinding
import at.bitfire.davdroid.db.AppDatabase
@@ -232,7 +233,13 @@ class AccountDetailsFragment : Fragment() {
            stopMurenaSsoMigrationService()
            MurenaSsoMigrationPreferences.updateSsoMigrationStatus(requireContext(), Completed)
            Logger.log.info("Murena SSO migration is complete.")

            syncMailToUseOAuth()
        }
    }

    private fun syncMailToUseOAuth() {
        MailAccountSyncHelper.syncMailAccounts(requireContext())
    }

    private fun stopMurenaSsoMigrationService() {