mapbox / mapbox/mapbox-navigation-android
Please fix error "SecurityException: getDataNetworkTypeForSubscriber" for version 0.42.6 when targeting Android >= 11
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 651
- Forks
- 321
- PR merge metrics
- No merged PRs in 30d
Description
Please fix the security exception caused by the READ_PHONE_STATE permission for all of us that are using the legacy version 0.42.6 and targeting android 11/12.
The exception happens in:
mapView.onCreate(savedInstanceState);
java.lang.SecurityException: getDataNetworkTypeForSubscriber
at android.os.Parcel.createExceptionOrNull(Parcel.java:2373)
at android.os.Parcel.createException(Parcel.java:2357)
at android.os.Parcel.readException(Parcel.java:2340)
at android.os.Parcel.readException(Parcel.java:2282)
at com.android.internal.telephony.ITelephony$Stub$Proxy.getNetworkTypeForSubscriber(ITelephony.java:8762)
at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:3021)
at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:2985)
at com.mapbox.android.telemetry.TelemetryUtils.obtainCellularNetworkType(TelemetryUtils.java:157)
at com.mapbox.mapboxsdk.module.telemetry.PhoneState.(PhoneState.java:39)
at com.mapbox.mapboxsdk.module.telemetry.TelemetryImpl.onAppUserTurnstileEvent(TelemetryImpl.java:46)
at com.mapbox.mapboxsdk.maps.MapView.onCreate(MapView.java:277)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with TelemetryUtils.java at obtainCellularNetworkType and trace the call from PhoneState.java through TelemetryImpl.java and MapView.java. Reproduce the failure on Android 11 or 12 with the reported target setup, then verify that MapView.onCreate no longer raises the SecurityException while telemetry behavior remains covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100