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
4
votes
1 answer

Dialog for intent Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS

I am using Android 6 with Cyanogenmod and when I am starting the following intent, then nothing happens! if(Build.VERSION.SDK_INT >= Constants.IGNORE_BATTERY_OPTIMIZATIONS_MIN_BUILD) { String packageName = getPackageName(); …
4
votes
2 answers

Android Doze mode for motion sensors

I have question(s) related to Android Doze Mode (Android N [deep doze] and M). As per Android official documentation once device enters doze mode, it stops receiving location updates either via GPS or Network. And to exit doze mode, either screen…
Adil Bhatty
  • 17,190
  • 34
  • 81
  • 118
4
votes
0 answers

Android doze mode and IDLE_MODE_CHANGED intent

I am trying to identify a single reliable callback that we get in Android when the device enters Doze mode. I tried the following: IntentFilter filter = new…
4
votes
1 answer

What is Doze mode timing?

As per Android documentation If a user leaves a device unplugged and stationary for a period of time, with the screen off, the device enters Doze mode. How long does the device need to stay idle and stationary before Doze mode starts? And so on:…
Paolone
  • 475
  • 1
  • 7
  • 16
4
votes
1 answer

Testing Doze feature (Android 6.0 Marshmallow) in Genymotion

I've tried the commands from Google adb shell dumpsys battery unplug adb shell dumpsys deviceidle step on both "PREVIEW - Google Nexus 6P - 6.0.0 - API 23 - 1440x2560" and "PREVIEW - Google Nexus 5X - 6.0.0 - API 23 - 1080x1920" virtual devices…
Perry
  • 133
  • 1
  • 10
4
votes
1 answer

What does "Doze" really do? And should apps change their code because of it?

Background Android 6 has introduced a built in mechanism called "Doze" for better handling the battery while the device sleeps. The problem Problem is, I don't see how it really works, and how should apps change to handle this new mechanism, if at…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
3
votes
1 answer

Recording GPS location in the background doesn't work when battery optimizations are enabled on Android

We develop an application which is used for outdoor activities (hiking, bicycle, mountain bike, ...) and one of the main features of the application is to record the track of the user thanks to the GPS of the smartphone / tablet in the background in…
3
votes
1 answer

What exactly do wake-locks prevent?

In the wake-lock training doc it says: If you need to keep the CPU running in order to complete some work before the device goes to sleep, you can use a PowerManager system service feature called wake locks. It was my impression that "before the…
user19309143
3
votes
1 answer

Are Doze Mode and Idle the same thing?

I'm using Android Studio and i'm trying to test my app when using Doze mode. I've read some links already(including the android documentation about doze mode). However, i'm getting confused. Is there any difference between "IDLE" and "Doze mode"? It…
Yaksa
  • 176
  • 1
  • 12
3
votes
0 answers

How to detect when Android device was last used?

My app needs to know when the user last interacted with the phone, or when the device screen went off. Answers to similar questions suggested: registering a SCREEN_OFF/DEVICE_IDLE_MODE_CHANGED broadcast receiver in manifest. Problem: won't work…
fsljfke
  • 431
  • 6
  • 14
3
votes
0 answers

Android ACTION_DEVICE_IDLE_MODE_CHANGED not fired

Device: Samsung Tab A 2018 10.5 Software: Android 9 I have a broadcast receiver that is registered for the intent ACTION_DEVICE_IDLE_MODE_CHANGED. That's because I would like to stop a networking coroutine job once the app has fallen into deep sleep…
max
  • 31
  • 4
3
votes
1 answer

Unlock android device not working while call ACTION_CALL intent

I am receiving a push notification, On that, calling a foreground service. From the service, I am calling one Activity. Here, I have 2 functionality. 1. Sound alarm for emergency 2. Call using ACTION_CALL. Both are working fine if device…
RaRa
  • 2,024
  • 1
  • 18
  • 29
3
votes
1 answer

Android wakeLock issue

I have foreground service. Manifest contains this permissions: In Splash activity i request…
3
votes
3 answers

Foreground Service and WakeLocks are not working on Huawei Devices

I developed an Android app called Multi Countdown Timer In which we can start multiple timers at once. The App runs on the background using Foreground Service in order to run continuously and override's The Android Doze Mode. I have tested my App on…
3
votes
1 answer

Need to have one background task to run for every minute in android

In one of my android applications, I need to run a task for every minute. It should run even if the app closes and when device is in Idle state also. I have tried handler, it is working fine when device is active, but not working when device is in…