Skip to content

Commit edac873

Browse files
Missing permission check
1 parent 078cb67 commit edac873

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

stream-android-core/src/main/java/io/getstream/android/core/internal/observers/network/StreamNetworkSnapshotBuilder.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,13 @@ internal class StreamNetworkSnapshotBuilder(
7676
}
7777

7878
val congested =
79-
when (networkCapabilities.flag(NetworkCapabilities.NET_CAPABILITY_NOT_CONGESTED)) {
80-
true -> false
81-
else -> null
79+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
80+
when (networkCapabilities.flag(NetworkCapabilities.NET_CAPABILITY_NOT_CONGESTED)) {
81+
true -> false
82+
else -> null
83+
}
84+
} else {
85+
null
8286
}
8387
val suspended =
8488
when (networkCapabilities.flag(NetworkCapabilities.NET_CAPABILITY_NOT_SUSPENDED)) {

0 commit comments

Comments
 (0)