Thursday, January 31, 2013

Re: [android-developers] Mobile network idle sockets disconnected

It's not supposed to be case sensitive, though there was a bug a while back where it was.  I'd be doubly surprised if samsung made the change from typing to a dropdown, used different cases on the two options and made the code case sensitive so their ui change would fail testing.

Apparently they changed more things and I can't guess what's happening under the hood.

Sorry about the problems.


On Thu, Jan 31, 2013 at 11:15 AM, Goncalo Oliveira <goncalo@minkan.net> wrote:
Is apn type case sensitive? I can't type the APN type in Galaxy note, I can only choose "Internet", "Internet + MMS" or "MMS". Though, if I choose "Internet + MMS"
I get this in the logs

2104 D GSM     : [GsmDCT] createApnList: X result=[[ApnSettingV2] fceu, 1352, 26803, fceu.prtop, , , , , , -1, default | supl | mms, IP, IP, true, 0]

However, if I choose MMS, I get this instead

2104  2104 D GSM     : [GsmDCT] createApnList: X result=[[ApnSettingV2] fceu, 1352, 26803, fceu.prtop, , , , , , -1, MMS, IP, IP, true, 0]

Other than that, I don't know what else I can do... :s



On 31 January 2013 17:48, Robert Greenwalt <rgreenwalt@google.com> wrote:
Take a bugreport.
Search for "SERVICE com.android.phone/.TelephonyDebugService"
look within it's output for "mAllApns size" and below that is a list of APN's for your SIM.  See if one matches the mms one you entered.

If your apn is listed with mms in the type field (right before IPV4V6), then I don't know what's wrong. 


On Thu, Jan 31, 2013 at 9:31 AM, Goncalo Oliveira <goncalo@minkan.net> wrote:
Nope, that doesn't help :S
Same radio log...

I tried setting a default network with an invalid APN ( like ... ), as this made the other SIM card (with the new APN) to work on the other device, but the result is even worse. The other device recognizes ... as an invalid APN and does nothing. Samsung just tries to connect... result... constant outgoing traffic...

I'm just stumped with this. If I can't find a workaround for this, I'll be stuck with getting regular unrestricted 3g SIM cards... :s
Any thoughts?


On 31 January 2013 16:29, Robert Greenwalt <rgreenwalt@google.com> wrote:
Try disabling data (settings->Mobile networks->Data enabled).

I think what's happening is data is enabled, so the default apn is requested but we're not able to connect (because you have no default apn) so telephony infers that data reception isn't available and so it doesn't even try other types.  This seems like a bug.  By disabling data all you're really doing it turning off default data, so the availability stuff isn't sure if reception is available or not and it should try mms.

R


On Thu, Jan 31, 2013 at 2:39 AM, Goncalo Oliveira <goncalo@minkan.net> wrote:
Thanks for the reply Robert. I also had the idea that this was device side only, but I'm still confused by these behaviors.
I do bet that Samsung's is doing something different (not that uncommon). I'm pasting the radio logs below. The SIM card used here is the one that works in the other device.
There's still something else I don't understand... the other SIM card doesn't work with either phones. I don't think it's the APN, at least, it shouldn't, but maybe the SIM card has any particularity. I'm going to check the radio logs also to see if I can trace something at all.

The previous problem log

D/GSM     ( 2104): [GsmDCT] enableApnType: mms is type not available  // when startUsingNetworkFeature
E/RIL     ( 1702): ReaderLoop after select
E/RIL     ( 1702): ReaderLoop after FD_ISSET
D/GSM     ( 2104): [GsmDCT] disableApnType:mms // when StopUsingNetworkFeature
D/GSM     ( 2104): [GsmDCT] setEnabled(1, false) with old state = false and enabledCount = 1
D/GSM     ( 2104): [GsmDCT] disableApnType: return APN_ALREADY_INACTIVE
D/GSM     ( 2104): [GsmDCT] handleMessage msg={ what=270349 when=0 arg1=1 }
D/GSM     ( 2104): [GsmDCT] onEnableApn: apnContext=state=IDLE apnType=mms call applyNewState
D/GSM     ( 2104): [GsmDCT] applyNewState(mms, false(false), true(true))
D/GSM     ( 2104): [ApnContext] set enabled as false, for type mms, current state is false
D/GSM     ( 2104): [ApnContext] set mDependencyMet as true, for type mms, current state is true



On 29 January 2013 16:48, Robert Greenwalt <rgreenwalt@google.com> wrote:
There aren't any network requirements I think.  This is purely device side and connects using different parameters and doesn't apply default routes (it's a secondary net supposedly used next to a default connection).  Can you do a "logcat -b radio" on the note and see?

It looks like the only way to get that log (and nothing in between) is to call stopUsingNetworkFeature.  However it needs to be called by the same process/user.  That's according the code we ship - Samsung code can be doing something different.  There weren't any log lines between those two?


On Tue, Jan 29, 2013 at 6:45 AM, Goncalo Oliveira <goncalo@minkan.net> wrote:
Some more information... I tried using another SIM card, using a different APN, and it didn't work on any of the devices.
What are the network requirements for this "special network feature"?



On 29 January 2013 13:58, Goncalo Oliveira <goncalo@minkan.net> wrote:
logcat on galaxy note drops this

01-29 13:50:03.252: D/ConnectivityService(1865): startUsingNetworkFeature reconnecting to 0: enableMMS
01-29 13:51:03.332: D/ConnectivityService(1865): stopUsingNetworkFeature: teardown net 0: enableMMS


On 29 January 2013 13:43, Goncalo Oliveira <goncalo@minkan.net> wrote:
Well, the MMS APN trick does work.. on some devices. On others it doesn't.
Tested with 2 devices with Android 2.3.3 and 3.2 and worked.
On Samsung Galaxy Note with Android 4.0.4 it's not working. I wonder if it's the feature string that is different or if it has something to do with Android version...

Any hints?


On 28 January 2013 17:15, Goncalo Oliveira <goncalo@minkan.net> wrote:
Thanks Robert, I really appreciate your help. I'll try as you suggest.


On 28 January 2013 16:59, Robert Greenwalt <rgreenwalt@google.com> wrote:
I don't think you're making your own builds, so you'll have to set the APN data on each device (though you probably already have to do this as it's not a public apn).  In the apn data set the type of the apn to "mms" instead of "default" or blank.  Remove any default/blank apn for your mcc/mnc pair.

In your app, you will need to call CM.startUsingNetworkFeature(TYPE_MOBILE, "enableMMS").  This will turn off every 10 minutes (by default - may be different on different phones) so you need to call it repeatedly forever perhaps every 9.5 minutes.  Then you need to call requestRouteToHost(TYPE_MOBILE_MMS, int addr) for every IP addr you're accessing.  Then you should be able to access the servers normally.  

R


On Mon, Jan 28, 2013 at 8:34 AM, Goncalo Oliveira <goncalo@minkan.net> wrote:
Hi Robert, thanks for such a prompt answer.

Firstly, it's 3 mb in 3 days, 1mb/day. The DNS resolves the addresses correctly, but the connections will fail. Unfortunately I don't have access to DNS servers, so it's a bit harder to capture this traffic. I've installed Onavo count to capture the traffic, and I can see the usage growing up with Android OS.

The APN idea seems to be a good workaround. Breaking the brower or other apps isn't really a problem for us, as this is something very specific. Can you tell me where can I find more information on how to do this?

Cheers


On 28 January 2013 16:14, Robert Greenwalt <rgreenwalt@google.com> wrote:
I am curious what the 3mb/day of data consists of if the servers can't be reached.  3mb of tcp connect attempts?  DNS lookups?  If it's DNS perhaps you could populate your local DNS server with bogus records so that the DNS requests die down to be replaced with perhaps fewer failing connect attempts?  Can you capture this traffic?

You could potentially use a different APN type.  Instead of using a default type you could put it on type IMS or type MMS.  This will involve a bit more work for you, but if you don't a a default connection the other apps shouldn't use any data.  This would also mean things like the browser won't work.



On Mon, Jan 28, 2013 at 3:58 AM, Goncalo Oliveira <goncalo@minkan.net> wrote:
Sorry for reopening this, but I have a consequence behavior with this and was hoping for some insights.

As I said earlier, we are using a very specific APN that allows the connection only to a restricted range of servers. I managed to use a heartbeat every 5 minutes to workaround the GCM issue, and with the app everything is working fine. However, I have another consequence. Because the APN restricts access to anything outside "our safe little world", the system is consuming a whole load of data. Android OS consumed 3 mb in three days, Google Services 416 k. In the data settings I was able to restrict Google Services (as well as software updates and others) from using data but I can't do the same for Android OS. This is killing us completely because we have a very restrictive data plans.

Any ideas on how I can disable data transfer for everything except my application?

Thanks


On 21 December 2012 15:55, Goncalo Oliveira <goncalo@minkan.net> wrote:
Robert,

Thanks again for clarifying. Basically if I open up GCM I'm allowing user to work with gtalk, so I will want to avoid that.
Looks like sending the heartbeat every 5 minutes is the only option I have left.

Thanks for the help. Much appreciated.
Cheers


On 21 December 2012 15:44, Robert Greenwalt <rgreenwalt@google.com> wrote:
I believe most of the google apps rely on GCM (calendar, gmail, contacts, talk, etc), also 3rd party apps that need pushed notifications are encouraged to use GCM.  Unless you are making a custom build and denying app installs you probably have apps that will be broken without GCM.

Of course, if you have very limited data plans on special purpose phones, you may wish for all those apps to be broken - they can use quite a bit of data.

I don't know what GCM's steady-state data rate is for a device.  I believe it does a carrier keep-alive ping every 20-30 minutes.  It also checks for updates whenever the screen comes on.  Other than that I think it is dependent on user or network-originating app traffic.

R


On Fri, Dec 21, 2012 at 2:23 AM, Goncalo Oliveira <goncalo@minkan.net> wrote:
Robert,

Thank you for the explanation. There's just one more thing that I'd like you to help me understand. If we choose to allow the GCM connection, what kind of traffic can we expect to have? Like I said previously, we have a very tight data plan, so if the GCM connection adds more than just a few bytes, that might be a bad idea to enable it. Also, by enabling GCM connection, what am I allowing the users to do? Can they use gtalk or something else?

Cheers


On 21 December 2012 00:17, Robert Greenwalt <rgreenwalt@google.com> wrote:

The GCM is part of the platform - 3rd party apps depend on it and so there's no mechanism for deactivating it.

If you can allow the GCM connection to succeed, you should avoid the current problems, but if you're going for a secure platform you may not want the GCM connection to succeed.

You could potentially hijack the dns resolution: have your dns server report an address you control for mtalk.google.com, then allow connections to your own server, but no real functionallity.  With some reverse engineering you may be able to get to a quiet connection that doesn't trigger these data-stall triggers.

The easiest solution is to adjust your keep-alive ping to < 6 minutes.  That will effect the battery, but less than allowing the resets to happen.

I have created internal issues to examine this issue, but even if we fixed it today internally you wouldn't see it for a long while.  The first issue is to find what traffic is causing this connection reset.  The second is to re-eval counting udp packets (I am assuming that's causing part of this problem).

I'm sorry you have hit this issue.

Robert 


On Thu, Dec 20, 2012 at 4:30 AM, Goncalo Oliveira <goncalo@minkan.net> wrote:
Robert,

Any updates on this?

Cheers


On 18 December 2012 10:06, Goncalo Oliveira <goncalo@minkan.net> wrote:
consider opening up the addre



--
Gonçalo Oliveira

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en



--
Gonçalo Oliveira

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en



--
Gonçalo Oliveira



--
Gonçalo Oliveira

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group, send email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group, send email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Gonçalo Oliveira

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Gonçalo Oliveira



--
Gonçalo Oliveira



--
Gonçalo Oliveira



--
Gonçalo Oliveira

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Gonçalo Oliveira

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Gonçalo Oliveira

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Gonçalo Oliveira

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment