From ab7b807740ba793b58dcd5e0cdfcc5c85b0d45f4 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 16 Apr 2019 15:36:29 +0200 Subject: [PATCH] Rename APIs --- .../src/main/java/im/vector/matrix/android/api/Matrix.kt | 2 +- .../java/im/vector/matrix/android/api/session/Session.kt | 4 ++-- .../matrix/android/internal/session/DefaultSession.kt | 6 +++--- .../im/vector/riotredesign/features/login/LoginActivity.kt | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/Matrix.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/Matrix.kt index 704fa401..015b95e2 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/Matrix.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/Matrix.kt @@ -53,7 +53,7 @@ class Matrix private constructor(context: Context) : MatrixKoinComponent { authenticator.getLastActiveSession()?.also { currentSession = it it.open() - it.start() + it.startSync() } } diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/Session.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/Session.kt index e80650fd..bdf1d670 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/Session.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/Session.kt @@ -54,13 +54,13 @@ interface Session : * This method start the sync thread. */ @MainThread - fun start() + fun startSync() /** * This method stop the sync thread. */ @MainThread - fun stop() + fun stopSync() /** * This method allow to close a session. It does stop some services. diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/DefaultSession.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/DefaultSession.kt index 40b509a3..8ac7811c 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/DefaultSession.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/DefaultSession.kt @@ -92,13 +92,13 @@ internal class DefaultSession(override val sessionParams: SessionParams) : Sessi } @MainThread - override fun start() { + override fun startSync() { assert(isOpen) syncThread.start() } @MainThread - override fun stop() { + override fun stopSync() { assert(isOpen) syncThread.kill() } @@ -121,7 +121,7 @@ internal class DefaultSession(override val sessionParams: SessionParams) : Sessi return signOutService.signOut(object : MatrixCallback { override fun onSuccess(data: Unit) { // Close the session - stop() + stopSync() close() callback.onSuccess(data) diff --git a/vector/src/main/java/im/vector/riotredesign/features/login/LoginActivity.kt b/vector/src/main/java/im/vector/riotredesign/features/login/LoginActivity.kt index 71d9a77e..dc6f3aeb 100644 --- a/vector/src/main/java/im/vector/riotredesign/features/login/LoginActivity.kt +++ b/vector/src/main/java/im/vector/riotredesign/features/login/LoginActivity.kt @@ -67,7 +67,7 @@ class LoginActivity : VectorBaseActivity() { Matrix.getInstance().currentSession = data data.open() data.setFilter(FilterService.FilterPreset.RiotFilter) - data.start() + data.startSync() goToHome() }