Flutter background location access

2,732

I added this to the app manifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
    package="com.example.localstore">
 <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" tools:node="remove"/>

source

Share:
2,732
Magnus
Author by

Magnus

I have delivered value. But at what cost? Bachelor of Science degree in Computer Engineering. ✪ Started out on ATARI ST BASIC in the 1980's, writing mostly "Look door, take key" type games.    ✪ Spent a few years in high school writing various small programs for personal use in Delphi.    ✪ Learned PHP/SQL/HTML/JS/CSS and played around with that for a few years.    ✪ Did mostly Android and Java for a few years.    ✪ Graduated from Sweden Mid University with a BSc in Computer Engineering. At this point, I had learned all there was to know about software development, except where to find that darn "any" key...    ✪ Currently working with Flutter/Dart and Delphi (again).   

Updated on December 18, 2022

Comments

  • Magnus
    Magnus over 1 year

    When I went to update my app on Google Play, I saw a warning about something called "Sensitive app permissions" that I haven't seen before. It seems to concern call, SMS, location and file access permissions.

    Google Play Policy center / Permissions

    The Permissions declaration form on Google Play says

    Location permissions

    Not started         Your app isn't compliant

    My app uses the Flutter Location plugin and Flutter Map plugin. I request the INTERNET and ACCESS_FINE_LOCATION permissions in my manifest:

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

    Further reading on Requesting access to location in the background gives more info about coming changes to Google Play policy:

    Timeline for review and approval changes

    Beginning September 30, 2020, we will start reviewing apps that request access to location in the background. If your app is impacted, you will be notified on the App content page (Policy > App content) in the Play Console to complete the permissions declaration form.

    Beginning January 18, 2021, all new apps (first published after April 16, 2020) submitted to Google Play that access location in the background will need to be approved before they can go live.

    Beginning March 29, 2021, all existing apps (first published before April 16, 2020) that access location in the background will need to be approved or they will be removed from Google Play.

    So, should I worry about background location usage, even though I'm not requesting any permission for background location, or actively doing anything in my app to access it?

    I'm seeing the location icon (a map needle) in the status bar on my old phone running Android 7, even when the app was in the background. I've also seen the occasional "high battery usage in the background" on Android 7. On Android 9 and 10 I have not seen this though.

    I might have been sloppy to stop the location plugin when the app is "backgrounded" - however, I'm not requesting any permission for background location, so could the location plugin really collect location data in the background - and thereby violating the Google Play policy - without it?