The default GTalk Heartbeat Interval are currently:
- 28 minutes on 2g/3g
- 15 minutes on wifi
Those are to much high values for most of the users in the world.
My wifi router (carrier router) does kill unused tcp connections after 300 seconds of inactivity..no way to change this value.
What happen is that the push notifications connection on the port 5228 get closed after 5 minutes, and so for 10 minutes (untill the gtalk heartbeat occur) I dont get any notification on my phone (currently galaxy nexus 4.2.2)
This problem got me crazy since my first android phone (htc desire 2.2), only recently I finally understood the reason!
Lot users report the same also on some 3g operators.
Please implement a dynamic mechanism to set the right hearbeat interval value or at least add an option under the developer settings on the phone.
Shorting the gtalk heartbeat intervals to 5 minutes (under /data/data/com.google.android.gsf/databases/gservices.db ) and killing Google Services Framework right after, temporanely solve all my problems..I receive instant notifications from all the apps that use push. The problem is that those heartbeat interval get reset everytime by the google checkin mechanism.
Becaus of this problem every app get delayed push notifications, because this hearbeat mechanism on the port 5228 is inefficient for most users..I did open an issue on android here: https://code.google.com/p/android/issues/detail?id=49721