I didn't find useful info how to programically or using device's settings remove specific app from white-listed. In android 6.0 was introduced doze-mode and while-listed, the last term allows ignore partially doze-mode. To put app in white-listed apps need to perform code: Intent intent = new Intent(); intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS); intent.setData(Uri.parse("package:" + getPackageName())); startActivity(intent); I tried next actions to remove the app from white-listed, which it has just been put, but nothing help me: clear data application in settings
I have an application that uses a ForegroundService to send location updates to a server. Basically a tracker. This ForegroundService has a Handler that periodically (using postDelayed) executes a block of code to send the location. This works perfectly fine, when the app is in the foreground and even in the background, but I started to notice a delay when the phone is locked, with the screen off for about 15minutes. I mean, 15 minutes of no user activity and no charger plugged. This is happening on a Android Q (v10) device. I'm assuming this would also happen on any device running Oreo
Marshmallow APIs are very different from previous android OS. When screen is off, devices are in doze mode and unable to sync network. So for doing background operations with network we have to prevent from doze mode.