I did some investigation on that bug the last few weeks and here is what I came up with based on my findings and what others have posted in this thread previously:
Here are some more details on what I figured:
The data connection seems to go down but the RIL implementation does not send any event to notify us. We therefore assume that data is still connected. It seems to be common that something like this happens, therefore there is a OnDataStallAlarm function that is called periodically to check if the connection is still alive. It does this by counting the number of sent packages and the number of received answers, assuming that something is broken if you do not get any data packets back for a while.
As soon as a data stall is detected, this routine starts a whole cascade of recovery actions.
However for our bug, these recovery functions get never activated because the number of sent packages is also not increasing any more. The simple solution I found is just to send a notification for a data connection change if there was no traffic at all during the last cycle.
This does not hurt because if the connection was still alive, this notification should do nothing. However if the connection was lost previously, it triggers a reconnect. I compared the connection tracker to older versions of Android, and it even seems like in older Android versions, this was done periodically to work around bad RIL implementations that did not report connectivity loss properly.
I think that this portion of the code (the connection recovery) was significantly modified from Android 2.6 to 4.0, and it probably did the recovery properly in earlier versions. This is why there were no persistent data connection dropouts although the actual RIL bug probably always has been there.
I attached my patched version of /system/framework/framework.jar which should work with Quarx's 0903 MB525 build (I suppose you know what you're doing when using this file, but in case you get stuck on boot, you can always go back to one of Quarx's ROMs by reflashing) and a patch for the source code.
I am sure there is a more elegant way to work around this bug and fix the data stall alarm, but at least I hope this is pointing to the right direction..
Edit: Patch is integrated in latest Quarx 12.09 build, no need to apply it manually any more
- The bug seems to be somewhere inside the Motorola RIL implementation and appears to be present in all available RIL versions, i.e. there is no way to fix it
- I believe the bug is also present in stock ROMs, but they recover automatically within at most a couple of minutes
- The built-in data connection recovery in CM9/10 does not play well with the Defy, but it can be modified easily
- With a slightly modified version of Quarx's ROM, I have fairly stable connectivity for one week now (longest dropouts around 2 to 3 minutes) and none that required toggling mobile data or flight mode. With a stock GB Defy+, I have temporary dropouts of similar length in my area. Without the patch I had dropouts almost every hour in some areas.
Here are some more details on what I figured:
The data connection seems to go down but the RIL implementation does not send any event to notify us. We therefore assume that data is still connected. It seems to be common that something like this happens, therefore there is a OnDataStallAlarm function that is called periodically to check if the connection is still alive. It does this by counting the number of sent packages and the number of received answers, assuming that something is broken if you do not get any data packets back for a while.
As soon as a data stall is detected, this routine starts a whole cascade of recovery actions.
However for our bug, these recovery functions get never activated because the number of sent packages is also not increasing any more. The simple solution I found is just to send a notification for a data connection change if there was no traffic at all during the last cycle.
This does not hurt because if the connection was still alive, this notification should do nothing. However if the connection was lost previously, it triggers a reconnect. I compared the connection tracker to older versions of Android, and it even seems like in older Android versions, this was done periodically to work around bad RIL implementations that did not report connectivity loss properly.
I think that this portion of the code (the connection recovery) was significantly modified from Android 2.6 to 4.0, and it probably did the recovery properly in earlier versions. This is why there were no persistent data connection dropouts although the actual RIL bug probably always has been there.
I attached my patched version of /system/framework/framework.jar which should work with Quarx's 0903 MB525 build (I suppose you know what you're doing when using this file, but in case you get stuck on boot, you can always go back to one of Quarx's ROMs by reflashing) and a patch for the source code.
I am sure there is a more elegant way to work around this bug and fix the data stall alarm, but at least I hope this is pointing to the right direction..
Edit: Patch is integrated in latest Quarx 12.09 build, no need to apply it manually any more
Attachments
-
4.1 MB Views: 541
-
841 bytes Views: 768
Last edited: