-
Notifications
You must be signed in to change notification settings - Fork 66
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
Fixed onCreate issue Android 14 #178
Conversation
android/common/src/main/java/com/marianhello/bgloc/provider/DistanceFilterLocationProvider.java
Outdated
Show resolved
Hide resolved
How sure are you about this fix? |
|
Do you think you can implement the "better" solution? |
I refactored code to use explicit intents instead of implicit ones. |
Great, thanks! |
...common/src/main/java/com/marianhello/bgloc/provider/ActivityRecognitionLocationProvider.java
Show resolved
Hide resolved
@rrrasti I want to release a version soon, any chance to get a feedback on the above questions? |
Hi @HarelM, do you have any plans to release the new version with this correction? I'm having problems with the plugin when compiling for Android SDK 34, and testing the code in this PR worked correctly |
I need answers to the above questions (android 12, 13 and mutable flag) in order to merge this. |
Hi @HarelM. 1 - Compiled for SDK 34: Ok, capture working in the background My config:
Do you need any more tests? |
Ahh, I thought that there was a change around the mutable flags, but it was only a white space change... |
@HarelM Ok I will wait |
I have released a new version, and tested it on my app only to see that the locations are not captured while the app is not topmost... :-( I'll need to investigate I guess if this fix works for you... |
I tested it today with the new version and when leaving the application in the background, geolocations continued to be captured. Which SDK target did you test? |
I released a new version with foreground service location permission yesterday, which is working as expected on my physical device and on the emulator. |
This solves the following error when targeting Android 14+:
java.lang.IllegalArgumentException: Targeting U+ (version 34 and above) disallows creating or retrieving a PendingIntent with FLAG_MUTABLE, an implicit Intent within and without FLAG_NO_CREATE and FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT for security reasons. To retrieve an already existing PendingIntent, use FLAG_NO_CREATE, however, to create a new PendingIntent with an implicit Intent use FLAG_IMMUTABLE.
This solves the following error when targeting Android 14+:
java.lang.SecurityException: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts