Closed UweTrottmann closed 1 year ago
getActiveNetworkInfo
does not use mContext
.isActiveNetworkMetered
does not use mContext
.Change AndroidUtils to use these deprecated methods on Android 11.
Changes in https://github.com/UweTrottmann/AndroidUtils/releases/tag/v3.1.0
Tested on Android 11 emulator, old APIs appear to work as expected. Will ship with next release then.
Describe the bug See https://issuetracker.google.com/issues/175055271 and https://android-review.googlesource.com/c/platform/frameworks/base/+/1758029
The bug was fixed in Android 12 (S) and a fix was made available to manufacturers for Android 11 (R).
Based on crash reports (search for
getActiveNetworkCapabilities
) this as indicated above only affects Android 11 devices which did not receive a patch from the manufacturer for this. The most affected device is a NVIDIA Shield Pro (unsure which model, but likely the latest).Look if using the old APIs is a workaround (check source of ConnectivityManager that they do not pass the package name or use the context).