Questions tagged [android-doze-and-standby]

73 questions
6
votes
1 answer

Difference between setAndAllowWhileIdle and setExactAndAllowWhileIdle

What is difference between AlarmManager.setAndAllowWhileIdle() and AlarmManager.setExactAndAllowWhileIdle()? How does these both affect Doze mode introduced in Android 6.0 (Marshmallow) API?
5
votes
1 answer

Is it possible to completely disable the Doze mode and Standby mode?

I have a requirement to create an app that should run 24/7. I don't care about battery drain, becoz app will not be submitted to PlayStore and its only for the selected user.I also understand app will only last for one day, that is acceptable in my…
Jess
  • 85
  • 1
  • 8
5
votes
1 answer

Doze mode handling

I am working on an application which spawns some services in the background using AlarmManager. Timing is very crucial to our application and the functionality can't wait for the next maintenance window to occur. Asking a user to white-list the…
5
votes
0 answers

How to set the repeating alarm which will work even in Doze mode?

I understood that setExactAndAllowWhileIdle will invoke alarm even in Doze mode but how to make it repeat every day because there is no setRepeatingAndAllowWhileIdle kind of method.
shekar
  • 1,251
  • 4
  • 22
  • 31
5
votes
1 answer

How long does an App need to be idle for App Standby to kick in (Android Marshmallow)

I've looked all over the internet to find specifics about App Standby mode in Android Marshmallow, but I've not found any specific data for when it happens, other than some listed conditions that might cause it to happen. I also see a nebulous "If…
4
votes
0 answers

Open Battery Optimization activity of specific app in device settings

I am using WorkManager library to schedule a background task, and to prevent the app from sleeping the battery optimization section is opened from the app for the users to manually disable optimization for my app. The problem is even though the…
4
votes
0 answers

Manually set a new alarm with setExactAndAllowWhileIdle() each time the alarm goes off: Android

I know that this has been asked several times before, but I have not been able to find something that could work for me till now. I am using setRepeating() to schedule the alarm manager to run every minute. However, this has stopped working after…
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

Doze and Standby mode for VoIP app

I have an legacy VoIP app for which I want to provide Android's new doze and standby mode support. I have my own messaging/signaling mechanism for which I can't use Android's GCM feature. The documentation stated that white-listing the app will…
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
2 answers

Does Foreground Service Survive Sleep Mode(not doze mode)?

So i have read a lot of posts about android services and their lifecycle during doze. So far: Background Services are restricted by doze mode. Foreground Services are immune from doze mode. Meaning that they continue to have access network and…
user10137577
3
votes
1 answer

Exit android doze mode

I am playing around with the Android doze mode in my app and just wants to examine my apps behavior in doze mode. My application enqueues some tasks in a job scheduler while in doze mode. I want to check if any event, that wakes up the device,…
Abhishek Madan
  • 165
  • 2
  • 10
3
votes
0 answers

Network failure when device in Doze Mode

I have a doubt regarding Doze Mode. In Doze mode, when we receive a GCM notification, how long the app will have access to network services? Can we acquire partial wakelock to prevent entering into doze mode again? How to check the logs whether the…
Krishna M
  • 1,135
  • 2
  • 16
  • 32
3
votes
0 answers

How can I turn Ambient Display on/off programmatically?

I want to turn ambient display on and off from an app I am creating. I came across this question where someone was asking something similar. The accepted answer was this line of code: Settings.Secure.putInt(getContentResolver(),…
intA
  • 2,513
  • 12
  • 41
  • 66
3
votes
1 answer

Doze mode suspends foreground service

I am writing a data logger app and I need to make an http request every 5 minutes exactly. The user is aware of the battery drain and that's ok for me. I am using a foreground service with the appropriate notification for that and I have a handler…