Commit 548dc28
authored
Fix NetworkOnMainThreadException for API levels below 26 (#6940)
This change addresses a ``NetworkOnMainThreadException`` that was
observed on Android API levels below 26.
The crash happened during background transitions when disconnecting an
``HttpURLConnection`` because background callbacks on these older OS
versions could run on the main thread. The fix restricts the disconnect
logic to run only on API level 26 (Android 8.0) and higher.1 parent 88f50d5 commit 548dc28
File tree
2 files changed
+10
-4
lines changed- firebase-config
- src/main/java/com/google/firebase/remoteconfig/internal
2 files changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
409 | 410 | | |
410 | 411 | | |
411 | 412 | | |
412 | | - | |
413 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
414 | 420 | | |
415 | 421 | | |
416 | 422 | | |
| |||
0 commit comments