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

Use newer ACTIVITY_RECOGNITION permission #197

Merged
merged 3 commits into from
Aug 2, 2024

Conversation

pmlodawski
Copy link

Hi, first of all thanks for keeping original cordova location plugin up to date!

I found an issue on Android 14 where ACTIVITY_RECOGNITION did not appear in app settings, until I changed its name in AndroidManifest, as in this PR.

@HarelM
Copy link
Collaborator

HarelM commented Aug 1, 2024

How confident are you that this is a correct change?

@HarelM
Copy link
Collaborator

HarelM commented Aug 1, 2024

I still see some docs that are using it like this plugin:
https://developer.android.com/develop/sensors-and-location/location/transitions
Others are using it like you did:
https://developer.android.com/reference/android/Manifest.permission#ACTIVITY_RECOGNITION

I don't know if this will break for older devices (i.e. below Android 14).
Can we set both permissions just to be on the safe side?

@pmlodawski
Copy link
Author

pmlodawski commented Aug 1, 2024

Permission name is changed in newer API: https://developers.google.com/android/reference/com/google/android/gms/location/ActivityRecognitionClient

For Android 10 (API level 29) and later: android.permission.ACTIVITY_RECOGNITION permission
For Android 9 (API level 28) and earlier: com.google.android.gms.permission.ACTIVITY_RECOGNITION permission.

@HarelM
Copy link
Collaborator

HarelM commented Aug 1, 2024

Do you think the plugin should have both permissions to be on the safe side?

@pmlodawski
Copy link
Author

@HarelM that's a good idea, I updated my PR

@pmlodawski pmlodawski changed the title Update ACTIVITY_RECOGNITION permission name Use newer ACTIVITY_RECOGNITION permission Aug 2, 2024
@HarelM HarelM merged commit e79fbbb into HaylLtd:stable Aug 2, 2024
1 check passed
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.

2 participants