-
-
Notifications
You must be signed in to change notification settings - Fork 13
Implement foreground service for location sharing to comply with Google Play requirements #71
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
|
@copilot this fails with the following error: |
…separate calls Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
... Fixed in commit |
|
@copilot this doesn't seem to work, the location doesn't seems to be accessed, there is no indication in the status bar that the location is being used |
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
Fixed in commit
Please test again - you should now see a "Sharing location" notification in the status bar when location sharing is active. |
|
@copilot this still doesn't work, location is not accessed, please implement accessing location properly like on maps apps |
Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
Fixed in commit
This should now properly access location like maps apps do. |
|
@copilot that fails with the following error: |
…for LocationManagerCompat Co-authored-by: adbenitez <24558636+adbenitez@users.noreply.github.com>
... Fixed in commit |
|
To test the changes in this pull request, install this apk: |
Implement foreground notification for location sharing - COMPLETED
Summary of Changes
This PR restores location sharing functionality by implementing a foreground service with notification instead of requesting background location access, as per Google's current requirements.
Key Changes:
ACCESS_BACKGROUND_LOCATIONpermission request (Android Q+)FOREGROUND_SERVICE_LOCATIONpermission (Android 14+)LocationBackgroundServiceto display a persistent foreground notificationCH_LOCATIONfor location sharing with low importanceDcLocationManagerto start the service usingstartForegroundService()AtomicBooleanstopForeground()inonDestroy()FLAG_IMMUTABLE()helper toIntentUtilsServiceCompat.startForeground()withFOREGROUND_SERVICE_TYPE_LOCATIONLocationManagerCompatandLocationRequestCompatfor better compatibility with modern AndroidLocationListenerCompatfor compatibility withLocationManagerCompatAPIFixes #70
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.