From 448e8e001fd4cb125efce69b1469926a6ce9d203 Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Wed, 2 Mar 2022 14:51:22 +0100 Subject: [PATCH] Reimplements soft logout simulation --- .../org/matrix/android/sdk/internal/session/sync/SyncTask.kt | 2 ++ vector/src/main/java/im/vector/app/features/MainActivity.kt | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/SyncTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/SyncTask.kt index b4da1a02cd..a110f73ad2 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/SyncTask.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/SyncTask.kt @@ -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 diff --git a/vector/src/main/java/im/vector/app/features/MainActivity.kt b/vector/src/main/java/im/vector/app/features/MainActivity.kt index b7bbc4de8d..33b735551c 100644 --- a/vector/src/main/java/im/vector/app/features/MainActivity.kt +++ b/vector/src/main/java/im/vector/app/features/MainActivity.kt @@ -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(), UnlockedActivity clearCredentials = argsFromIntent?.clearCredentials ?: false, isUserLoggedOut = argsFromIntent?.isUserLoggedOut ?: false, isAccountDeactivated = argsFromIntent?.isAccountDeactivated ?: false, - isSoftLogout = argsFromIntent?.isSoftLogout ?: true + isSoftLogout = argsFromIntent?.isSoftLogout ?: false ) }