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:
committed by
GitHub
parent
798f23316b
commit
4fb6346d4b
+5
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user