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
1
vote
2 answers

Why Android does not exit DOZE mode, despite the high priority of the message in FCM?

I'm sending a data-message via FCM with HIGH priority. curl -X POST -H "Authorization: Bearer ya29.c.b0AXv..." -H "Content-Type: application/json" -d '{ "message": { "topic" : "mytopic", "data": { "message": "my_unique_data" }, …
1
vote
1 answer

Android WearOS ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS is being ignored

On Android WearOS with SDK 28 I am trying to disable doze mode. From my understanding, the following code will disable doze mode: PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); boolean isIgnoringBatteryOptimizations =…
HXSP1947
  • 1,311
  • 1
  • 16
  • 39
1
vote
0 answers

How to update the Firebase server in doze mode in android 11 or later

I want to update the user location in doze mode I tried many things but as soon as the system enters the doze mode the location updates get off. There is an answer to this question but this is not working in android 11 Getting location updates when…
1
vote
2 answers

Some Samsung phones with Android 6 or higher don't have android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS

My app needs to allow users to disable doze mode for my app, so for that the app needs to open android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS but I get android.content.ActivityNotFoundException when trying to open that intent on some Samsung…
casolorz
  • 8,486
  • 19
  • 93
  • 200
1
vote
2 answers

Delphi android : Scanning Bluetooth LE devices does not work while screen is off

I have an application scanning BluetoothLE devices (temperature). The application is whitelisted in the list for battery optimizations and uses a PARTIAL_WAKE_LOCK. It works like a charm with a Zebra TC25 Android 7.1.2 using a thread scanning BLE…
1
vote
0 answers

Sending network requests every minute even during doze mode

I have Foreground Service in my application which sends API request every minute. Here is the code: public class MyService extends Service { @Override public void onCreate() { Notification notification = getNotification(); int…
Alex D.
  • 1,424
  • 15
  • 40
1
vote
0 answers

battery optimization not available for some applications. how it could be?

i want to disable battery optimization for my application. i know that showing dialog with REQUEST_IGNORE_BATTERY_OPTIMIZATIONS is the way that user can disable that. but in some apps like QK SMS, it's fully disabled even in battery settings. how…
Reza Zarchi
  • 47
  • 1
  • 6
1
vote
1 answer

How to use wifi in doze mode when app is on battery optimazition whitelist?

I am currently working on an Android app which should read sensor values from a bluetooth periperal and send them to a backend server. To enable this app to work when the screen is turned off, a partial wake lock is acquired and the app is put on…
1
vote
1 answer

Why is doze mode not affecting the AlarmManager setExact() function?

I'm trying to test the behavior of my Android app when the OS goes in Doze mode. I'm using a gennymotion emulator running Android API 25. The application launches an IntentService through the AlarmManager using the method setExact with type…
syed_noorullah
  • 155
  • 2
  • 13
1
vote
0 answers

JobIntentService not working in doze mode for alarm app

I am making an alarm app for waking up user at an exact time. I am using JobIntentService (since Android O+ devices don't support background services) for showing a notification alarm like this:- (AlarmManager -> BroadcastReceiver ->…
1
vote
0 answers

Android device not entering deep doze

I am trying to force my device (Redmi S2) running MIUI into deep doze using ADB commands but it doesn't seem to work. After running adb shell dumpsys battery unplug I can go into light doze by using: adb shell dumpsys deviceidle step light Stepped…
Crimson
  • 111
  • 5
1
vote
1 answer

How to create PhoneStateListener that works in both Doze Mode and Power Saving Mode?

When device enters Doze mode or Power Saving mode my PhoneStateListener stops to work. Also I need to register PhoneStateListener on device reboot. I don't want to use BroadcastReceiver because it is not recommended anymore, see…
patonjo
  • 440
  • 4
  • 13
1
vote
1 answer

Should a device behave as if nothing happened during Battery tests?

I need to test whether an app behaves correctly after restoring from Doze / App standby. The thing is that when I use commands from the Android Developers site, nothing happens with either the app nor with the device itself. The command prompt seems…
1
vote
1 answer

Android Handle All AlarmManager restrictions

I have an alarm clock app on the play store that works very well on most of the devices , but unfortunately some devices report the alarm does not fire on the time adjusted and i concluded from research that there are some devices that restrict…
user2469133
  • 1,940
  • 3
  • 21
  • 33
1
vote
0 answers

Android - How do Music Apps continue to stream on Network even if device is in doze mode?

After reading the official documentation about doze mode in Android, is someone know how music app technically can stream track from Internet when the device enters in doze mode (so network is unavailable) ?
Hasina
  • 335
  • 3
  • 13