Reimplements soft logout simulation

This commit is contained in:
ericdecanini 2022-03-02 14:51:22 +01:00
parent dab866d170
commit 448e8e001f
2 changed files with 4 additions and 2 deletions

View File

@ -18,6 +18,7 @@ package org.matrix.android.sdk.internal.session.sync
import android.os.SystemClock
import okhttp3.ResponseBody
import org.matrix.android.sdk.api.failure.GlobalError
import org.matrix.android.sdk.api.logger.LoggerTag
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.initsync.InitSyncStep
@ -151,6 +152,7 @@ internal class DefaultSyncTask @Inject constructor(
defaultSyncStatusService.setStatus(SyncStatusService.Status.IncrementalSyncIdle)
val syncResponse = try {
executeRequest(globalErrorReceiver) {
globalErrorReceiver.handleGlobalError(GlobalError.InvalidToken(softLogout = true))
syncAPI.sync(
params = requestParams,
readTimeOut = readTimeOut

View File

@ -60,7 +60,7 @@ data class MainActivityArgs(
val clearCredentials: Boolean = false,
val isUserLoggedOut: Boolean = false,
val isAccountDeactivated: Boolean = false,
val isSoftLogout: Boolean = true
val isSoftLogout: Boolean = false
) : Parcelable
/**
@ -135,7 +135,7 @@ class MainActivity : VectorBaseActivity<ActivityMainBinding>(), UnlockedActivity
clearCredentials = argsFromIntent?.clearCredentials ?: false,
isUserLoggedOut = argsFromIntent?.isUserLoggedOut ?: false,
isAccountDeactivated = argsFromIntent?.isAccountDeactivated ?: false,
isSoftLogout = argsFromIntent?.isSoftLogout ?: true
isSoftLogout = argsFromIntent?.isSoftLogout ?: false
)
}