Comments (1)
The best way to do this is to use the FLAG_KEEP_SCREEN_ON in your activity (and only in an activity, never in a service or other app component).
(from the linked page).
I agree with the documentation: Using this flag is better than holding a wakelock. But since it doesn't work for services, I have to hold a wakelock here (which I do).
The wakelock is released when the app is in background, but the persisitent notification is a foreground service and thus the wakelock isn't released.*
- At least on AOSP. Some vendors added custom "battery saver modes" that kill foreground services or wakelocks. See #16 for more information.
from coffee.
Related Issues (20)
- Quick Setttings Tile disabled after reboot or update HOT 15
- Support dynamic color HOT 1
- I have to click several times (on the shortcut in the notifications) to activate Coffee HOT 5
- Link to Fdroid or GitHub page in app.
- Previous wakelock isn't released when new timeout is selected
- Updated ru (Russian) translation HOT 1
- Add monochrome app icon
- Improve alternate mode HOT 7
- App icon in Android 12 dark mode
- App icon in Android 12 dark mode
- App icon in Android 12 dark mod HOT 5
- Update dependencies HOT 1
- Disable auto-turn-off on screen lock HOT 19
- Notifications disabled for Coffee HOT 2
- There's no icon showing in Android 12 when system theme is set to dark HOT 1
- video mode HOT 1
- screen pressing HOT 4
- Create a tile that allows you to change the screen fading time HOT 3
- Disable notifications HOT 1
- Clear visual indicator inside the app?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coffee.