mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Update PushProvider API, remove isAvailable(), but instead rely on getDistributors() to eventually return an empty list of Distributors.
This commit is contained in:
committed by
Benoit Marty
parent
1f8b525548
commit
f72fc36de8
-11
@@ -43,17 +43,6 @@ class UnifiedPushProvider @Inject constructor(
|
||||
override val index = UnifiedPushConfig.INDEX
|
||||
override val name = UnifiedPushConfig.NAME
|
||||
|
||||
override fun isAvailable(): Boolean {
|
||||
val isAvailable = getDistributors().isNotEmpty()
|
||||
return if (isAvailable) {
|
||||
Timber.tag(loggerTag.value).d("UnifiedPush is available")
|
||||
true
|
||||
} else {
|
||||
Timber.tag(loggerTag.value).w("UnifiedPush is not available")
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
override fun getDistributors(): List<Distributor> {
|
||||
return unifiedPushDistributorProvider.getDistributors()
|
||||
}
|
||||
|
||||
-2
@@ -58,7 +58,6 @@ class UnifiedPushProviderTest {
|
||||
)
|
||||
val result = unifiedPushProvider.getDistributors()
|
||||
assertThat(result).containsExactly(Distributor("value", "Name"))
|
||||
assertThat(unifiedPushProvider.isAvailable()).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -70,7 +69,6 @@ class UnifiedPushProviderTest {
|
||||
)
|
||||
val result = unifiedPushProvider.getDistributors()
|
||||
assertThat(result).isEmpty()
|
||||
assertThat(unifiedPushProvider.isAvailable()).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user