Remove unused code notificationStyleChanged()

We may properly add it again later if necessary.
This commit is contained in:
Benoit Marty
2024-05-22 11:31:56 +02:00
parent a6dd7b4c18
commit 233052a3d5
5 changed files with 0 additions and 25 deletions

View File

@@ -21,9 +21,6 @@ import io.element.android.libraries.pushproviders.api.Distributor
import io.element.android.libraries.pushproviders.api.PushProvider
interface PushService {
// TODO Move away
fun notificationStyleChanged()
/**
* Return the current push provider, or null if none.
*/

View File

@@ -21,7 +21,6 @@ import io.element.android.libraries.di.AppScope
import io.element.android.libraries.matrix.api.MatrixClient
import io.element.android.libraries.push.api.GetCurrentPushProvider
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.PushProvider
import io.element.android.libraries.pushstore.api.UserPushStoreFactory
@@ -30,16 +29,11 @@ import javax.inject.Inject
@ContributesBinding(AppScope::class)
class DefaultPushService @Inject constructor(
private val defaultNotificationDrawerManager: DefaultNotificationDrawerManager,
private val pushersManager: PushersManager,
private val userPushStoreFactory: UserPushStoreFactory,
private val pushProviders: Set<@JvmSuppressWildcards PushProvider>,
private val getCurrentPushProvider: GetCurrentPushProvider,
) : PushService {
override fun notificationStyleChanged() {
defaultNotificationDrawerManager.notificationStyleChanged()
}
override suspend fun getCurrentPushProvider(): PushProvider? {
val currentPushProvider = getCurrentPushProvider.getCurrentPushProvider()
return pushProviders.find { it.name == currentPushProvider }

View File

@@ -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(
doRender: Boolean,
action: (NotificationEventQueue) -> Unit,

View File

@@ -59,7 +59,6 @@ class DefaultNotificationDrawerManagerTest {
fun `cover all APIs`() = runTest {
// For now just call all the API. Later, add more valuable tests.
val defaultNotificationDrawerManager = createDefaultNotificationDrawerManager()
defaultNotificationDrawerManager.notificationStyleChanged()
defaultNotificationDrawerManager.clearAllMessagesEvents(A_SESSION_ID, doRender = true)
defaultNotificationDrawerManager.clearAllMessagesEvents(A_SESSION_ID, doRender = false)
defaultNotificationDrawerManager.clearEvent(A_SESSION_ID, AN_EVENT_ID, doRender = true)

View File

@@ -29,9 +29,6 @@ class FakePushService(
Result.success(Unit)
},
) : PushService {
override fun notificationStyleChanged() {
}
override suspend fun getCurrentPushProvider(): PushProvider? {
return availablePushProviders.firstOrNull()
}