Foreground service with PowerManager.PARTIAL_WAKE_LOCK going to sleep #62692
-
Select Topic AreaQuestion BodyI try to create simple timer. According to documentation I have permission and use this code in the ForegroundService: PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); I tried set off battery optimization etc., but this is not help. What is wrong? Note. If function in the Handler plays "tick" sound then it works fine. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You should use REQUEST_IGNORE_BATTERY_OPTIMIZATIONS permission and ignore battery optimization for the app. |
Beta Was this translation helpful? Give feedback.
You should use REQUEST_IGNORE_BATTERY_OPTIMIZATIONS permission and ignore battery optimization for the app.