Giter Club home page Giter Club logo

Comments (2)

petrnalevka avatar petrnalevka commented on September 22, 2024

Hello, this is good idea. But unfortunately at the moment do not know about a single vendor where you could detect this directly, so this section would be truly virtual.

On stock Android you can find out that battery saver is running, but I don't this this has direct effect on background processes anyway. You can see if app is or is not optimized on stock Android..

But for other vendors you would need to run a detection background process.. run something for quite a long time when not on charges for instance and see if it runs all the time..

from dont-kill-my-app.

ocram avatar ocram commented on September 22, 2024

Right, on stock Android – and in general but with limited usefulness – you have android.os.PowerManager#isDeviceIdleMode() and android.os.PowerManager#isIgnoringBatteryOptimizations(java.lang.String).

When it comes to detecting if you are affected by any (vendor-specific) optimizations, our go-to solution has always been setting some flags or storing logs during the execution of background tasks or on delivery of notifications, so that you can check for success when the app is in the foreground the next time.

from dont-kill-my-app.

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.