mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Add Konsist test Class with 'ContributeBinding' annotation should have allowed prefix and fix exissting issues.
Also remove annotation `DefaultPreferences`, we only have one implementation.
This commit is contained in:
+4
-5
@@ -20,7 +20,6 @@ import android.content.SharedPreferences
|
||||
import androidx.core.content.edit
|
||||
import com.squareup.anvil.annotations.ContributesBinding
|
||||
import io.element.android.libraries.di.AppScope
|
||||
import io.element.android.libraries.di.DefaultPreferences
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
@@ -32,15 +31,15 @@ interface FirebaseStore {
|
||||
}
|
||||
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultFirebaseStore @Inject constructor(
|
||||
@DefaultPreferences private val sharedPrefs: SharedPreferences,
|
||||
class SharedPreferencesFirebaseStore @Inject constructor(
|
||||
private val sharedPreferences: SharedPreferences,
|
||||
) : FirebaseStore {
|
||||
override fun getFcmToken(): String? {
|
||||
return sharedPrefs.getString(PREFS_KEY_FCM_TOKEN, null)
|
||||
return sharedPreferences.getString(PREFS_KEY_FCM_TOKEN, null)
|
||||
}
|
||||
|
||||
override fun storeFcmToken(token: String?) {
|
||||
sharedPrefs.edit {
|
||||
sharedPreferences.edit {
|
||||
putString(PREFS_KEY_FCM_TOKEN, token)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user