From 6c2885ff39696ef3e75bc44c3dbd61b0349fcfb5 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 23 Aug 2022 16:25:47 +0200 Subject: [PATCH] Granfra's review --- .../android/sdk/internal/database/RealmCompactOnLaunch.kt | 5 ++--- .../internal/database/SessionRealmConfigurationFactory.kt | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmCompactOnLaunch.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmCompactOnLaunch.kt index 2cdbff4f5a..1efb2541a7 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmCompactOnLaunch.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/RealmCompactOnLaunch.kt @@ -17,13 +17,12 @@ package org.matrix.android.sdk.internal.database import io.realm.DefaultCompactOnLaunchCallback -import javax.inject.Inject -class RealmCompactOnLaunch @Inject constructor() : DefaultCompactOnLaunchCallback() { +class RealmCompactOnLaunch : DefaultCompactOnLaunchCallback() { /** * Forces all RealmCompactOnLaunch instances to be equal. * Avoids Realm throwing when multiple instances of this class are used. */ - override fun equals(other: Any?) = other is RealmSessionStoreMigration + override fun equals(other: Any?) = other is RealmCompactOnLaunch override fun hashCode() = 0x1000 } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/SessionRealmConfigurationFactory.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/SessionRealmConfigurationFactory.kt index bee629fd03..16a55c22ac 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/SessionRealmConfigurationFactory.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/SessionRealmConfigurationFactory.kt @@ -41,7 +41,6 @@ private const val REALM_NAME = "disk_store.realm" internal class SessionRealmConfigurationFactory @Inject constructor( private val realmKeysUtils: RealmKeysUtils, private val realmSessionStoreMigration: RealmSessionStoreMigration, - private val realmCompactOnLaunch: RealmCompactOnLaunch, @SessionFilesDirectory val directory: File, @SessionId val sessionId: String, @UserMd5 val userMd5: String, @@ -65,7 +64,7 @@ internal class SessionRealmConfigurationFactory @Inject constructor( } val realmConfiguration = RealmConfiguration.Builder() - .compactOnLaunch(realmCompactOnLaunch) + .compactOnLaunch(RealmCompactOnLaunch()) .directory(directory) .name(REALM_NAME) .apply {