Big annoying commit: execute command `./gradlew ktlintFormat` - Fix "colon-spacing"

This commit is contained in:
Benoit Marty 2021-10-01 13:27:53 +02:00 committed by Benoit Marty
parent a1caccbcc8
commit d1e9f3131a
223 changed files with 416 additions and 432 deletions

View File

@ -290,8 +290,8 @@ abstract class AttachmentViewerActivity : AppCompatActivity(), AttachmentEventLi
private fun calculateTranslationAlpha(translationY: Float, translationLimit: Int): Float = private fun calculateTranslationAlpha(translationY: Float, translationLimit: Int): Float =
1.0f - 1.0f / translationLimit.toFloat() / 4f * abs(translationY) 1.0f - 1.0f / translationLimit.toFloat() / 4f * abs(translationY)
private fun createSwipeToDismissHandler() private fun createSwipeToDismissHandler(): SwipeToDismissHandler =
: SwipeToDismissHandler = SwipeToDismissHandler( SwipeToDismissHandler(
swipeView = views.dismissContainer, swipeView = views.dismissContainer,
shouldAnimateDismiss = { shouldAnimateDismiss() }, shouldAnimateDismiss = { shouldAnimateDismiss() },
onDismiss = { animateClose() }, onDismiss = { animateClose() },

View File

@ -36,8 +36,8 @@ interface ImageLoaderTarget {
fun onResourceReady(uid: String, resource: Drawable) fun onResourceReady(uid: String, resource: Drawable)
} }
internal class DefaultImageLoaderTarget(val holder: AnimatedImageViewHolder, private val contextView: ImageView) internal class DefaultImageLoaderTarget(val holder: AnimatedImageViewHolder, private val contextView: ImageView) :
: ImageLoaderTarget { ImageLoaderTarget {
override fun contextView(): ImageView { override fun contextView(): ImageView {
return contextView return contextView
} }

View File

@ -34,8 +34,8 @@ private class LiveDataObservable<T>(
liveData.observeForever(relay) liveData.observeForever(relay)
} }
private inner class RemoveObserverInMainThread(private val observer: io.reactivex.Observer<in T>) private inner class RemoveObserverInMainThread(private val observer: io.reactivex.Observer<in T>) :
: MainThreadDisposable(), Observer<T> { MainThreadDisposable(), Observer<T> {
override fun onChanged(t: T?) { override fun onChanged(t: T?) {
if (!isDisposed) { if (!isDisposed) {

View File

@ -551,7 +551,7 @@ class SASTest : InstrumentedTest {
cryptoTestData.roomId cryptoTestData.roomId
) )
var requestID : String? = null var requestID: String? = null
mTestHelper.waitWithLatch { mTestHelper.waitWithLatch {
mTestHelper.retryPeriodicallyWithLatch(it) { mTestHelper.retryPeriodicallyWithLatch(it) {

View File

@ -36,8 +36,8 @@ import javax.inject.Inject
* non-production environment. * non-production environment.
*/ */
@MatrixScope @MatrixScope
internal class CurlLoggingInterceptor @Inject constructor() internal class CurlLoggingInterceptor @Inject constructor() :
: Interceptor { Interceptor {
/** /**
* Set any additional curl command options (see 'curl --help'). * Set any additional curl command options (see 'curl --help').

View File

@ -27,5 +27,5 @@ interface UIABaseAuth {
fun copyWithSession(session: String): UIABaseAuth fun copyWithSession(session: String): UIABaseAuth
fun asMap() : Map<String, *> fun asMap(): Map<String, *>
} }

View File

@ -26,7 +26,7 @@ sealed class CallState {
/** /**
* CreateOffer. Intermediate state between Idle and Dialing. * CreateOffer. Intermediate state between Idle and Dialing.
*/ */
object CreateOffer: CallState() object CreateOffer : CallState()
/** Dialing. Outgoing call is signaling the remote peer */ /** Dialing. Outgoing call is signaling the remote peer */
object Dialing : CallState() object Dialing : CallState()

View File

@ -89,7 +89,7 @@ data class HomeServerCapabilities(
* You can also use #isFeatureSupported prior to this call to check if the * You can also use #isFeatureSupported prior to this call to check if the
* feature is supported and report some feedback to user. * feature is supported and report some feedback to user.
*/ */
fun versionOverrideForFeature(feature: String) : String? { fun versionOverrideForFeature(feature: String): String? {
val cap = roomVersions?.capabilities?.get(feature) val cap = roomVersions?.capabilities?.get(feature)
return cap?.preferred ?: cap?.support?.lastOrNull() return cap?.preferred ?: cap?.support?.lastOrNull()
} }

View File

@ -132,7 +132,7 @@ interface IdentityService {
* the identity server offers some crypto functionality to help in accepting invitations. * the identity server offers some crypto functionality to help in accepting invitations.
* This is less secure than the client doing it itself, but may be useful where this isn't possible. * This is less secure than the client doing it itself, but may be useful where this isn't possible.
*/ */
suspend fun sign3pidInvitation(identiyServer: String, token: String, secret: String) : SignInvitationResult suspend fun sign3pidInvitation(identiyServer: String, token: String, secret: String): SignInvitationResult
fun addListener(listener: IdentityServiceListener) fun addListener(listener: IdentityServiceListener)

View File

@ -25,7 +25,7 @@ interface SyncStatusService {
/** /**
* For initial sync * For initial sync
*/ */
abstract class InitialSyncStatus: Status() abstract class InitialSyncStatus : Status()
object Idle : InitialSyncStatus() object Idle : InitialSyncStatus()
data class Progressing( data class Progressing(
@ -36,7 +36,7 @@ interface SyncStatusService {
/** /**
* For incremental sync * For incremental sync
*/ */
abstract class IncrementalSyncStatus: Status() abstract class IncrementalSyncStatus : Status()
object IncrementalSyncIdle : IncrementalSyncStatus() object IncrementalSyncIdle : IncrementalSyncStatus()
data class IncrementalSyncParsing( data class IncrementalSyncParsing(

View File

@ -19,6 +19,6 @@ package org.matrix.android.sdk.api.session.room
import org.matrix.android.sdk.api.session.room.alias.RoomAliasError import org.matrix.android.sdk.api.session.room.alias.RoomAliasError
sealed class AliasAvailabilityResult { sealed class AliasAvailabilityResult {
object Available: AliasAvailabilityResult() object Available : AliasAvailabilityResult()
data class NotAvailable(val roomAliasError: RoomAliasError) : AliasAvailabilityResult() data class NotAvailable(val roomAliasError: RoomAliasError) : AliasAvailabilityResult()
} }

View File

@ -41,5 +41,5 @@ interface RoomDirectoryService {
*/ */
suspend fun setRoomDirectoryVisibility(roomId: String, roomDirectoryVisibility: RoomDirectoryVisibility) suspend fun setRoomDirectoryVisibility(roomId: String, roomDirectoryVisibility: RoomDirectoryVisibility)
suspend fun checkAliasAvailability(aliasLocalPart: String?) : AliasAvailabilityResult suspend fun checkAliasAvailability(aliasLocalPart: String?): AliasAvailabilityResult
} }

View File

@ -220,7 +220,7 @@ interface RoomService {
.setPrefetchDistance(10) .setPrefetchDistance(10)
.build() .build()
fun getFlattenRoomSummaryChildrenOf(spaceId: String?, memberships: List<Membership> = Membership.activeMemberships()) : List<RoomSummary> fun getFlattenRoomSummaryChildrenOf(spaceId: String?, memberships: List<Membership> = Membership.activeMemberships()): List<RoomSummary>
/** /**
* Returns all the children of this space, as LiveData * Returns all the children of this space, as LiveData

View File

@ -44,7 +44,7 @@ data class CallAnswerContent(
* Capability advertisement. * Capability advertisement.
*/ */
@Json(name = "capabilities") val capabilities: CallCapabilities? = null @Json(name = "capabilities") val capabilities: CallCapabilities? = null
): CallSignalingContent { ) : CallSignalingContent {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class Answer( data class Answer(

View File

@ -41,4 +41,4 @@ data class CallCandidatesContent(
* Required. The version of the VoIP specification this messages adheres to. * Required. The version of the VoIP specification this messages adheres to.
*/ */
@Json(name = "version") override val version: String? @Json(name = "version") override val version: String?
): CallSignalingContent ) : CallSignalingContent

View File

@ -55,7 +55,7 @@ data class CallInviteContent(
*/ */
@Json(name = "capabilities") val capabilities: CallCapabilities? = null @Json(name = "capabilities") val capabilities: CallCapabilities? = null
): CallSignalingContent { ) : CallSignalingContent {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class Offer( data class Offer(
/** /**

View File

@ -47,7 +47,7 @@ data class CallNegotiateContent(
*/ */
@Json(name = "version") override val version: String? @Json(name = "version") override val version: String?
): CallSignalingContent { ) : CallSignalingContent {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class Description( data class Description(
/** /**

View File

@ -61,7 +61,7 @@ data class CallReplacesContent(
* Required. The version of the VoIP specification this messages adheres to. * Required. The version of the VoIP specification this messages adheres to.
*/ */
@Json(name = "version") override val version: String? @Json(name = "version") override val version: String?
): CallSignalingContent { ) : CallSignalingContent {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class TargetUser( data class TargetUser(

View File

@ -41,4 +41,4 @@ data class CallSelectAnswerContent(
* Required. The version of the VoIP specification this message adheres to. * Required. The version of the VoIP specification this message adheres to.
*/ */
@Json(name = "version") override val version: String? @Json(name = "version") override val version: String?
): CallSignalingContent ) : CallSignalingContent

View File

@ -31,7 +31,7 @@ interface RoomVersionService {
/** /**
* Get the recommended room version for the current homeserver * Get the recommended room version for the current homeserver
*/ */
fun getRecommendedVersion() : String fun getRecommendedVersion(): String
/** /**
* Ask if the user has enough power level to upgrade the room * Ask if the user has enough power level to upgrade the room

View File

@ -22,8 +22,8 @@ sealed class SharedSecretStorageError(message: String?) : Throwable(message) {
data class UnknownAlgorithm(val keyId: String) : SharedSecretStorageError("Unknown algorithm $keyId") data class UnknownAlgorithm(val keyId: String) : SharedSecretStorageError("Unknown algorithm $keyId")
data class UnsupportedAlgorithm(val algorithm: String) : SharedSecretStorageError("Unknown algorithm $algorithm") data class UnsupportedAlgorithm(val algorithm: String) : SharedSecretStorageError("Unknown algorithm $algorithm")
data class SecretNotEncrypted(val secretName: String) : SharedSecretStorageError("Missing content for secret $secretName") data class SecretNotEncrypted(val secretName: String) : SharedSecretStorageError("Missing content for secret $secretName")
data class SecretNotEncryptedWithKey(val secretName: String, val keyId: String) data class SecretNotEncryptedWithKey(val secretName: String, val keyId: String) :
: SharedSecretStorageError("Missing content for secret $secretName with key $keyId") SharedSecretStorageError("Missing content for secret $secretName with key $keyId")
object BadKeyFormat : SharedSecretStorageError("Bad Key Format") object BadKeyFormat : SharedSecretStorageError("Bad Key Format")
object ParsingError : SharedSecretStorageError("parsing Error") object ParsingError : SharedSecretStorageError("parsing Error")

View File

@ -34,8 +34,8 @@ sealed class MatrixItem(
) { ) {
data class UserItem(override val id: String, data class UserItem(override val id: String,
override val displayName: String? = null, override val displayName: String? = null,
override val avatarUrl: String? = null) override val avatarUrl: String? = null) :
: MatrixItem(id, displayName?.removeSuffix(ircPattern), avatarUrl) { MatrixItem(id, displayName?.removeSuffix(ircPattern), avatarUrl) {
init { init {
if (BuildConfig.DEBUG) checkId() if (BuildConfig.DEBUG) checkId()
} }
@ -45,8 +45,8 @@ sealed class MatrixItem(
data class EventItem(override val id: String, data class EventItem(override val id: String,
override val displayName: String? = null, override val displayName: String? = null,
override val avatarUrl: String? = null) override val avatarUrl: String? = null) :
: MatrixItem(id, displayName, avatarUrl) { MatrixItem(id, displayName, avatarUrl) {
init { init {
if (BuildConfig.DEBUG) checkId() if (BuildConfig.DEBUG) checkId()
} }
@ -56,8 +56,8 @@ sealed class MatrixItem(
data class RoomItem(override val id: String, data class RoomItem(override val id: String,
override val displayName: String? = null, override val displayName: String? = null,
override val avatarUrl: String? = null) override val avatarUrl: String? = null) :
: MatrixItem(id, displayName, avatarUrl) { MatrixItem(id, displayName, avatarUrl) {
init { init {
if (BuildConfig.DEBUG) checkId() if (BuildConfig.DEBUG) checkId()
} }
@ -67,8 +67,8 @@ sealed class MatrixItem(
data class SpaceItem(override val id: String, data class SpaceItem(override val id: String,
override val displayName: String? = null, override val displayName: String? = null,
override val avatarUrl: String? = null) override val avatarUrl: String? = null) :
: MatrixItem(id, displayName, avatarUrl) { MatrixItem(id, displayName, avatarUrl) {
init { init {
if (BuildConfig.DEBUG) checkId() if (BuildConfig.DEBUG) checkId()
} }
@ -78,8 +78,8 @@ sealed class MatrixItem(
data class RoomAliasItem(override val id: String, data class RoomAliasItem(override val id: String,
override val displayName: String? = null, override val displayName: String? = null,
override val avatarUrl: String? = null) override val avatarUrl: String? = null) :
: MatrixItem(id, displayName, avatarUrl) { MatrixItem(id, displayName, avatarUrl) {
init { init {
if (BuildConfig.DEBUG) checkId() if (BuildConfig.DEBUG) checkId()
} }
@ -92,8 +92,8 @@ sealed class MatrixItem(
data class GroupItem(override val id: String, data class GroupItem(override val id: String,
override val displayName: String? = null, override val displayName: String? = null,
override val avatarUrl: String? = null) override val avatarUrl: String? = null) :
: MatrixItem(id, displayName, avatarUrl) { MatrixItem(id, displayName, avatarUrl) {
init { init {
if (BuildConfig.DEBUG) checkId() if (BuildConfig.DEBUG) checkId()
} }

View File

@ -35,8 +35,8 @@ import org.matrix.android.sdk.internal.worker.SessionWorkerParams
import javax.inject.Inject import javax.inject.Inject
internal class CancelGossipRequestWorker(context: Context, internal class CancelGossipRequestWorker(context: Context,
params: WorkerParameters) params: WorkerParameters) :
: SessionSafeCoroutineWorker<CancelGossipRequestWorker.Params>(context, params, Params::class.java) { SessionSafeCoroutineWorker<CancelGossipRequestWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
internal data class Params( internal data class Params(

View File

@ -38,8 +38,8 @@ import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
internal class SendGossipRequestWorker(context: Context, internal class SendGossipRequestWorker(context: Context,
params: WorkerParameters) params: WorkerParameters) :
: SessionSafeCoroutineWorker<SendGossipRequestWorker.Params>(context, params, Params::class.java) { SessionSafeCoroutineWorker<SendGossipRequestWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
internal data class Params( internal data class Params(

View File

@ -38,8 +38,8 @@ import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
internal class SendGossipWorker(context: Context, internal class SendGossipWorker(context: Context,
params: WorkerParameters) params: WorkerParameters) :
: SessionSafeCoroutineWorker<SendGossipWorker.Params>(context, params, Params::class.java) { SessionSafeCoroutineWorker<SendGossipWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
internal data class Params( internal data class Params(

View File

@ -34,8 +34,8 @@ internal class MXOlmDecryption(
// The olm device interface // The olm device interface
private val olmDevice: MXOlmDevice, private val olmDevice: MXOlmDevice,
// the matrix userId // the matrix userId
private val userId: String) private val userId: String) :
: IMXDecrypting { IMXDecrypting {
@Throws(MXCryptoError::class) @Throws(MXCryptoError::class)
override fun decryptEvent(event: Event, timeline: String): MXEventDecryptionResult { override fun decryptEvent(event: Event, timeline: String): MXEventDecryptionResult {

View File

@ -32,8 +32,8 @@ internal class MXOlmEncryption(
private val cryptoStore: IMXCryptoStore, private val cryptoStore: IMXCryptoStore,
private val messageEncrypter: MessageEncrypter, private val messageEncrypter: MessageEncrypter,
private val deviceListManager: DeviceListManager, private val deviceListManager: DeviceListManager,
private val ensureOlmSessionsForUsersAction: EnsureOlmSessionsForUsersAction) private val ensureOlmSessionsForUsersAction: EnsureOlmSessionsForUsersAction) :
: IMXEncrypting { IMXEncrypting {
override suspend fun encryptEventContent(eventContent: Content, eventType: String, userIds: List<String>): Content { override suspend fun encryptEventContent(eventContent: Content, eventType: String, userIds: List<String>): Content {
// pick the list of recipients based on the membership list. // pick the list of recipients based on the membership list.

View File

@ -51,8 +51,8 @@ import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
internal class UpdateTrustWorker(context: Context, internal class UpdateTrustWorker(context: Context,
params: WorkerParameters) params: WorkerParameters) :
: SessionSafeCoroutineWorker<UpdateTrustWorker.Params>(context, params, Params::class.java) { SessionSafeCoroutineWorker<UpdateTrustWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
internal data class Params( internal data class Params(

View File

@ -28,8 +28,8 @@ internal open class CryptoRoomEntity(
// to avoid re-create and re-share at each startup (if rotation not needed..) // to avoid re-create and re-share at each startup (if rotation not needed..)
// This is specific to megolm but not sure how to model it better // This is specific to megolm but not sure how to model it better
var outboundSessionInfo: OutboundGroupSessionInfoEntity? = null var outboundSessionInfo: OutboundGroupSessionInfoEntity? = null
) ) :
: RealmObject() { RealmObject() {
companion object companion object
} }

View File

@ -33,8 +33,8 @@ internal open class OlmInboundGroupSessionEntity(
// olmInboundGroupSessionData contains Json // olmInboundGroupSessionData contains Json
var olmInboundGroupSessionData: String? = null, var olmInboundGroupSessionData: String? = null,
// Indicate if the key has been backed up to the homeserver // Indicate if the key has been backed up to the homeserver
var backedUp: Boolean = false) var backedUp: Boolean = false) :
: RealmObject() { RealmObject() {
fun getInboundGroupSession(): OlmInboundGroupSessionWrapper2? { fun getInboundGroupSession(): OlmInboundGroupSessionWrapper2? {
return try { return try {

View File

@ -29,8 +29,8 @@ internal open class OlmSessionEntity(@PrimaryKey var primaryKey: String = "",
var sessionId: String? = null, var sessionId: String? = null,
var deviceKey: String? = null, var deviceKey: String? = null,
var olmSessionData: String? = null, var olmSessionData: String? = null,
var lastReceivedMessageTs: Long = 0) var lastReceivedMessageTs: Long = 0) :
: RealmObject() { RealmObject() {
fun getOlmSession(): OlmSession? { fun getOlmSession(): OlmSession? {
return deserializeFromRealm(olmSessionData) return deserializeFromRealm(olmSessionData)

View File

@ -29,8 +29,7 @@ internal fun SharedSessionEntity.Companion.get(realm: Realm,
sessionId: String, sessionId: String,
userId: String, userId: String,
deviceId: String, deviceId: String,
deviceIdentityKey: String?) deviceIdentityKey: String?): SharedSessionEntity? {
: SharedSessionEntity? {
return realm.where<SharedSessionEntity>() return realm.where<SharedSessionEntity>()
.equalTo(SharedSessionEntityFields.ROOM_ID, roomId) .equalTo(SharedSessionEntityFields.ROOM_ID, roomId)
.equalTo(SharedSessionEntityFields.SESSION_ID, sessionId) .equalTo(SharedSessionEntityFields.SESSION_ID, sessionId)
@ -41,8 +40,7 @@ internal fun SharedSessionEntity.Companion.get(realm: Realm,
.findFirst() .findFirst()
} }
internal fun SharedSessionEntity.Companion.get(realm: Realm, roomId: String?, sessionId: String) internal fun SharedSessionEntity.Companion.get(realm: Realm, roomId: String?, sessionId: String): RealmResults<SharedSessionEntity> {
: RealmResults<SharedSessionEntity> {
return realm.where<SharedSessionEntity>() return realm.where<SharedSessionEntity>()
.equalTo(SharedSessionEntityFields.ROOM_ID, roomId) .equalTo(SharedSessionEntityFields.ROOM_ID, roomId)
.equalTo(SharedSessionEntityFields.SESSION_ID, sessionId) .equalTo(SharedSessionEntityFields.SESSION_ID, sessionId)
@ -55,8 +53,7 @@ internal fun SharedSessionEntity.Companion.create(realm: Realm, roomId: String?,
userId: String, userId: String,
deviceId: String, deviceId: String,
deviceIdentityKey: String, deviceIdentityKey: String,
chainIndex: Int) chainIndex: Int): SharedSessionEntity {
: SharedSessionEntity {
return realm.createObject<SharedSessionEntity>().apply { return realm.createObject<SharedSessionEntity>().apply {
this.roomId = roomId this.roomId = roomId
this.algorithm = MXCRYPTO_ALGORITHM_MEGOLM this.algorithm = MXCRYPTO_ALGORITHM_MEGOLM

View File

@ -1126,8 +1126,7 @@ internal class DefaultVerificationService @Inject constructor(
} }
} }
override fun requestKeyVerificationInDMs(methods: List<VerificationMethod>, otherUserId: String, roomId: String, localId: String?) override fun requestKeyVerificationInDMs(methods: List<VerificationMethod>, otherUserId: String, roomId: String, localId: String?): PendingVerificationRequest {
: PendingVerificationRequest {
Timber.i("## SAS Requesting verification to user: $otherUserId in room $roomId") Timber.i("## SAS Requesting verification to user: $otherUserId in room $roomId")
val requestsForUser = pendingRequests.getOrPut(otherUserId) { mutableListOf() } val requestsForUser = pendingRequests.getOrPut(otherUserId) { mutableListOf() }

View File

@ -34,8 +34,8 @@ import javax.inject.Inject
* Possible next worker : None * Possible next worker : None
*/ */
internal class SendVerificationMessageWorker(context: Context, internal class SendVerificationMessageWorker(context: Context,
params: WorkerParameters) params: WorkerParameters) :
: SessionSafeCoroutineWorker<SendVerificationMessageWorker.Params>(context, params, Params::class.java) { SessionSafeCoroutineWorker<SendVerificationMessageWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
internal data class Params( internal data class Params(

View File

@ -294,8 +294,8 @@ internal class VerificationTransportRoomMessage(
hash: String, hash: String,
commitment: String, commitment: String,
messageAuthenticationCode: String, messageAuthenticationCode: String,
shortAuthenticationStrings: List<String>) shortAuthenticationStrings: List<String>): VerificationInfoAccept =
: VerificationInfoAccept = MessageVerificationAcceptContent.create( MessageVerificationAcceptContent.create(
tid, tid,
keyAgreementProtocol, keyAgreementProtocol,
hash, hash,

View File

@ -31,8 +31,8 @@ import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
internal class EventInsertLiveObserver @Inject constructor(@SessionDatabase realmConfiguration: RealmConfiguration, internal class EventInsertLiveObserver @Inject constructor(@SessionDatabase realmConfiguration: RealmConfiguration,
private val processors: Set<@JvmSuppressWildcards EventInsertLiveProcessor>) private val processors: Set<@JvmSuppressWildcards EventInsertLiveProcessor>) :
: RealmLiveEntityObserver<EventInsertEntity>(realmConfiguration) { RealmLiveEntityObserver<EventInsertEntity>(realmConfiguration) {
override val query = Monarchy.Query { override val query = Monarchy.Query {
it.where(EventInsertEntity::class.java).equalTo(EventInsertEntityFields.CAN_BE_PROCESSED, true) it.where(EventInsertEntity::class.java).equalTo(EventInsertEntityFields.CAN_BE_PROCESSED, true)

View File

@ -34,8 +34,8 @@ import java.util.concurrent.atomic.AtomicReference
internal interface LiveEntityObserver : SessionLifecycleObserver internal interface LiveEntityObserver : SessionLifecycleObserver
internal abstract class RealmLiveEntityObserver<T : RealmObject>(protected val realmConfiguration: RealmConfiguration) internal abstract class RealmLiveEntityObserver<T : RealmObject>(protected val realmConfiguration: RealmConfiguration) :
: LiveEntityObserver, RealmChangeListener<RealmResults<T>> { LiveEntityObserver, RealmChangeListener<RealmResults<T>> {
private companion object { private companion object {
val BACKGROUND_HANDLER = createBackgroundHandler("LIVE_ENTITY_BACKGROUND") val BACKGROUND_HANDLER = createBackgroundHandler("LIVE_ENTITY_BACKGROUND")

View File

@ -32,8 +32,8 @@ import kotlin.concurrent.getOrSet
* instance. This does check each time if you are on the main thread or not and returns the appropriate realm instance. * instance. This does check each time if you are on the main thread or not and returns the appropriate realm instance.
*/ */
@SessionScope @SessionScope
internal class RealmSessionProvider @Inject constructor(@SessionDatabase private val monarchy: Monarchy) internal class RealmSessionProvider @Inject constructor(@SessionDatabase private val monarchy: Monarchy) :
: SessionLifecycleObserver { SessionLifecycleObserver {
private val realmThreadLocal = ThreadLocal<Realm>() private val realmThreadLocal = ThreadLocal<Realm>()

View File

@ -24,8 +24,8 @@ import org.matrix.android.sdk.api.session.room.model.Membership
* This class is used to store group info (groupId and membership) from the sync response. * This class is used to store group info (groupId and membership) from the sync response.
* Then GetGroupDataTask is called regularly to fetch group information from the homeserver. * Then GetGroupDataTask is called regularly to fetch group information from the homeserver.
*/ */
internal open class GroupEntity(@PrimaryKey var groupId: String = "") internal open class GroupEntity(@PrimaryKey var groupId: String = "") :
: RealmObject() { RealmObject() {
private var membershipStr: String = Membership.NONE.name private var membershipStr: String = Membership.NONE.name
var membership: Membership var membership: Membership

View File

@ -29,8 +29,7 @@ internal fun CurrentStateEventEntity.Companion.whereType(realm: Realm, roomId: S
.equalTo(CurrentStateEventEntityFields.TYPE, type) .equalTo(CurrentStateEventEntityFields.TYPE, type)
} }
internal fun CurrentStateEventEntity.Companion.whereStateKey(realm: Realm, roomId: String, type: String, stateKey: String) internal fun CurrentStateEventEntity.Companion.whereStateKey(realm: Realm, roomId: String, type: String, stateKey: String): RealmQuery<CurrentStateEventEntity> {
: RealmQuery<CurrentStateEventEntity> {
return whereType(realm = realm, roomId = roomId, type = type) return whereType(realm = realm, roomId = roomId, type = type)
.equalTo(CurrentStateEventEntityFields.STATE_KEY, stateKey) .equalTo(CurrentStateEventEntityFields.STATE_KEY, stateKey)
} }

View File

@ -119,8 +119,7 @@ internal fun RealmList<TimelineEventEntity>.find(eventId: String): TimelineEvent
internal fun TimelineEventEntity.Companion.findAllInRoomWithSendStates(realm: Realm, internal fun TimelineEventEntity.Companion.findAllInRoomWithSendStates(realm: Realm,
roomId: String, roomId: String,
sendStates: List<SendState>) sendStates: List<SendState>): RealmResults<TimelineEventEntity> {
: RealmResults<TimelineEventEntity> {
return whereRoomId(realm, roomId) return whereRoomId(realm, roomId)
.filterSendStates(sendStates) .filterSendStates(sendStates)
.findAll() .findAll()

View File

@ -43,8 +43,8 @@ interface NetworkConnectivityChecker {
@SessionScope @SessionScope
internal class DefaultNetworkConnectivityChecker @Inject constructor(private val homeServerPinger: HomeServerPinger, internal class DefaultNetworkConnectivityChecker @Inject constructor(private val homeServerPinger: HomeServerPinger,
private val backgroundDetectionObserver: BackgroundDetectionObserver, private val backgroundDetectionObserver: BackgroundDetectionObserver,
private val networkCallbackStrategy: NetworkCallbackStrategy) private val networkCallbackStrategy: NetworkCallbackStrategy) :
: NetworkConnectivityChecker { NetworkConnectivityChecker {
private val hasInternetAccess = AtomicBoolean(true) private val hasInternetAccess = AtomicBoolean(true)
private val listeners = Collections.synchronizedSet(LinkedHashSet<NetworkConnectivityChecker.Listener>()) private val listeners = Collections.synchronizedSet(LinkedHashSet<NetworkConnectivityChecker.Listener>())

View File

@ -25,7 +25,7 @@ import org.matrix.android.sdk.api.session.SessionLifecycleObserver
import javax.inject.Inject import javax.inject.Inject
@SessionScope @SessionScope
internal class SessionCoroutineScopeHolder @Inject constructor(): SessionLifecycleObserver { internal class SessionCoroutineScopeHolder @Inject constructor() : SessionLifecycleObserver {
val scope: CoroutineScope = CoroutineScope(SupervisorJob()) val scope: CoroutineScope = CoroutineScope(SupervisorJob())

View File

@ -29,8 +29,8 @@ import javax.inject.Inject
private val loggerTag = LoggerTag("CallEventProcessor", LoggerTag.VOIP) private val loggerTag = LoggerTag("CallEventProcessor", LoggerTag.VOIP)
@SessionScope @SessionScope
internal class CallEventProcessor @Inject constructor(private val callSignalingHandler: CallSignalingHandler) internal class CallEventProcessor @Inject constructor(private val callSignalingHandler: CallSignalingHandler) :
: EventInsertLiveProcessor { EventInsertLiveProcessor {
private val allowedTypes = listOf( private val allowedTypes = listOf(
EventType.CALL_ANSWER, EventType.CALL_ANSWER,

View File

@ -63,8 +63,8 @@ private data class NewAttachmentAttributes(
* Possible previous worker: None * Possible previous worker: None
* Possible next worker : Always [MultipleEventSendingDispatcherWorker] * Possible next worker : Always [MultipleEventSendingDispatcherWorker]
*/ */
internal class UploadContentWorker(val context: Context, params: WorkerParameters) internal class UploadContentWorker(val context: Context, params: WorkerParameters) :
: SessionSafeCoroutineWorker<UploadContentWorker.Params>(context, params, Params::class.java) { SessionSafeCoroutineWorker<UploadContentWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
internal data class Params( internal data class Params(

View File

@ -28,8 +28,8 @@ import javax.inject.Inject
* Possible previous worker: None * Possible previous worker: None
* Possible next worker : None * Possible next worker : None
*/ */
internal class GetGroupDataWorker(context: Context, params: WorkerParameters) internal class GetGroupDataWorker(context: Context, params: WorkerParameters) :
: SessionSafeCoroutineWorker<GetGroupDataWorker.Params>(context, params, Params::class.java) { SessionSafeCoroutineWorker<GetGroupDataWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
internal data class Params( internal data class Params(

View File

@ -23,8 +23,8 @@ import org.matrix.android.sdk.internal.session.SessionScope
import javax.inject.Inject import javax.inject.Inject
@SessionScope @SessionScope
internal class DefaultSyncStatusService @Inject constructor() internal class DefaultSyncStatusService @Inject constructor() :
: SyncStatusService, SyncStatusService,
ProgressReporter { ProgressReporter {
private val status = MutableLiveData<SyncStatusService.Status>() private val status = MutableLiveData<SyncStatusService.Status>()

View File

@ -58,8 +58,8 @@ internal class IntegrationManager @Inject constructor(matrixConfiguration: Matri
@SessionDatabase private val monarchy: Monarchy, @SessionDatabase private val monarchy: Monarchy,
private val updateUserAccountDataTask: UpdateUserAccountDataTask, private val updateUserAccountDataTask: UpdateUserAccountDataTask,
private val accountDataDataSource: UserAccountDataDataSource, private val accountDataDataSource: UserAccountDataDataSource,
private val widgetFactory: WidgetFactory) private val widgetFactory: WidgetFactory) :
: SessionLifecycleObserver { SessionLifecycleObserver {
private val currentConfigs = ArrayList<IntegrationManagerConfig>() private val currentConfigs = ArrayList<IntegrationManagerConfig>()
private val lifecycleOwner: LifecycleOwner = LifecycleOwner { lifecycleRegistry } private val lifecycleOwner: LifecycleOwner = LifecycleOwner { lifecycleRegistry }

View File

@ -20,7 +20,7 @@ import org.matrix.android.sdk.api.session.openid.OpenIdService
import org.matrix.android.sdk.api.session.openid.OpenIdToken import org.matrix.android.sdk.api.session.openid.OpenIdToken
import javax.inject.Inject import javax.inject.Inject
internal class DefaultOpenIdService @Inject constructor(private val getOpenIdTokenTask: GetOpenIdTokenTask): OpenIdService { internal class DefaultOpenIdService @Inject constructor(private val getOpenIdTokenTask: GetOpenIdTokenTask) : OpenIdService {
override suspend fun getOpenIdToken(): OpenIdToken { override suspend fun getOpenIdToken(): OpenIdToken {
return getOpenIdTokenTask.execute(Unit) return getOpenIdTokenTask.execute(Unit)

View File

@ -33,8 +33,8 @@ import org.matrix.android.sdk.internal.worker.SessionSafeCoroutineWorker
import org.matrix.android.sdk.internal.worker.SessionWorkerParams import org.matrix.android.sdk.internal.worker.SessionWorkerParams
import javax.inject.Inject import javax.inject.Inject
internal class AddPusherWorker(context: Context, params: WorkerParameters) internal class AddPusherWorker(context: Context, params: WorkerParameters) :
: SessionSafeCoroutineWorker<AddPusherWorker.Params>(context, params, Params::class.java) { SessionSafeCoroutineWorker<AddPusherWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
internal data class Params( internal data class Params(

View File

@ -93,13 +93,11 @@ internal class DefaultRoomService @Inject constructor(
return roomSummaryDataSource.getRoomSummariesLive(queryParams) return roomSummaryDataSource.getRoomSummariesLive(queryParams)
} }
override fun getPagedRoomSummariesLive(queryParams: RoomSummaryQueryParams, pagedListConfig: PagedList.Config, sortOrder: RoomSortOrder) override fun getPagedRoomSummariesLive(queryParams: RoomSummaryQueryParams, pagedListConfig: PagedList.Config, sortOrder: RoomSortOrder): LiveData<PagedList<RoomSummary>> {
: LiveData<PagedList<RoomSummary>> {
return roomSummaryDataSource.getSortedPagedRoomSummariesLive(queryParams, pagedListConfig, sortOrder) return roomSummaryDataSource.getSortedPagedRoomSummariesLive(queryParams, pagedListConfig, sortOrder)
} }
override fun getFilteredPagedRoomSummariesLive(queryParams: RoomSummaryQueryParams, pagedListConfig: PagedList.Config, sortOrder: RoomSortOrder) override fun getFilteredPagedRoomSummariesLive(queryParams: RoomSummaryQueryParams, pagedListConfig: PagedList.Config, sortOrder: RoomSortOrder): UpdatableLivePageResult {
: UpdatableLivePageResult {
return roomSummaryDataSource.getUpdatablePagedRoomSummariesLive(queryParams, pagedListConfig, sortOrder) return roomSummaryDataSource.getUpdatablePagedRoomSummariesLive(queryParams, pagedListConfig, sortOrder)
} }

View File

@ -43,7 +43,7 @@ internal interface JoinRoomTask : Task<JoinRoomTask.Params, Unit> {
val roomIdOrAlias: String, val roomIdOrAlias: String,
val reason: String?, val reason: String?,
val viaServers: List<String> = emptyList(), val viaServers: List<String> = emptyList(),
val thirdPartySigned : SignInvitationResult? = null val thirdPartySigned: SignInvitationResult? = null
) )
} }

View File

@ -31,8 +31,8 @@ import org.matrix.android.sdk.internal.di.SessionDatabase
internal class DefaultRoomPushRuleService @AssistedInject constructor(@Assisted private val roomId: String, internal class DefaultRoomPushRuleService @AssistedInject constructor(@Assisted private val roomId: String,
private val setRoomNotificationStateTask: SetRoomNotificationStateTask, private val setRoomNotificationStateTask: SetRoomNotificationStateTask,
@SessionDatabase private val monarchy: Monarchy) @SessionDatabase private val monarchy: Monarchy) :
: RoomPushRuleService { RoomPushRuleService {
@AssistedFactory @AssistedFactory
interface Factory { interface Factory {

View File

@ -37,8 +37,8 @@ internal interface SetRoomNotificationStateTask : Task<SetRoomNotificationStateT
internal class DefaultSetRoomNotificationStateTask @Inject constructor(@SessionDatabase private val monarchy: Monarchy, internal class DefaultSetRoomNotificationStateTask @Inject constructor(@SessionDatabase private val monarchy: Monarchy,
private val removePushRuleTask: RemovePushRuleTask, private val removePushRuleTask: RemovePushRuleTask,
private val addPushRuleTask: AddPushRuleTask) private val addPushRuleTask: AddPushRuleTask) :
: SetRoomNotificationStateTask { SetRoomNotificationStateTask {
override suspend fun execute(params: SetRoomNotificationStateTask.Params) { override suspend fun execute(params: SetRoomNotificationStateTask.Params) {
val currentRoomPushRule = Realm.getInstance(monarchy.realmConfiguration).use { val currentRoomPushRule = Realm.getInstance(monarchy.realmConfiguration).use {

View File

@ -54,8 +54,8 @@ internal class DefaultRelationService @AssistedInject constructor(
private val fetchEditHistoryTask: FetchEditHistoryTask, private val fetchEditHistoryTask: FetchEditHistoryTask,
private val timelineEventMapper: TimelineEventMapper, private val timelineEventMapper: TimelineEventMapper,
@SessionDatabase private val monarchy: Monarchy, @SessionDatabase private val monarchy: Monarchy,
private val taskExecutor: TaskExecutor) private val taskExecutor: TaskExecutor) :
: RelationService { RelationService {
@AssistedFactory @AssistedFactory
interface Factory { interface Factory {

View File

@ -33,8 +33,8 @@ import org.matrix.android.sdk.internal.worker.SessionWorkerParams
import javax.inject.Inject import javax.inject.Inject
// TODO This is not used. Delete? // TODO This is not used. Delete?
internal class SendRelationWorker(context: Context, params: WorkerParameters) internal class SendRelationWorker(context: Context, params: WorkerParameters) :
: SessionSafeCoroutineWorker<SendRelationWorker.Params>(context, params, Params::class.java) { SessionSafeCoroutineWorker<SendRelationWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
internal data class Params( internal data class Params(

View File

@ -38,8 +38,8 @@ import javax.inject.Inject
* Possible previous worker: Always [UploadContentWorker] * Possible previous worker: Always [UploadContentWorker]
* Possible next worker : None, but it will post new work to send events, encrypted or not * Possible next worker : None, but it will post new work to send events, encrypted or not
*/ */
internal class MultipleEventSendingDispatcherWorker(context: Context, params: WorkerParameters) internal class MultipleEventSendingDispatcherWorker(context: Context, params: WorkerParameters) :
: SessionSafeCoroutineWorker<MultipleEventSendingDispatcherWorker.Params>(context, params, Params::class.java) { SessionSafeCoroutineWorker<MultipleEventSendingDispatcherWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
internal data class Params( internal data class Params(

View File

@ -32,8 +32,8 @@ import javax.inject.Inject
* Possible previous worker: None * Possible previous worker: None
* Possible next worker : None * Possible next worker : None
*/ */
internal class RedactEventWorker(context: Context, params: WorkerParameters) internal class RedactEventWorker(context: Context, params: WorkerParameters) :
: SessionSafeCoroutineWorker<RedactEventWorker.Params>(context, params, Params::class.java) { SessionSafeCoroutineWorker<RedactEventWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
internal data class Params( internal data class Params(

View File

@ -39,8 +39,8 @@ import javax.inject.Inject
* Possible next worker : None * Possible next worker : None
*/ */
internal class SendEventWorker(context: Context, internal class SendEventWorker(context: Context,
params: WorkerParameters) params: WorkerParameters) :
: SessionSafeCoroutineWorker<SendEventWorker.Params>(context, params, Params::class.java) { SessionSafeCoroutineWorker<SendEventWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
internal data class Params( internal data class Params(

View File

@ -20,7 +20,7 @@ import org.matrix.android.sdk.api.session.SessionLifecycleObserver
import org.matrix.android.sdk.api.session.events.model.Event import org.matrix.android.sdk.api.session.events.model.Event
import org.matrix.android.sdk.api.util.Cancelable import org.matrix.android.sdk.api.util.Cancelable
internal interface EventSenderProcessor: SessionLifecycleObserver { internal interface EventSenderProcessor : SessionLifecycleObserver {
fun postEvent(event: Event): Cancelable fun postEvent(event: Event): Cancelable

View File

@ -40,8 +40,8 @@ internal class LiveTimelineEvent(private val monarchy: Monarchy,
private val coroutineScope: CoroutineScope, private val coroutineScope: CoroutineScope,
private val timelineEventMapper: TimelineEventMapper, private val timelineEventMapper: TimelineEventMapper,
private val roomId: String, private val roomId: String,
private val eventId: String) private val eventId: String) :
: MediatorLiveData<Optional<TimelineEvent>>() { MediatorLiveData<Optional<TimelineEvent>>() {
init { init {
buildAndObserveQuery() buildAndObserveQuery()

View File

@ -53,5 +53,5 @@ sealed class SpacePeekResult {
data class FailedToResolve(val spaceId: String, val roomPeekResult: PeekResult) : SpacePeekError() data class FailedToResolve(val spaceId: String, val roomPeekResult: PeekResult) : SpacePeekError()
data class NotSpaceType(val spaceId: String) : SpacePeekError() data class NotSpaceType(val spaceId: String) : SpacePeekError()
data class Success(val summary: SpacePeekSummary): SpacePeekResult() data class Success(val summary: SpacePeekSummary) : SpacePeekResult()
} }

View File

@ -22,8 +22,8 @@ import org.matrix.android.sdk.api.session.thirdparty.model.ThirdPartyUser
import javax.inject.Inject import javax.inject.Inject
internal class DefaultThirdPartyService @Inject constructor(private val getThirdPartyProtocolTask: GetThirdPartyProtocolsTask, internal class DefaultThirdPartyService @Inject constructor(private val getThirdPartyProtocolTask: GetThirdPartyProtocolsTask,
private val getThirdPartyUserTask: GetThirdPartyUserTask) private val getThirdPartyUserTask: GetThirdPartyUserTask) :
: ThirdPartyService { ThirdPartyService {
override suspend fun getThirdPartyProtocols(): Map<String, ThirdPartyProtocol> { override suspend fun getThirdPartyProtocols(): Map<String, ThirdPartyProtocol> {
return getThirdPartyProtocolTask.execute(Unit) return getThirdPartyProtocolTask.execute(Unit)

View File

@ -29,8 +29,8 @@ import java.util.HashMap
import javax.inject.Inject import javax.inject.Inject
internal class DefaultWidgetPostAPIMediator @Inject constructor(private val moshi: Moshi, internal class DefaultWidgetPostAPIMediator @Inject constructor(private val moshi: Moshi,
private val widgetPostMessageAPIProvider: WidgetPostMessageAPIProvider) private val widgetPostMessageAPIProvider: WidgetPostMessageAPIProvider) :
: WidgetPostAPIMediator { WidgetPostAPIMediator {
private val jsonAdapter = moshi.adapter<JsonDict>(JSON_DICT_PARAMETERIZED_TYPE) private val jsonAdapter = moshi.adapter<JsonDict>(JSON_DICT_PARAMETERIZED_TYPE)

View File

@ -28,8 +28,8 @@ import javax.inject.Provider
internal class DefaultWidgetService @Inject constructor(private val widgetManager: WidgetManager, internal class DefaultWidgetService @Inject constructor(private val widgetManager: WidgetManager,
private val widgetURLFormatter: WidgetURLFormatter, private val widgetURLFormatter: WidgetURLFormatter,
private val widgetPostAPIMediator: Provider<WidgetPostAPIMediator>) private val widgetPostAPIMediator: Provider<WidgetPostAPIMediator>) :
: WidgetService { WidgetService {
override fun getWidgetURLFormatter(): WidgetURLFormatter { override fun getWidgetURLFormatter(): WidgetURLFormatter {
return widgetURLFormatter return widgetURLFormatter

View File

@ -51,9 +51,9 @@ internal class WidgetManager @Inject constructor(private val integrationManager:
private val stateEventDataSource: StateEventDataSource, private val stateEventDataSource: StateEventDataSource,
private val createWidgetTask: CreateWidgetTask, private val createWidgetTask: CreateWidgetTask,
private val widgetFactory: WidgetFactory, private val widgetFactory: WidgetFactory,
@UserId private val userId: String) @UserId private val userId: String) :
: IntegrationManagerService.Listener, SessionLifecycleObserver { IntegrationManagerService.Listener, SessionLifecycleObserver {
private val lifecycleOwner: LifecycleOwner = LifecycleOwner { lifecycleRegistry } private val lifecycleOwner: LifecycleOwner = LifecycleOwner { lifecycleRegistry }
private val lifecycleRegistry: LifecycleRegistry = LifecycleRegistry(lifecycleOwner) private val lifecycleRegistry: LifecycleRegistry = LifecycleRegistry(lifecycleOwner)

View File

@ -25,7 +25,7 @@ internal interface Task<PARAMS, RESULT> {
suspend fun execute(params: PARAMS): RESULT suspend fun execute(params: PARAMS): RESULT
suspend fun executeRetry(params: PARAMS, remainingRetry: Int) : RESULT { suspend fun executeRetry(params: PARAMS, remainingRetry: Int): RESULT {
return try { return try {
execute(params) execute(params)
} catch (failure: Throwable) { } catch (failure: Throwable) {

View File

@ -19,7 +19,7 @@ package org.matrix.android.sdk.internal.util.system
import android.os.Build import android.os.Build
import javax.inject.Inject import javax.inject.Inject
internal class DefaultBuildVersionSdkIntProvider @Inject constructor() internal class DefaultBuildVersionSdkIntProvider @Inject constructor() :
: BuildVersionSdkIntProvider { BuildVersionSdkIntProvider {
override fun get() = Build.VERSION.SDK_INT override fun get() = Build.VERSION.SDK_INT
} }

View File

@ -19,8 +19,8 @@ import android.content.Context
import androidx.work.Worker import androidx.work.Worker
import androidx.work.WorkerParameters import androidx.work.WorkerParameters
internal class AlwaysSuccessfulWorker(context: Context, params: WorkerParameters) internal class AlwaysSuccessfulWorker(context: Context, params: WorkerParameters) :
: Worker(context, params) { Worker(context, params) {
override fun doWork(): Result { override fun doWork(): Result {
return Result.success() return Result.success()

View File

@ -26,8 +26,8 @@ import javax.inject.Inject
* No op interceptor * No op interceptor
*/ */
@MatrixScope @MatrixScope
internal class CurlLoggingInterceptor @Inject constructor() internal class CurlLoggingInterceptor @Inject constructor() :
: Interceptor { Interceptor {
@Throws(IOException::class) @Throws(IOException::class)
override fun intercept(chain: Interceptor.Chain): Response { override fun intercept(chain: Interceptor.Chain): Response {

View File

@ -24,7 +24,7 @@ import org.matrix.android.sdk.MatrixTest
import org.matrix.android.sdk.api.pushrules.rest.PushRule import org.matrix.android.sdk.api.pushrules.rest.PushRule
import org.matrix.android.sdk.internal.di.MoshiProvider import org.matrix.android.sdk.internal.di.MoshiProvider
class PushRuleActionsTest: MatrixTest { class PushRuleActionsTest : MatrixTest {
@Test @Test
fun test_action_parsing() { fun test_action_parsing() {

View File

@ -24,7 +24,7 @@ import org.junit.runners.MethodSorters
import org.matrix.android.sdk.MatrixTest import org.matrix.android.sdk.MatrixTest
@FixMethodOrder(MethodSorters.JVM) @FixMethodOrder(MethodSorters.JVM)
class Base58Test: MatrixTest { class Base58Test : MatrixTest {
@Test @Test
fun encode() { fun encode() {

View File

@ -23,7 +23,7 @@ import org.junit.Assert.assertTrue
import org.junit.Test import org.junit.Test
import org.matrix.android.sdk.MatrixTest import org.matrix.android.sdk.MatrixTest
class RecoveryKeyTest: MatrixTest { class RecoveryKeyTest : MatrixTest {
private val curve25519Key = byteArrayOf( private val curve25519Key = byteArrayOf(
0x77.toByte(), 0x07.toByte(), 0x6D.toByte(), 0x0A.toByte(), 0x73.toByte(), 0x18.toByte(), 0xA5.toByte(), 0x7D.toByte(), 0x77.toByte(), 0x07.toByte(), 0x6D.toByte(), 0x0A.toByte(), 0x73.toByte(), 0x18.toByte(), 0xA5.toByte(), 0x7D.toByte(),

View File

@ -21,7 +21,7 @@ import org.junit.Test
import org.matrix.android.sdk.MatrixTest import org.matrix.android.sdk.MatrixTest
import org.matrix.android.sdk.internal.util.md5 import org.matrix.android.sdk.internal.util.md5
class HelperTest: MatrixTest { class HelperTest : MatrixTest {
@Test @Test
fun testHash_ok() { fun testHash_ok() {

View File

@ -27,7 +27,7 @@ import org.junit.Test
import org.matrix.android.sdk.MatrixTest import org.matrix.android.sdk.MatrixTest
import java.util.concurrent.Executors import java.util.concurrent.Executors
class CoroutineSequencersTest: MatrixTest { class CoroutineSequencersTest : MatrixTest {
private val dispatcher = Executors.newSingleThreadExecutor().asCoroutineDispatcher() private val dispatcher = Executors.newSingleThreadExecutor().asCoroutineDispatcher()

View File

@ -129,7 +129,7 @@ fun activityIdlingResource(activityClass: Class<*>): IdlingResource {
private var callback: IdlingResource.ResourceCallback? = null private var callback: IdlingResource.ResourceCallback? = null
var hasResumed = false var hasResumed = false
private var currentActivity : Activity? = null private var currentActivity: Activity? = null
val uniqTS = System.currentTimeMillis() val uniqTS = System.currentTimeMillis()
override fun getName() = "activityIdlingResource_${activityClass.name}_$uniqTS" override fun getName() = "activityIdlingResource_${activityClass.name}_$uniqTS"

View File

@ -27,8 +27,8 @@ import javax.inject.Inject
* Test that the application is started on boot * Test that the application is started on boot
*/ */
class TestAutoStartBoot @Inject constructor(private val vectorPreferences: VectorPreferences, class TestAutoStartBoot @Inject constructor(private val vectorPreferences: VectorPreferences,
private val stringProvider: StringProvider) private val stringProvider: StringProvider) :
: TroubleshootTest(R.string.settings_troubleshoot_test_service_boot_title) { TroubleshootTest(R.string.settings_troubleshoot_test_service_boot_title) {
override fun perform(activityResultLauncher: ActivityResultLauncher<Intent>) { override fun perform(activityResultLauncher: ActivityResultLauncher<Intent>) {
if (vectorPreferences.autoStartOnBoot()) { if (vectorPreferences.autoStartOnBoot()) {

View File

@ -27,8 +27,8 @@ import im.vector.app.features.settings.troubleshoot.TroubleshootTest
import javax.inject.Inject import javax.inject.Inject
class TestBackgroundRestrictions @Inject constructor(private val context: AppCompatActivity, class TestBackgroundRestrictions @Inject constructor(private val context: AppCompatActivity,
private val stringProvider: StringProvider) private val stringProvider: StringProvider) :
: TroubleshootTest(R.string.settings_troubleshoot_test_bg_restricted_title) { TroubleshootTest(R.string.settings_troubleshoot_test_bg_restricted_title) {
override fun perform(activityResultLauncher: ActivityResultLauncher<Intent>) { override fun perform(activityResultLauncher: ActivityResultLauncher<Intent>) {
context.getSystemService<ConnectivityManager>()!!.apply { context.getSystemService<ConnectivityManager>()!!.apply {

View File

@ -30,8 +30,8 @@ import javax.inject.Inject
* Check that the play services APK is available an up-to-date. If needed provide quick fix to install it. * Check that the play services APK is available an up-to-date. If needed provide quick fix to install it.
*/ */
class TestPlayServices @Inject constructor(private val context: AppCompatActivity, class TestPlayServices @Inject constructor(private val context: AppCompatActivity,
private val stringProvider: StringProvider) private val stringProvider: StringProvider) :
: TroubleshootTest(R.string.settings_troubleshoot_test_play_services_title) { TroubleshootTest(R.string.settings_troubleshoot_test_play_services_title) {
override fun perform(activityResultLauncher: ActivityResultLauncher<Intent>) { override fun perform(activityResultLauncher: ActivityResultLauncher<Intent>) {
val apiAvailability = GoogleApiAvailability.getInstance() val apiAvailability = GoogleApiAvailability.getInstance()

View File

@ -40,8 +40,8 @@ class TestPushFromPushGateway @Inject constructor(private val context: AppCompat
private val stringProvider: StringProvider, private val stringProvider: StringProvider,
private val errorFormatter: ErrorFormatter, private val errorFormatter: ErrorFormatter,
private val pushersManager: PushersManager, private val pushersManager: PushersManager,
private val activeSessionHolder: ActiveSessionHolder) private val activeSessionHolder: ActiveSessionHolder) :
: TroubleshootTest(R.string.settings_troubleshoot_test_push_loop_title) { TroubleshootTest(R.string.settings_troubleshoot_test_push_loop_title) {
private var action: Job? = null private var action: Job? = null
private var pushReceived: Boolean = false private var pushReceived: Boolean = false

View File

@ -36,8 +36,8 @@ import javax.inject.Inject
class TestTokenRegistration @Inject constructor(private val context: AppCompatActivity, class TestTokenRegistration @Inject constructor(private val context: AppCompatActivity,
private val stringProvider: StringProvider, private val stringProvider: StringProvider,
private val pushersManager: PushersManager, private val pushersManager: PushersManager,
private val activeSessionHolder: ActiveSessionHolder) private val activeSessionHolder: ActiveSessionHolder) :
: TroubleshootTest(R.string.settings_troubleshoot_test_token_registration_title) { TroubleshootTest(R.string.settings_troubleshoot_test_token_registration_title) {
override fun perform(activityResultLauncher: ActivityResultLauncher<Intent>) { override fun perform(activityResultLauncher: ActivityResultLauncher<Intent>) {
// Check if we have a registered pusher for this token // Check if we have a registered pusher for this token

View File

@ -23,8 +23,8 @@ import org.threeten.bp.format.DateTimeFormatter
import javax.inject.Inject import javax.inject.Inject
class DefaultDateFormatterProvider @Inject constructor(private val context: Context, class DefaultDateFormatterProvider @Inject constructor(private val context: Context,
private val localeProvider: LocaleProvider) private val localeProvider: LocaleProvider) :
: DateFormatterProvider { DateFormatterProvider {
override val dateWithMonthFormatter: DateTimeFormatter by lazy { override val dateWithMonthFormatter: DateTimeFormatter by lazy {
val pattern = DateFormat.getBestDateTimePattern(localeProvider.current(), "d MMMMM") val pattern = DateFormat.getBestDateTimePattern(localeProvider.current(), "d MMMMM")

View File

@ -57,7 +57,7 @@ fun CharSequence.isMsisdn(): Boolean {
* - "fi.le.txt".insertBeforeLast("_foo") will return "fi.le_foo.txt" * - "fi.le.txt".insertBeforeLast("_foo") will return "fi.le_foo.txt"
* - null.insertBeforeLast("_foo") will return "_foo" * - null.insertBeforeLast("_foo") will return "_foo"
*/ */
fun String?.insertBeforeLast(insert: String, delimiter: String = ".") : String { fun String?.insertBeforeLast(insert: String, delimiter: String = "."): String {
if (this == null) return insert if (this == null) return insert
val idx = lastIndexOf(delimiter) val idx = lastIndexOf(delimiter)
return if (idx == -1) { return if (idx == -1) {

View File

@ -42,8 +42,8 @@ class AvatarPlaceholderModelLoaderFactory(private val context: Context) : ModelL
} }
} }
class AvatarPlaceholderModelLoader(private val context: Context) class AvatarPlaceholderModelLoader(private val context: Context) :
: ModelLoader<AvatarPlaceholder, Drawable> { ModelLoader<AvatarPlaceholder, Drawable> {
override fun buildLoadData(model: AvatarPlaceholder, width: Int, height: Int, options: Options): ModelLoader.LoadData<Drawable>? { override fun buildLoadData(model: AvatarPlaceholder, width: Int, height: Int, options: Options): ModelLoader.LoadData<Drawable>? {
return ModelLoader.LoadData(ObjectKey(model), AvatarPlaceholderDataFetcher(context, model)) return ModelLoader.LoadData(ObjectKey(model), AvatarPlaceholderDataFetcher(context, model))
@ -54,8 +54,8 @@ class AvatarPlaceholderModelLoader(private val context: Context)
} }
} }
class AvatarPlaceholderDataFetcher(context: Context, private val data: AvatarPlaceholder) class AvatarPlaceholderDataFetcher(context: Context, private val data: AvatarPlaceholder) :
: DataFetcher<Drawable> { DataFetcher<Drawable> {
private val avatarRenderer = context.vectorComponent().avatarRenderer() private val avatarRenderer = context.vectorComponent().avatarRenderer()

View File

@ -48,8 +48,8 @@ class VectorGlideModelLoaderFactory(private val context: Context) : ModelLoaderF
} }
} }
class VectorGlideModelLoader(private val context: Context) class VectorGlideModelLoader(private val context: Context) :
: ModelLoader<ImageContentRenderer.Data, InputStream> { ModelLoader<ImageContentRenderer.Data, InputStream> {
override fun handles(model: ImageContentRenderer.Data): Boolean { override fun handles(model: ImageContentRenderer.Data): Boolean {
// Always handle // Always handle
return true return true
@ -63,8 +63,8 @@ class VectorGlideModelLoader(private val context: Context)
class VectorGlideDataFetcher(context: Context, class VectorGlideDataFetcher(context: Context,
private val data: ImageContentRenderer.Data, private val data: ImageContentRenderer.Data,
private val width: Int, private val width: Int,
private val height: Int) private val height: Int) :
: DataFetcher<InputStream> { DataFetcher<InputStream> {
private val localFilesHelper = LocalFilesHelper(context) private val localFilesHelper = LocalFilesHelper(context)
private val activeSessionHolder = context.vectorComponent().activeSessionHolder() private val activeSessionHolder = context.vectorComponent().activeSessionHolder()

View File

@ -28,8 +28,8 @@ import im.vector.app.core.epoxy.ClickListener
import im.vector.app.core.epoxy.onClick import im.vector.app.core.epoxy.onClick
import im.vector.app.databinding.ViewButtonStateBinding import im.vector.app.databinding.ViewButtonStateBinding
class ButtonStateView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) class ButtonStateView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) :
: FrameLayout(context, attrs, defStyle) { FrameLayout(context, attrs, defStyle) {
sealed class State { sealed class State {
object Button : State() object Button : State()

View File

@ -24,8 +24,8 @@ import im.vector.app.R
private const val DEFAULT_MAX_HEIGHT = 200 private const val DEFAULT_MAX_HEIGHT = 200
class MaxHeightScrollView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) class MaxHeightScrollView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) :
: NestedScrollView(context, attrs, defStyle) { NestedScrollView(context, attrs, defStyle) {
var maxHeight: Int = 0 var maxHeight: Int = 0
set(value) { set(value) {

View File

@ -26,8 +26,8 @@ import im.vector.app.R
import im.vector.app.core.extensions.updateConstraintSet import im.vector.app.core.extensions.updateConstraintSet
import im.vector.app.databinding.ViewStateBinding import im.vector.app.databinding.ViewStateBinding
class StateView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) class StateView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) :
: FrameLayout(context, attrs, defStyle) { FrameLayout(context, attrs, defStyle) {
sealed class State { sealed class State {
object Content : State() object Content : State()

View File

@ -25,5 +25,5 @@ interface VectorSharedAction
/** /**
* Parent class to handle navigation events, action events, or other any events * Parent class to handle navigation events, action events, or other any events
*/ */
open class VectorSharedActionViewModel<T : VectorSharedAction>(private val store: MutableDataSource<T> = PublishDataSource()) open class VectorSharedActionViewModel<T : VectorSharedAction>(private val store: MutableDataSource<T> = PublishDataSource()) :
: ViewModel(), MutableDataSource<T> by store ViewModel(), MutableDataSource<T> by store

View File

@ -27,8 +27,8 @@ import im.vector.app.core.utils.PublishDataSource
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.Single import io.reactivex.Single
abstract class VectorViewModel<S : MvRxState, VA : VectorViewModelAction, VE : VectorViewEvents>(initialState: S) abstract class VectorViewModel<S : MvRxState, VA : VectorViewModelAction, VE : VectorViewEvents>(initialState: S) :
: BaseMvRxViewModel<S>(initialState, false) { BaseMvRxViewModel<S>(initialState, false) {
interface Factory<S : MvRxState> { interface Factory<S : MvRxState> {
fun create(state: S): BaseMvRxViewModel<S> fun create(state: S): BaseMvRxViewModel<S>

View File

@ -20,8 +20,8 @@ import com.airbnb.epoxy.TypedEpoxyController
/** /**
* Epoxy controller for generic bottom sheet actions * Epoxy controller for generic bottom sheet actions
*/ */
abstract class BottomSheetGenericController<State : BottomSheetGenericState, Action : BottomSheetGenericRadioAction> abstract class BottomSheetGenericController<State : BottomSheetGenericState, Action : BottomSheetGenericRadioAction> :
: TypedEpoxyController<State>() { TypedEpoxyController<State>() {
var listener: Listener<Action>? = null var listener: Listener<Action>? = null

View File

@ -49,7 +49,7 @@ class NotificationAreaView @JvmOverloads constructor(
var delegate: Delegate? = null var delegate: Delegate? = null
private var state: State = State.Initial private var state: State = State.Initial
private lateinit var views : ViewNotificationAreaBinding private lateinit var views: ViewNotificationAreaBinding
init { init {
setupView() setupView()

View File

@ -35,8 +35,8 @@ import im.vector.app.databinding.ViewPasswordStrengthBarBinding
class PasswordStrengthBar @JvmOverloads constructor( class PasswordStrengthBar @JvmOverloads constructor(
context: Context, context: Context,
attrs: AttributeSet? = null, attrs: AttributeSet? = null,
defStyleAttr: Int = 0) defStyleAttr: Int = 0) :
: LinearLayout(context, attrs, defStyleAttr) { LinearLayout(context, attrs, defStyleAttr) {
private val views: ViewPasswordStrengthBarBinding private val views: ViewPasswordStrengthBarBinding

View File

@ -37,7 +37,7 @@ class ReadReceiptsView @JvmOverloads constructor(
defStyleAttr: Int = 0 defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr) { ) : LinearLayout(context, attrs, defStyleAttr) {
private val views : ViewReadReceiptsBinding private val views: ViewReadReceiptsBinding
init { init {
setupView() setupView()

View File

@ -52,8 +52,7 @@ private var permissionDialogDisplayed = false
* So when the user does not grant the permission and check the box do not ask again, this boolean will be false. * So when the user does not grant the permission and check the box do not ask again, this boolean will be false.
* Only useful if the first boolean is false * Only useful if the first boolean is false
*/ */
fun ComponentActivity.registerForPermissionsResult(lambda: (allGranted: Boolean, deniedPermanently: Boolean) -> Unit) fun ComponentActivity.registerForPermissionsResult(lambda: (allGranted: Boolean, deniedPermanently: Boolean) -> Unit): ActivityResultLauncher<Array<String>> {
: ActivityResultLauncher<Array<String>> {
return registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { result -> return registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { result ->
onPermissionResult(result, lambda) onPermissionResult(result, lambda)
} }

View File

@ -53,8 +53,8 @@ private const val ANIMATION_DURATION = 250
*/ */
class AttachmentTypeSelectorView(context: Context, class AttachmentTypeSelectorView(context: Context,
inflater: LayoutInflater, inflater: LayoutInflater,
var callback: Callback?) var callback: Callback?) :
: PopupWindow(context) { PopupWindow(context) {
interface Callback { interface Callback {
fun onTypeSelected(type: Type) fun onTypeSelected(type: Type)

View File

@ -20,8 +20,8 @@ package im.vector.app.features.attachments.preview
import im.vector.app.core.extensions.exhaustive import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.platform.VectorViewModel import im.vector.app.core.platform.VectorViewModel
class AttachmentsPreviewViewModel(initialState: AttachmentsPreviewViewState) class AttachmentsPreviewViewModel(initialState: AttachmentsPreviewViewState) :
: VectorViewModel<AttachmentsPreviewViewState, AttachmentsPreviewAction, AttachmentsPreviewViewEvents>(initialState) { VectorViewModel<AttachmentsPreviewViewState, AttachmentsPreviewAction, AttachmentsPreviewViewEvents>(initialState) {
override fun handle(action: AttachmentsPreviewAction) { override fun handle(action: AttachmentsPreviewAction) {
when (action) { when (action) {

View File

@ -25,9 +25,9 @@ sealed class VectorCallViewActions : VectorViewModelAction {
object DeclineCall : VectorCallViewActions() object DeclineCall : VectorCallViewActions()
object ToggleMute : VectorCallViewActions() object ToggleMute : VectorCallViewActions()
object ToggleVideo : VectorCallViewActions() object ToggleVideo : VectorCallViewActions()
object ToggleHoldResume: VectorCallViewActions() object ToggleHoldResume : VectorCallViewActions()
data class ChangeAudioDevice(val device: CallAudioManager.Device) : VectorCallViewActions() data class ChangeAudioDevice(val device: CallAudioManager.Device) : VectorCallViewActions()
object OpenDialPad: VectorCallViewActions() object OpenDialPad : VectorCallViewActions()
data class SendDtmfDigit(val digit: String) : VectorCallViewActions() data class SendDtmfDigit(val digit: String) : VectorCallViewActions()
data class SwitchCall(val callArgs: CallArgs) : VectorCallViewActions() data class SwitchCall(val callArgs: CallArgs) : VectorCallViewActions()
@ -36,5 +36,5 @@ sealed class VectorCallViewActions : VectorViewModelAction {
object ToggleCamera : VectorCallViewActions() object ToggleCamera : VectorCallViewActions()
object ToggleHDSD : VectorCallViewActions() object ToggleHDSD : VectorCallViewActions()
object InitiateCallTransfer : VectorCallViewActions() object InitiateCallTransfer : VectorCallViewActions()
object TransferCall: VectorCallViewActions() object TransferCall : VectorCallViewActions()
} }

View File

@ -27,8 +27,8 @@ sealed class VectorCallViewEvents : VectorViewEvents {
val available: Set<CallAudioManager.Device>, val available: Set<CallAudioManager.Device>,
val current: CallAudioManager.Device val current: CallAudioManager.Device
) : VectorCallViewEvents() ) : VectorCallViewEvents()
object ShowDialPad: VectorCallViewEvents() object ShowDialPad : VectorCallViewEvents()
object ShowCallTransferScreen: VectorCallViewEvents() object ShowCallTransferScreen : VectorCallViewEvents()
// data class CallAnswered(val content: CallAnswerContent) : VectorCallViewEvents() // data class CallAnswered(val content: CallAnswerContent) : VectorCallViewEvents()
// data class CallHangup(val content: CallHangupContent) : VectorCallViewEvents() // data class CallHangup(val content: CallHangupContent) : VectorCallViewEvents()
// object CallAccepted : VectorCallViewEvents() // object CallAccepted : VectorCallViewEvents()

View File

@ -51,8 +51,8 @@ class ConferenceEventEmitter(private val context: Context) {
} }
class ConferenceEventObserver(private val context: Context, class ConferenceEventObserver(private val context: Context,
private val onBroadcastEvent: (ConferenceEvent) -> Unit) private val onBroadcastEvent: (ConferenceEvent) -> Unit) :
: LifecycleObserver { LifecycleObserver {
// See https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-android-sdk#listening-for-broadcasted-events // See https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-android-sdk#listening-for-broadcasted-events
private val broadcastReceiver = object : BroadcastReceiver() { private val broadcastReceiver = object : BroadcastReceiver() {

Some files were not shown because too many files have changed in this diff Show More