Remove unused code notificationStyleChanged()
We may properly add it again later if necessary.
This commit is contained in:
parent
a6dd7b4c18
commit
233052a3d5
5 changed files with 0 additions and 25 deletions
|
|
@ -21,9 +21,6 @@ import io.element.android.libraries.pushproviders.api.Distributor
|
||||||
import io.element.android.libraries.pushproviders.api.PushProvider
|
import io.element.android.libraries.pushproviders.api.PushProvider
|
||||||
|
|
||||||
interface PushService {
|
interface PushService {
|
||||||
// TODO Move away
|
|
||||||
fun notificationStyleChanged()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the current push provider, or null if none.
|
* Return the current push provider, or null if none.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ import io.element.android.libraries.di.AppScope
|
||||||
import io.element.android.libraries.matrix.api.MatrixClient
|
import io.element.android.libraries.matrix.api.MatrixClient
|
||||||
import io.element.android.libraries.push.api.GetCurrentPushProvider
|
import io.element.android.libraries.push.api.GetCurrentPushProvider
|
||||||
import io.element.android.libraries.push.api.PushService
|
import io.element.android.libraries.push.api.PushService
|
||||||
import io.element.android.libraries.push.impl.notifications.DefaultNotificationDrawerManager
|
|
||||||
import io.element.android.libraries.pushproviders.api.Distributor
|
import io.element.android.libraries.pushproviders.api.Distributor
|
||||||
import io.element.android.libraries.pushproviders.api.PushProvider
|
import io.element.android.libraries.pushproviders.api.PushProvider
|
||||||
import io.element.android.libraries.pushstore.api.UserPushStoreFactory
|
import io.element.android.libraries.pushstore.api.UserPushStoreFactory
|
||||||
|
|
@ -30,16 +29,11 @@ import javax.inject.Inject
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
class DefaultPushService @Inject constructor(
|
class DefaultPushService @Inject constructor(
|
||||||
private val defaultNotificationDrawerManager: DefaultNotificationDrawerManager,
|
|
||||||
private val pushersManager: PushersManager,
|
private val pushersManager: PushersManager,
|
||||||
private val userPushStoreFactory: UserPushStoreFactory,
|
private val userPushStoreFactory: UserPushStoreFactory,
|
||||||
private val pushProviders: Set<@JvmSuppressWildcards PushProvider>,
|
private val pushProviders: Set<@JvmSuppressWildcards PushProvider>,
|
||||||
private val getCurrentPushProvider: GetCurrentPushProvider,
|
private val getCurrentPushProvider: GetCurrentPushProvider,
|
||||||
) : PushService {
|
) : PushService {
|
||||||
override fun notificationStyleChanged() {
|
|
||||||
defaultNotificationDrawerManager.notificationStyleChanged()
|
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun getCurrentPushProvider(): PushProvider? {
|
override suspend fun getCurrentPushProvider(): PushProvider? {
|
||||||
val currentPushProvider = getCurrentPushProvider.getCurrentPushProvider()
|
val currentPushProvider = getCurrentPushProvider.getCurrentPushProvider()
|
||||||
return pushProviders.find { it.name == currentPushProvider }
|
return pushProviders.find { it.name == currentPushProvider }
|
||||||
|
|
|
||||||
|
|
@ -221,18 +221,6 @@ class DefaultNotificationDrawerManager @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO EAx Must be per account
|
|
||||||
fun notificationStyleChanged() {
|
|
||||||
updateEvents(doRender = true) {
|
|
||||||
val newSettings = true // pushDataStore.useCompleteNotificationFormat()
|
|
||||||
if (newSettings != useCompleteNotificationFormat) {
|
|
||||||
// Settings has changed, remove all current notifications
|
|
||||||
notificationRenderer.cancelAllNotifications()
|
|
||||||
useCompleteNotificationFormat = newSettings
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun updateEvents(
|
private fun updateEvents(
|
||||||
doRender: Boolean,
|
doRender: Boolean,
|
||||||
action: (NotificationEventQueue) -> Unit,
|
action: (NotificationEventQueue) -> Unit,
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@ class DefaultNotificationDrawerManagerTest {
|
||||||
fun `cover all APIs`() = runTest {
|
fun `cover all APIs`() = runTest {
|
||||||
// For now just call all the API. Later, add more valuable tests.
|
// For now just call all the API. Later, add more valuable tests.
|
||||||
val defaultNotificationDrawerManager = createDefaultNotificationDrawerManager()
|
val defaultNotificationDrawerManager = createDefaultNotificationDrawerManager()
|
||||||
defaultNotificationDrawerManager.notificationStyleChanged()
|
|
||||||
defaultNotificationDrawerManager.clearAllMessagesEvents(A_SESSION_ID, doRender = true)
|
defaultNotificationDrawerManager.clearAllMessagesEvents(A_SESSION_ID, doRender = true)
|
||||||
defaultNotificationDrawerManager.clearAllMessagesEvents(A_SESSION_ID, doRender = false)
|
defaultNotificationDrawerManager.clearAllMessagesEvents(A_SESSION_ID, doRender = false)
|
||||||
defaultNotificationDrawerManager.clearEvent(A_SESSION_ID, AN_EVENT_ID, doRender = true)
|
defaultNotificationDrawerManager.clearEvent(A_SESSION_ID, AN_EVENT_ID, doRender = true)
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,6 @@ class FakePushService(
|
||||||
Result.success(Unit)
|
Result.success(Unit)
|
||||||
},
|
},
|
||||||
) : PushService {
|
) : PushService {
|
||||||
override fun notificationStyleChanged() {
|
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun getCurrentPushProvider(): PushProvider? {
|
override suspend fun getCurrentPushProvider(): PushProvider? {
|
||||||
return availablePushProviders.firstOrNull()
|
return availablePushProviders.firstOrNull()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue