0

I have listed this permission in the manifest file:

<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

However it is not granted on Pie or older, this returns false:

ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_BACKGROUND_LOCATION) == PackageManager.PERMISSION_GRANTED

I thought that this was automatically granted on older devices?

Same behavior when targeting both api 29 and api 30.

axlrtr
  • 535
  • 6
  • 23
  • 1
    I think this Link can help you: [ACCESS_BACKGROUND_LOCATION Not Working on Lower Than Q (29)](https://stackoverflow.com/questions/60384554/access-background-location-not-working-on-lower-than-q-29-android-versions) – Elham Dabiri Jul 14 '20 at 10:06

1 Answers1

1

This permission was added in api level 29. source

So simply omit this permission. You still need ACCESS_COARSE_LOCATION and/or ACCESS_FINE_LOCATION Access location in the background

Gurkonier
  • 116
  • 3