Implement foreground service for location sharing to comply with Google Play requirements#71
Implement foreground service for location sharing to comply with Google Play requirements#71
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.