Notifications: simplify the flow by removing persistence (#2924)
* Notifications: simplify the flow by removing persistence. * Bump of minSdk to `24` (Android 7). * Add migration to remove `notification.bin` file
This commit is contained in:
parent
17678add86
commit
04e503177b
62 changed files with 2028 additions and 2618 deletions
|
|
@ -16,11 +16,9 @@
|
|||
|
||||
package io.element.android.features.preferences.impl.notifications
|
||||
|
||||
import android.content.Context
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
import com.squareup.anvil.annotations.ContributesBinding
|
||||
import io.element.android.libraries.di.AppScope
|
||||
import io.element.android.libraries.di.ApplicationContext
|
||||
import io.element.android.libraries.di.SingleIn
|
||||
import javax.inject.Inject
|
||||
|
||||
|
|
@ -31,9 +29,9 @@ interface SystemNotificationsEnabledProvider {
|
|||
@SingleIn(AppScope::class)
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultSystemNotificationsEnabledProvider @Inject constructor(
|
||||
@ApplicationContext private val context: Context,
|
||||
private val notificationManager: NotificationManagerCompat,
|
||||
) : SystemNotificationsEnabledProvider {
|
||||
override fun notificationsEnabled(): Boolean {
|
||||
return NotificationManagerCompat.from(context).areNotificationsEnabled()
|
||||
return notificationManager.areNotificationsEnabled()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue