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
2
votes
0 answers

JobIntentService runs again after exiting Doze mode

I'm running the following JobIntentService example from Google on Nexus 5X (Android 8.0) public class SimpleJobIntentService extends JobIntentService { /** * Unique job ID for this service. */ static final int JOB_ID = 1000; /** …
Renjith
  • 3,457
  • 5
  • 46
  • 67
2
votes
1 answer

Manage Internet connection on Android Nougat or Android Oreo with enabled Battery saver

I have trouble with managing correctly Internet connection on new Android versions when device is unlocked with enabled battery saver. android.permission.INTERNET and android.permission.ACCESS_NETWORK_STATE permissions are added to the manifest…
2
votes
1 answer

Battery Optimizations whitelist not preventing Doze from deferring my app

My app sends GPS location data to my server every 15 minutes. This functionality is the central purpose of the app. However, the GPS logging tapers off when the phone is turned off and not in use. Time between GPS records is 15 minutes for a while,…
2
votes
0 answers

Xamarin.Android: Service stopps working when screen off (Doze / App Standby mode)

I have to implement a service were I transmit GPS (Lat/Lon) every 120 sec. to my REST backend. I have the problem that the service seems to stop working when the screen is turned off. Attempt with a StartedService and a BroadcastReceiver Attempt…
2
votes
1 answer

Loosing network android 6 and above if app run in backgroud

I am running service background to execute some tasks with some interval using AlaramManager (setExactAndAllowWhileIdle). If its connected the power charger its running. But if its unplugged device power after some i am loosing the network to my…
Srikanth
  • 584
  • 1
  • 6
  • 21
2
votes
0 answers

Doze Mode battery optimization, device specific issue

I implemented ignore battery optimization functionality programmatically. I found lots of questions and answers but i want to know that the IGNORE_BATTERY_OPTIMIZATIONS is works only for pure android or is there any other cases? I have couple of…
2
votes
0 answers

Repeating alarm to handle doze mode

I have an application that automates based on the user's location. I'm now handling doze mode, since doze throws a kink in my ability to send requests in the background based on location changes. I want to give my service internet access every 9…
LampShade
  • 2,675
  • 5
  • 30
  • 60
2
votes
1 answer

How long will the device stay awake when it receives a FCM high priority message?

I read in the Firebase docs that a device will be brought out of sleep if it receives a high priority message from FCM and that the network connection will be opened towards the app server. I have tested this behaviour and i know that it does wake a…
Kushan
  • 5,855
  • 3
  • 31
  • 45
2
votes
1 answer

Xamarin MediaPlayer interrupted by Android Doze Mode

We have a music app (mp3) developed in Xamarin (Native Android App) using MediaPlayer. There will be list of songs that should be played one after the other. After around 10 minutes or so, the player stops. Once the phone is unlocked, the Player…
user2980765
  • 99
  • 1
  • 8
2
votes
1 answer

Location service got stopped by Doze mode

I'm developing sport tracking app that uses location manager and gps provider for getting location updates every second even if the screen is off and the phone is in the pocket. When user pressed start button in my activity I start service in…
Northern Captain
  • 1,147
  • 3
  • 25
  • 32
2
votes
2 answers

Is it possible to track when an app enters "Doze on the Go" (AKA Doze Light, Doze Extended, and Doze 2)?

In Android "N", Doze has been extended with "Doze on the Go". I'm looking for a way to detect when the device enters and leaves these new light doze IDLE and IDLE_MAINTENANCE states. (Basically the same question that was asked for regular Doze…
2
votes
1 answer

Unplugging the device via ADB: "can't find service"

I have to test how my app behaves in doze mode. According to the documentation, I first must make the device think it's unplugged by entering the following command in the terminal: $ adb shell dumpsys battery unplug However, nothing happens and it…
Tim
  • 41,901
  • 18
  • 127
  • 145
1
vote
0 answers

Do a guaranteed execution of code every 15min even in doze mode

I have an active-monitoring healthcare application that needs to be synced with different BLE devices every 15min in order to collect vitals and essential data. For this, I am using a ForegroundService with a Notification, Additionally, I have taken…
1
vote
0 answers

check whether android device in maintenance window

I want to check whether device is in a maintenance window of doze mode. so I used : //on receive alarm broadcast PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); boolean isDeviceIdleMode = pm.isDeviceIdleMode(); //do…
Nilanka Manoj
  • 3,527
  • 4
  • 17
  • 48
1
vote
2 answers

how to use setAndAllowWhileIdle in repeatetive task , because it avoids from doze mode , any example for this android

how to use setallowWhileIdle method for repeatetive task in alarmManager, because I think the only method that overcome doze mode, I need to work 24*7 task in repeatetive mode, is there any example please help I am new to android private void…