google / google/ExoPlayer

Re: SecurityException caused by ConnectivityManager.registerDefaultNetworkCallback

Open
#9,776 2 comments 3 reactions 1 assignee Assigned to @marcbaechinger View on GitHub
bug: in platform enhancement needs triage
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

This issue is a continuation of [9002](https://github.com/google/ExoPlayer/issues/9002). We are still getting the original crash posted in the issue, because the solution shipped is modification to `Requirements.isInternetConnectivityValidated` which is not in the [original stack trace](https://github.com/google/ExoPlayer/issues/9002#issue-908201236).

The fix in 9002 is for `ConnectivityManager.getNetworkCapabilities` but `ConnectivityManager.registerDefaultNetworkCallback` also throws that exception and it is not handled.

```java
Caused by java.lang.SecurityException
Package android does not belong to 10308
android.os.Parcel.createExceptionOrNull (Parcel.java:2385)
android.os.Parcel.createException (Parcel.java:2369)
android.os.Parcel.readException (Parcel.java:2352)
android.os.Parcel.readException (Parcel.java:2294)
android.net.IConnectivityManager$Stub$Proxy.requestNetwork (IConnectivityManager.java:4597)
android.net.ConnectivityManager.sendRequestForNetwork (ConnectivityManager.java:4194)
android.net.ConnectivityManager.registerDefaultNetworkCallback (ConnectivityManager.java:4706)
android.net.ConnectivityManager.registerDefaultNetworkCallback (ConnectivityManager.java:4673)
com.google.android.exoplayer2.scheduler.RequirementsWatcher.registerNetworkCallbackV24 (RequirementsWatcher.java:136)
com.google.android.exoplayer2.scheduler.RequirementsWatcher.start (RequirementsWatcher.java:91)
com.google.android.exoplayer2.offline.DownloadManager. (DownloadManager.java:278)
```
- ExoPlayer version 2.15.1
- Android 11
- Android device: Samsung Galaxy s10e

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.