Locally stored upstreams when network is down, are not sent on network up on JB & ICS (they are on reboot)

試著忘記壹切 提交于 2019-12-20 01:08:44

问题


Here is my scenario.

When network is down, GCM client locally stores device-to-cloud messages (upstream), in a local queue (it's length seems to be 20, although never stated).

When this queue is full, messages are locally discarded and the intent contains the message type MESSAGE_TYPE_SEND_ERROR + extras about which messageId was deleted, and error=TooManyMessages.

Using the TTL'd version of gcm.send, allows to force upstreams to be always discarded (when network is down) instead of queued (message type MESSAGE_TYPE_SEND_ERROR + extras about which messageId was deleted, and error=SERVICE_NOT_AVAILABLE), which is not what i want.

So far, so good. Problem is, on JB (4.1.2 & 4.2.2) & ICS (4.0.4), queued messages while network is down, are not sent when network is up again. A reboot forces them to be sent. And worse, once the queue is full, messages can't be sent anymore, even when network is up. Here again a reboot is necessary. Looks like a "flush" is missing somewhere.

This works perfectly on KK 4.4.2

On every test devices, google play service APK is up to date.

Can anyone confirm this behavior in JB & ICS, and maybe other version? Is there a workaround? Thanks.


回答1:


Latest upgrade from Google solved the issue.

I don't precisely know which component upgrade did it, but the issue is gone on all previously tested versions.



来源:https://stackoverflow.com/questions/22418823/locally-stored-upstreams-when-network-is-down-are-not-sent-on-network-up-on-jb

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