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

View file

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