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

Local notifications in an Android app not showing when app is in background or closed

I have generated local notifications using Service. When the app is open, window the notifications works properly and they are show up. But when app is going to background or gets closed notifications, they are not showing. When I reopen my app all…
Daniel
  • 41
  • 1
  • 4
3
votes
1 answer

Request Samsung to whitelist my app from battery optimization 'Put app to sleep'

We have a podcast player app, which works great on most phones, but some Samsung users are reporting that the stream stops playing when the screen turns off. We are using foreground services and notifications for playback with ExoPlayer. After some…
Daniel Zolnai
  • 16,487
  • 7
  • 59
  • 71
3
votes
1 answer

Does Deep sleep really exist in Android?

Hi I started to be curious about deep sleep in Android. Cause I found this term "deep sleep" in android document while I'm searching for handler. public final boolean postDelayed (Runnable r, long delayMillis) Causes the Runnable r to be added to…
wannnnnnn
  • 53
  • 1
  • 4
3
votes
0 answers

How AlarmManager work with Doze mode in case 9 minutes?

Below information is from Developer Android side Note: Neither setAndAllowWhileIdle() nor setExactAndAllowWhileIdle() can fire alarms more than once per 9 minutes, per app. I want to be more clear for this case. Example case: I use AlarmManager…
CauCuKien
  • 1,027
  • 2
  • 15
  • 26
3
votes
0 answers

Do notifications while the screen is off prevent an FCM High Priority message from counting against the "App Standby Bucket"

I'm working on a messaging app where messages need to come through so we're sending our messages as "High Priority" to bypass Doze. In Android P they added a new thing called "App Standby Buckets" which limit how many FCM messages you can send if…
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

Why is Network access in my geofence broadcast receiver unreliable?

Use case: When geofence triggers we need to contact server ASAP. We have solved this with an implicit BroadcastReceiver calling a Service for several years, but problematic in new versions due to Doze and Oreo background restrictions. Attempted…
3
votes
1 answer

Doze Mode, Battery Optimization whitelist, AlarmManager more frequent than 9 mins

I'm creating an app to connect with BT device to collect heath data (i.e.: body temperature). The sensor sleeps for periodic time and wakes up only for limited window of time to connect. I've tried to create AlarmManager which fires Foreground…
wojciech_maciejewski
  • 1,277
  • 1
  • 12
  • 28
3
votes
2 answers

Oreo infinite background service like Messenger or Instagram

How can I create an infinite background service without notification like Messenger, Instagram or HID Mobile Access? For example HID Mobile Access has background service that runs infinitely, is not killed by system, does not have notification and…
3
votes
1 answer

Check if app whitelisted from battery optimisation (doze mode)

How to check if my app already whitelisted from battery optimisation (doze mode) at its setting? Thank you.
zamroni hamim
  • 545
  • 1
  • 6
  • 21
3
votes
2 answers

Starting foreground service in doze mode

I'm developing an app which connects to a special device via wifi. I need to make status updates in a short interval, resp. keep the status of my special device in the app up to date. FCM is not an option. My idea is to give the user two options:…
3
votes
1 answer

Android doze alarm window

I want to update my app to Android 6 and i use the alarmanager to shedule my background service. For my service it is important to be woken up in a approximatly hour long window. It must wake up in that window so not once the device exits doze, but…
Ben
  • 199
  • 1
  • 13
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
0 answers

Exact repeating alarm on Marshmallow without setAlarmClock()

In one app I get accelerator sensor value each 30 sec in the background. Since Android M introduced Doze mode, in Doze mode all alarm won't work exactly except setAlarmClock(). But if setAlarmClock() with short time will disable Doze and make user…
DzungPV
  • 1,561
  • 3
  • 18
  • 24