Questions tagged [android-doze-and-standby]
73 questions
28
votes
4 answers
Android AlarmManager.setExactAndAllowWhileIdle() and WakefulBroadcastReceiver Not working in some new manufactured and low price devices
I think this question is asked many time in stackoverflow but still so many people struggling to resolved it.
In my android app I have to wake up device for every half hour to getting current location and send it to server. For this I have used…

Himanshu
- 861
- 10
- 25
26
votes
1 answer
How does doze mode affect background/foreground services, with/without partial/full wakelocks?
This is a simple question, seeing that there is a huge post about this on G+ (here), and lack of information on official docs (here ):
What happens to the app's services when the device goes to "doze" mode?
What does it do to background/foreground…

android developer
- 114,585
- 152
- 739
- 1,270
22
votes
3 answers
How does Doze/Standby feature affect location updates?
Does anyone know if a whitelisted app that is holding a partial wake-lock can receive location updates while the device is in Doze or the app is in Standby?
The Android docs…
user462297
17
votes
0 answers
How to detect if App has gone in or out of App Standyby Mode ( Android M+)
If the device is in DOZE IDLE or IDLE_MAINTENANCE mode, these events can be received if we register a broadcast receiver for "android.os.action.DEVICE_IDLE_MODE_CHANGED". But this receiver is not working when making App to go into App Standby using…

Adil Bhatty
- 17,190
- 34
- 81
- 118
15
votes
3 answers
How to protect background service/alarms to be kill in newly launched devices in customized OS like oppo - coloros, vivo-funtouch os, Xiomi-MIUI os?
I have a WakefulBroadcastReceiver with IntentService, every half hour alarm called and doing some stuff.
I have already handle doze mode with setExactAndAllowWhileIdle() method.
Some new smart phones with customized os recently launched in market…

Himanshu
- 861
- 10
- 25
13
votes
1 answer
Android - Repeating Alarms Allowed While Idle
I need to set a repeating alarm every X hours that would even fire in doze mode. However, the only Apis available in AlarmManager for Android 23 are setExactAndAllowWhileIdle and setAndAllowWhileIdle which are not for repeating alarms.
I am…

lyc001
- 777
- 1
- 10
- 25
11
votes
2 answers
PowerManager.isIgnoringBatteryOptimizations always returns true even if is removed from 'Not optimized apps'
I have a mileage logbook app which does GPS tracking and is able to establish a OBDII connection to a car in background.
Now I want to show a Popup which informs the users if my app is not whitelisted in doze since this may stop my background…

stefan
- 1,336
- 3
- 21
- 46
11
votes
1 answer
How to deal with Huawei's and Xiaomi's "battery optimizations"
I have an app that listens for notifications via NotificationListenerService. My app survives both the Doze mode and app stand by on almost any phone (if properly set-up e.g. exception or a foreground service).
Then come the Huawei and Xiaomi with…

shelll
- 3,234
- 3
- 33
- 67
11
votes
2 answers
Alarm Manager issue in Android 6.0 Doze mode
I've made an app that always worked until Android 6.0. I think it's the Doze feature that it's not allowing my Alarm to fire.
I use sharedpreferences to handle the options:
//ENABLE NIGHT MODE TIMER
int sHour =…

FilipeOS
- 801
- 1
- 11
- 42
9
votes
2 answers
How can I allow Android to Doze while my app is open and the screen is on?
I am making an app that will run when the device is locked, via Activity#setShowWhenLocked(true). I do not want to prevent the device from entering a low-power state. I know that the system does this with Always-On Display, and the display has an…

BLuFeNiX
- 2,496
- 2
- 20
- 40
8
votes
1 answer
isIgnoringBatteryOptimizations not working for Samsung
I am testing my new app and I have an issue with the
isIgnoringBatteryOptimizations
feature.
When the app starts it checks if the app is whitelisted for Doze. If not, it displays a message to the user because the app needs to be alive and cannot…

Ton
- 9,235
- 15
- 59
- 103
8
votes
2 answers
How to force Doze on Marshmallow?
Everything seems to point to these two commands:
adb shell dumpsys battery unplug
adb shell dumpsys deviceidle step
I followed the instructions on my Nexus 6 running the Marshmallow official release. I plug in my phone to my test machine. I set up…

Corey Ogburn
- 24,072
- 31
- 113
- 188
7
votes
2 answers
Workmanager doesn't work in standby and doze mode
I'm using WorkManager that schedule my notifications, it works when my smartphone is active, but it doesn't work when my smartphone is in standby. Why? There is some constraint that let me that? Or whatever?
Method notifyPush in…

user47845
- 149
- 1
- 10
7
votes
1 answer
Doze Mode/App Standby During Audio Playback
I have noticed an issue with my audio streaming app on Android 6.0 devices. Audio streaming is done via HLS over a network connection. Audio playback occurs in a foreground service with an active notification. What I've noticed is that when the app…

two1stnamz
- 608
- 1
- 6
- 18
6
votes
1 answer
What is the duration of a maintenance window during doze mode?
I am looking to use the Jobscheduler api to schedule a job when there's connectivity to download a bunch of images from push messages. Since wake locks are disregarded by the os in doze mode and since an fcm message can only wake the device a…

Kushan
- 5,855
- 3
- 31
- 45