From 76de9db94e14cc76ab53d2c42b85e0023e60b712 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 14 Apr 2026 12:21:44 +0200 Subject: [PATCH] Move `val`s at the top of the class. --- .../impl/classic/ElementClassicConnection.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/classic/ElementClassicConnection.kt b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/classic/ElementClassicConnection.kt index 55bc5e1fd6..3c4dd4de3c 100644 --- a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/classic/ElementClassicConnection.kt +++ b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/classic/ElementClassicConnection.kt @@ -80,6 +80,14 @@ class DefaultElementClassicConnection( // Flag indicating whether we have called bind on the service. private var bound: Boolean = false + private val mutableStateFlow = MutableStateFlow(ElementClassicConnectionState.Idle) + override val stateFlow = mutableStateFlow.asStateFlow() + + private val elementClassicComponent = ComponentName( + BuildConfig.elementClassicPackage, + ELEMENT_CLASSIC_SERVICE_FULL_CLASS_NAME, + ) + /** * Class for interacting with the main interface of the service. */ @@ -192,9 +200,6 @@ class DefaultElementClassicConnection( } } - private val mutableStateFlow = MutableStateFlow(ElementClassicConnectionState.Idle) - override val stateFlow = mutableStateFlow.asStateFlow() - /** * Handler of incoming messages from service. */ @@ -304,11 +309,6 @@ class DefaultElementClassicConnection( mutableStateFlow.emit(state) } - private val elementClassicComponent = ComponentName( - BuildConfig.elementClassicPackage, - ELEMENT_CLASSIC_SERVICE_FULL_CLASS_NAME, - ) - private fun Bundle.toElementClassicConnectionState(): ElementClassicConnectionState { val error = getString(KEY_ERROR_STR) return if (error != null) {