Updated on 2026-08-14

This commit is contained in:
Tangem 2026-05-25 17:57:15 +03:00
parent 1d68916cb7
commit e3357a2ed8
4 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,21 @@
package com.tangem.core.navigation.notifications
import android.content.Context
import androidx.core.app.NotificationManagerCompat
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject
import javax.inject.Singleton
/**
* Wrapper around [NotificationManagerCompat.areNotificationsEnabled] for OS-level notification toggle state.
*
* Reflects the user's preference in system settings (independent of runtime POST_NOTIFICATIONS permission
* on Android 13+). Returns `false` if notifications are blocked at the OS level.
*/
@Singleton
class SystemNotificationsStateProvider @Inject constructor(
@ApplicationContext private val context: Context,
) {
fun areNotificationsEnabled(): Boolean = NotificationManagerCompat.from(context).areNotificationsEnabled()
}

View file

@ -2,5 +2,6 @@ package com.tangem.core.navigation.settings
class DummySettingsManager : SettingsManager {
override fun openAppSettings() = Unit
override fun openAppNotificationSettings() = Unit
override fun openBiometricSettings() = Unit
}

View file

@ -4,5 +4,7 @@ interface SettingsManager {
fun openAppSettings()
fun openAppNotificationSettings()
fun openBiometricSettings()
}