Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for API 34 #90

Merged
merged 3 commits into from
Nov 5, 2023
Merged

Fixes for API 34 #90

merged 3 commits into from
Nov 5, 2023

Conversation

joshhood
Copy link
Contributor

Currently there are two crashes occuring when attempting to use the MockNavigationActivity on Android API 34:

java.lang.SecurityException: com.mapbox.services.android.navigation.testapp: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts

java.lang.SecurityException: Starting FGS with type location callerApp=ProcessRecord{a043266 10859:com.mapbox.services.android.navigation.testapp/u0a410} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_LOCATION] any of the permissions allOf=false [android.permission.ACCESS_COARSE_LOCATION, android.permission.ACCESS_FINE_LOCATION] and the app must be in the eligible state/exemptions to access the foreground only permission

@Fabi755 Fabi755 assigned Fabi755 and unassigned Fabi755 Oct 27, 2023
Copy link
Collaborator

@Fabi755 Fabi755 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your fix 💙

Copy link
Collaborator

@boldtrn boldtrn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for providing these changes @joshhood, would you mind adding a CHANGELOG entry?

@joshhood
Copy link
Contributor Author

joshhood commented Nov 1, 2023

Hi, sorry for slow reply, have added entry to CHANGELOG now

@boldtrn
Copy link
Collaborator

boldtrn commented Nov 5, 2023

Thanks a lot for the PR!

@boldtrn boldtrn merged commit 6c25902 into maplibre:main Nov 5, 2023
@@ -151,7 +151,7 @@ private PendingIntent createPendingOpenIntent(Context context) {

private void registerReceiver(Context context) {
if (context != null) {
context.registerReceiver(endNavigationBtnReceiver, new IntentFilter(END_NAVIGATION_ACTION));
context.registerReceiver(endNavigationBtnReceiver, new IntentFilter(END_NAVIGATION_ACTION), Context.RECEIVER_NOT_EXPORTED);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May bad, I seeing this too late. This call of registerReceiver is only available for API +26.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm currently investigate some time in #94. And will fix this too on this way.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for investigating @Fabi755

@Fabi755 Fabi755 mentioned this pull request Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants