Questions tagged [android-doze]

Doze mode introduced with Android 6.0 Marshmallow as a power-saving feature.

The Doze mode was introduced with Android 6.0 Marshmallow to improve the power usage of the device. If the device is not charging and had no user interaction for some time, the usage of CPU and network gets restricted by deferring background tasks and executing them in batches during maintenance windows.

191 questions
10
votes
3 answers

Getting location updates when in doze mode

I'm trying to get location updates in my android app when in doze mode, this used to work up to android 5.x. With android 6 and the advent of doze, no matter what I do, the updates stop at some point. After reading a few articles and stackoverflow…
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…
9
votes
0 answers

Push notifications are delayed in Android Doze mode

I am putting my Android device to sleep via adb: adb shell dumpsys battery unplug adb shell dumpsys deviceidle step <-- repeat until state is IDLE Then I am sending the following JSON: { …
kyrax
  • 1,192
  • 3
  • 13
  • 29
9
votes
2 answers

NotificationListenerService and Doze mode and App Standby

I have an app that listens for phone notifications and sends a message to an Android Wear watch via the MessageApi. Everything works good except for some devices with Android 6, especially Huawei Mate 8 (looks like all Huawei Android 6's do…
9
votes
2 answers

Nexus 5 won't go into doze mode using ADB

I have a Nexus 5 that won't go into Doze/IDLE mode using ADB commands from Windows. It's adb connected using USB cable and it is working for all other ADB commands. The screen is off. C:\>adb shell dumpsys deviceidle force-idle Unable to go idle;…
Veener
  • 4,771
  • 2
  • 29
  • 37
8
votes
1 answer

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.
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…
7
votes
4 answers

Run application in background when phone in Doze

Application is running SDK 23 and above. I am running some tasks using Service after completing the task and scheduling the next task using AlaramManager (setExactAndAllowWhileIdle). This is working fine. If the phone is idle continuously for 2 or 3…
Srikanth
  • 584
  • 1
  • 6
  • 21
7
votes
1 answer

DOZE mode Samsung device

I'm testing one application in one Android 6 where I need to pass the DOZE, for that I want to request to the users accept the igore of battery optimization. As in project AntiDoze, but when I run in a virtual device I do not have any problem, but…
JMR
  • 765
  • 1
  • 8
  • 31
7
votes
1 answer

Android Doze Mode - Bluetooth

My question is fairly simple. I would like to know what it is the best practice for my app so that it can be "Doze-proof". This is getting even more relevant as Android N will be applying Doze in more case scenario. While reading Doze Documentation…
6
votes
1 answer

How to handle user answer for ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS?

At the moment I ask the user about app features to save battery power: public void startSessionClick(View view) { String token = MyApp.getInstance().getPrefToken(); if (!TextUtils.isEmpty(token)) { throw new…
abbath0767
  • 946
  • 2
  • 11
  • 31
6
votes
2 answers

Android Nougat PhoneStateListener is not triggered

In Android (target 25) I have a background service and in onCreate function I have initialized a phone state listener. It works fine on Android versions that are before Nougat but in Nougat it doesn't work, even though the permissions are granted.…
6
votes
0 answers

Wifi Casting Doze Mode

When casting via Wifi to a Chromecast, I have users who have complained about losing connection on Android 6 devices. When looking through the logs I see this: 12-09 19:18:56.473 I/Router ( 5337): Connectivity change detected... 12-09 19:18:56.473…
Floss
  • 637
  • 4
  • 16
5
votes
0 answers

FCM High priority Message not received in Deep Doze mode testing

I start testing the app in deep doze mode by using the commands: $ adb shell dumpsys battery unplug $ adb shell dumpsys deviceidle force-idle $ adb shell dumpsys deviceidle get deep Last command to check if device is in IDLE state or not. When High…
5
votes
1 answer

ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS does nothing

I don't mean nothing happens. The dialog pops up: "Let app always run in background? Allow / Deny But then if I go into settings, App, Battery Optimizations, my app is still set to "Optimizing Battery use". I can then manually switch it to "Don't…
Geordie Wicks
  • 1,065
  • 1
  • 11
  • 27
1
2
3
12 13