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

Commit 9c251885 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

chore: debug display cookie again

parent 27e077d0
Loading
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ import android.accounts.AccountManager
import android.content.*
import android.os.Bundle
import android.provider.CalendarContract
import android.util.Log
import androidx.annotation.WorkerThread
import at.bitfire.davdroid.Constants
import at.bitfire.davdroid.InvalidAccountException
@@ -641,10 +642,15 @@ class AccountSettings(
        }

    fun containsPersistentCookie(): Boolean {
        return !accountManager.getUserData(


        val cookie = accountManager.getUserData(
            account,
            NCAccountUtils.Constants.KEY_OKHTTP_COOKIES
        ).isNullOrBlank()
        )

        Log.d("vincent", "cookie is: $cookie")
        return !cookie.isNullOrBlank()
    }

    fun clearCookie() {
+1 −1
Original line number Diff line number Diff line
@@ -861,7 +861,7 @@ abstract class SyncManager<ResourceType: LocalResource<*>, out CollectionType: L
                Log.d("vincent", "numAuthException ? ${syncResult.stats.numAuthExceptions}")

                // persistent session cookie is present. Probably the session is outDated. no need to show the notification
                if (accountSettings.containsPersistentCookie() && syncResult.stats.numAuthExceptions <= 1) {
                if (accountSettings.containsPersistentCookie() /*&& syncResult.stats.numAuthExceptions <= 1*/) {
                    Logger.log.log(Level.FINE, "Authorization error. Session outDated")
                    Log.d("vincent", "containts persistent cookie so returnbefore notif")
                    return