天道酬勤,学无止境

android-appstandby

Remove app from whitelist in android marshmallow

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

2021-05-14 09:49:03    分类:问答    android   android-doze   android-appstandby

Android - Disable Forced DozeMode or AppStandByMode

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

2021-04-21 13:20:19    分类:问答    android   android-doze   battery-saver   android-doze-and-standby   android-appstandby

how to turn off doze mode for specific apps in marshmallow devices programmatically

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.

2021-04-19 03:16:33    分类:问答    android   android-6.0-marshmallow   android-doze   android-appstandby