mendhak / gpslogger

:satellite: Lightweight GPS Logging Application For Android.
https://gpslogger.app
Other
1.99k stars 607 forks source link

Added android.permission.FOREGROUND_SERVICE_LOCATION to manifest. #1145

Closed StrajnarFilip closed 5 months ago

StrajnarFilip commented 5 months ago

Official documentation states:

Beginning with Android 14 (API level 34), you must declare an appropriate service type for each foreground service. That means you must declare the service type in your app manifest, and also request the appropriate foreground service permission for that type (in addition to requesting the FOREGROUND_SERVICE permission).

Since the app is declaring a service with android:foregroundServiceType="location", location section of the documentation specifies that permission FOREGROUND_SERVICE_LOCATION needs to be declared in manifest file.

mendhak commented 5 months ago

Hey thanks for that. Looks like the app has met most of what's asked already, the startForeground is already passing the right type too.

https://github.com/mendhak/gpslogger/blob/677536e6664776ec48618d9e62c11f213908fdc2/gpslogger/src/main/java/com/mendhak/gpslogger/GpsLoggingService.java#L128-L130

I'll merge this and try to add it to my current ongoing branch for testing.