android-doze

Testing Doze feature (Android 6.0 Marshmallow) in Genymotion

我与影子孤独终老i 提交于 2019-12-04 09:48:47
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 from Genymotion but unfortunately cannot put anyone to idle mode. Always after second command I see Stepped to: ACTIVE . Then trying adb shell dumpsys deviceidle force-idle I see Unable to go idle; not enabled . This is strange because Genymotion states in release note ( https://www.genymotion.com/#!/release-notes ) for version 2.6.0, which I use, that

Remove app from whitelist in android marshmallow

自古美人都是妖i 提交于 2019-12-02 18:46:49
问题 I didn't find useful info how to programically or using device's settings remove specific app from white-listed. In android 6.0 was introduced doze-mode and while-listed, the last term allows ignore partially doze-mode. To put app in white-listed apps need to perform code: Intent intent = new Intent(); intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS); intent.setData(Uri.parse("package:" + getPackageName())); startActivity(intent); I tried next actions to remove the app

Remove app from whitelist in android marshmallow

一笑奈何 提交于 2019-12-02 11:42:27
I didn't find useful info how to programically or using device's settings remove specific app from white-listed. In android 6.0 was introduced doze-mode and while-listed, the last term allows ignore partially doze-mode. To put app in white-listed apps need to perform code: Intent intent = new Intent(); intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS); intent.setData(Uri.parse("package:" + getPackageName())); startActivity(intent); I tried next actions to remove the app from white-listed, which it has just been put, but nothing help me: clear data application in settings

Foreground service not receiving location updates in Doze mode in Android O

╄→尐↘猪︶ㄣ 提交于 2019-12-01 08:21:18
I have a foreground service that needs to get a single location update. It is started by a specific broadcast, and upon starting it simply does a request on our backend. When it receives another broadcast, it requests a location update (once), does another backend request and then stops itself. Edit: to clarify, the service itself does the location updates and backend requests. It is independent from the main app in that regard. This works well on Lollipop and Marshmallow, both when the phone is awake or in Doze mode. But for some reason, on Android O the service never gets location updates

Foreground service not receiving location updates in Doze mode in Android O

风流意气都作罢 提交于 2019-12-01 07:01:25
问题 I have a foreground service that needs to get a single location update. It is started by a specific broadcast, and upon starting it simply does a request on our backend. When it receives another broadcast, it requests a location update (once), does another backend request and then stops itself. Edit: to clarify, the service itself does the location updates and backend requests. It is independent from the main app in that regard. This works well on Lollipop and Marshmallow, both when the phone

How to test Doze Mode on Android?

半城伤御伤魂 提交于 2019-11-30 21:01:41
There is an old Android app which work background 2 service (Service). It took to update the app with the possibility of sending data and logging while working is not a new DozeMode. Before you amend the current code I decided to check how everything will work now. To run the application, in the logs I see that both services are running (the basic meaning of the service to read the position of the device, the second service sends the data to the server). Turn off the screen with the command adb shell dumpsys deviceidle step translate the system to DozeMode: Nikita:app NG$ adb shell dumpsys

Android Alarm Manager setExactAndAllowWhileIdle() not working in Android 7.0 Nougat in Doze mode

 ̄綄美尐妖づ 提交于 2019-11-30 06:40:30
I am trying to make an alarm fire in my app every 30 minutes using Alarm Manager's setExactAndAllowWhileIdle but it is not working! I test the functionality by issuing a push notification whenever I receive an alarm signal. The problem is: when the device enters doze mode after being idle for sometime, I no longer receive alarms. However, as soon as I turn On the screen, I receive a notification. My app needs accurate alarms that need to be delivered exactly on-time every 30 minutes! It can not afford to receive delayed alarms or dropped ones because the device is in Doze mode! I used the

Minimal android foreground service killed on high-end phone

孤者浪人 提交于 2019-11-29 20:42:43
I'm trying to create an app that lets users log routes (locations/GPS). To ensure locations are logged even when the screen is off, I have created a foreground service for the location logging. I store the locations in a Room Database which is injected into my service using Dagger2 . However, this service is killed by Android which is, of course, not good. I could subscribe to low memory warnings but that doesn't solve the underlying problem of my service getting killed after ~30 minutes on a modern high-end phone running Android 8.0 I have created a minimal project with only a "Hello world"

How to shift device in Doze Mode (Android Preview M / Marshmallow)?

こ雲淡風輕ζ 提交于 2019-11-29 20:12:12
I followed steps described here: https://developer.android.com/preview/testing/guide.html#doze-standby Circumstances: Android Debug Bridge version 1.0.32 Nexus 9 with Preview M Shell: $ adb shell dumpsys battery unplug => worked, device unplugged $ adb shell dumpsys deviceidle step => Output: Stepped to: ACTIVE $ adb shell dumpsys deviceidle -h => does not work => Output: Device idle controller (deviceidle) dump options: [-h] [CMD] -h: print this help text. Commands: step disable enable whitelist I tried it with: adb shell dumpsys deviceidle enable But it didn't work. So my question, as

Minimal android foreground service killed on high-end phone

霸气de小男生 提交于 2019-11-28 16:19:18
问题 I'm trying to create an app that lets users log routes (locations/GPS). To ensure locations are logged even when the screen is off, I have created a foreground service for the location logging. I store the locations in a Room Database which is injected into my service using Dagger2 . However, this service is killed by Android which is, of course, not good. I could subscribe to low memory warnings but that doesn't solve the underlying problem of my service getting killed after ~30 minutes on a