Giter VIP home page Giter VIP logo

Comments (5)

divyeshsachan avatar divyeshsachan commented on June 16, 2024 11

@PatilShreyas, When this app is in background, It uses "Foreground Service". Hence ACCESS_BACKGROUND_LOCATION is not required since app with a active foreground service is not considered as background. (applicable for Android 8.0 (API level 26) and above).

Refer https://developer.android.com/about/versions/oreo/background for more details,

An app is considered to be in the foreground if any of the following is true:

  • It has a visible activity, whether the activity is started or paused.
  • It has a foreground service.
  • Another foreground app is connected to the app, either by binding to one of its services or by making use of one of its content providers.

Hence, this issue is invalid and should be closed.

from aarogyasetu_android.

divyeshsachan avatar divyeshsachan commented on June 16, 2024 2

@PatilShreyas , I have already provided you the reason why ACCESS_BACKGROUND_LOCATION is not required by this app.
Android has very good documentation. You should always read the documents carefully. In your link https://developer.android.com/about/versions/10/privacy/changes refer heading "Access to device location in the background requires permission". It is clearly written there,

An app is considered to be accessing location in the background unless one of the following conditions is satisfied:

  • An activity belonging to the app is visible.

  • The app is running a foreground service that has declared a foreground service type of location.

  • To declare the foreground service type for a service in your app, set your app's targetSdkVersion or compileSdkVersion to 29 or higher. Learn more about how foreground services can continue user-initiated actions that require access to location.

This app uses "foreground service" when activity is destroyed/or in background, Hence, this app will never be considered as background by android OS so ACCESS_BACKGROUND_LOCATION is not required at all.

Footnote: I am the developer of various apps and i know all the pitfalls of accessing location in android 8 and above. Adding to it, few manufacturers (specially MI, OnePlus, RealMe) have added additional background restrictions (mostly undocumented) upon life-cycle of android apps to save user battery. Mark my words: The only robust solution to access device location periodically is by using foreground service and it works on all android phones irrespective of their OS version, phone model or anything.

from aarogyasetu_android.

PatilShreyas avatar PatilShreyas commented on June 16, 2024

Hi @divyeshsachan see this:https://developer.android.com/about/versions/10/privacy/changes.

from aarogyasetu_android.

nikhilvibhav avatar nikhilvibhav commented on June 16, 2024

@PatilShreyas from the link you shared,

An app is considered to be accessing location in the background unless one of the following conditions is satisfied:

*An activity belonging to the app is visible.

*The app is running a foreground service that has declared a foreground service type of location.

As @divyeshsachan mentioned the app is running a foreground service.

from aarogyasetu_android.

PatilShreyas avatar PatilShreyas commented on June 16, 2024

Okay @divyeshsachan thanks for the clarification.

from aarogyasetu_android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.