UweTrottmann / SeriesGuide

Track your favorite TV shows and movies on Android devices.
https://seriesgui.de
Apache License 2.0
1.95k stars 400 forks source link

Some ConnectivityManager methods can permanently fail on Android 11 #888

Closed UweTrottmann closed 1 year ago

UweTrottmann commented 1 year ago

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).

UweTrottmann commented 1 year ago

https://cs.android.com/android/platform/superproject/+/android-11.0.0_r1:frameworks/base/core/java/android/net/ConnectivityManager.java

Change AndroidUtils to use these deprecated methods on Android 11.

UweTrottmann commented 1 year ago

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.