Doze mode and GCM notifications

喜欢而已 提交于 2019-12-08 08:12:34

问题


I've followed this stackoverflow post to set my Nexus 5 device to the 'IDLE' state with adb, after switching off the screen.

> adb shell dumpsys battery unplug
> adb shell dumpsys deviceidle step
Stepped to: IDLE

Despite this, I am able to see through my device logs the GCM notifications being received.

1-04 15:21:40.708 22138 26007 I GCM : GCM message com.sample.app 0:1446610899548646%82d6ec5bf9fd7ecd

My understanding is that Doze mode will allow for certain maintenance windows where normal priority notifications are pushed in a batch, so I was not expecting to see such log entry. (I have also logged all the entries in the received Bundle and can see all the attributes of the notification)

When I step the device into the IDLE_MAINTENANCE mode, I do not see the device receiving any further notifications (presumably since it has already received it)

I have been pushing notifications with payloads including and excluding the priority property, and it does not seem to make a difference.

I am testing on a device with Android Build Number MRA58K, with a project using Google Play Services version of 8.1.0.

In addition, I am not able to access the network (in response to a GCM notification) only when the device is in the 'IDLE' state, which suggests that the deviceidle step does have some effect.

Is there a step that I am missing in order to set the device into a proper 'IDLE' mode?

来源:https://stackoverflow.com/questions/33515388/doze-mode-and-gcm-notifications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!