Check if network access if blocked when fetching notifications (#6247)

* Add `NetworkMonitor.isNetworkBlocked()`, use it to check if Doze prevented us from loading notifications

* Only check if network is blocked after checking if we have a network available, otherwise it's always `true`

* Extract `NetworkBlockedChecker` to handle deprecations more carefully
This commit is contained in:
Jorge Martin Espinosa 2026-02-25 13:04:07 +01:00 committed by GitHub
parent 798f23316b
commit 4fb6346d4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 72 additions and 14 deletions

View file

@ -20,4 +20,9 @@ interface NetworkMonitor {
* A flow containing the current network connectivity status.
*/
val connectivity: StateFlow<NetworkStatus>
/**
* Checks if the active network is being blocked by Doze, even if it's available.
*/
fun isNetworkBlocked(): Boolean
}