Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Xposed] [EXPERIMENTAL] National Roaming

OP oma

26th August 2013, 12:50 AM   |  #1  
OP Junior Member
Thanks Meter: 38
 
27 posts
Join Date:Joined: Sep 2005
Do you need to enable data roaming to get a connection even in your home network? If so, you probably know the hassle this causes when you travel abroad, or live near the border where your phone can sometimes log into another network. You have to disable data roaming every time, and if you forget, you'll get an unpleasant surprise on your next phone bill.

Maybe you know CyanogenMod's "National Roaming" feature that enables roaming only in your home country, so you don't have to disable roaming manually when you leave the country. I've used this in the past and got used to it, so much that having to live without it would annoy me a lot.

Since I just got a new phone for which CyanogenMod isn't available, I wrote an Xposed module which mimics this feature. My new phone happens to be an MTK6589 dual SIM device (Tronsmart TS7), so I also added support for the dual SIM modifications MediaTek made.

It's in a very early stage and mostly untested. It "works" insofar as the roaming icon is gone and I get a data connection without enabling roaming. I don't know if it properly detects when you're really roaming. It should, but I can't test it for now since I don't live near the border and don't have a working foreign SIM. If somebody could test whether it actually works, that would be greatly appreciated!

Requirements:
Xposed Framework
It *should* work on any Android version Xposed runs on, but so far I've only tested it on my TS7's stock 4.2.1.

Play Store?
I intend to publish it there as well, but only after it has been a bit more thoroughly tested and enough people reported that it works and doesn't cause any issues.

Source code:
https://github.com/leromarinvit/NationalRoaming

Version history (old versions here):
v0.2 - 2013-08-29 - fix Android 4.3 compatibility
v0.1 - 2013-08-25 - initial release

Technical details:
The module works by hooking pollStateDone() in com.android.internal.telephony.gsm.GsmServiceState Tracker. This function notifies listeners when the roaming state changes. So to fake the roaming state everything else sees, we only have to change it before this function is called. The logic is simple: We're roaming if and only if the MCC (mobile country code - first three digits of the numeric operator id) stored on the SIM and provided by the network differ.

In the past, I've manually patched framework.jar for some ROMs for my device and some others, by modifying isRoamingBetweenOperators()* to follow the same logic as this module. With Xposed available now, writing this as a module seems like a much cleaner solution that will work on many more devices than one could reasonably maintain manually, and with much less effort.

* I initially tried to hook this function with Xposed. However, this didn't work, because while the function exists in MediaTek's stock ROM, it never seems to be called.
Attached Files
File Type: apk NationalRoaming-0.2.apk - [Click for QR Code] (241.1 KB, 6728 views)
Last edited by oma; 29th August 2013 at 11:42 PM. Reason: v0.2
The Following 37 Users Say Thank You to oma For This Useful Post: [ View ]
29th August 2013, 10:09 PM   |  #2  
Junior Member
Thanks Meter: 0
 
1 posts
Join Date:Joined: Apr 2011
More
I tried you module, but it doesn't work for me. I still have to enable "roaming" to get a data connection. The app "phono" shows "roaming" if I use a national roaming provider.

My network operator is "three austria", using only 3G (UMTS) networks but allows national roaming on the 2G network of "t-mobile austria". My phone is a Nexus 4 with stock rom (Android 4.3) , the XPosed framework works for XPrivacy, MaDaCo Toolkit and NFC LockScreenOff Enabler.

Can I help to find a solution?

Edit: Thanks for your dev version, works great for me now.
Last edited by robspr; 29th August 2013 at 11:09 PM. Reason: Got a newer version
29th August 2013, 11:51 PM   |  #3  
Member
Thanks Meter: 1
 
42 posts
Join Date:Joined: Jan 2011
More
Thank you very much, oma, for this great little module --> this is really useful for me...!
29th August 2013, 11:55 PM   |  #4  
OP Junior Member
Thanks Meter: 38
 
27 posts
Join Date:Joined: Sep 2005
Was anyone able to actually test it yet, either by roaming onto a foreign network, or popping in a foreign SIM?
30th August 2013, 12:12 AM   |  #5  
Account currently disabled
Flag Rotterdam
Thanks Meter: 300
 
918 posts
Join Date:Joined: Aug 2012
Donate to Me
More
Aaahw why didnt you post this 4 weeks back

Than my bills for my vacation were lower...

Verstuurd van mijn GT-I9505
30th August 2013, 12:22 AM   |  #6  
OP Junior Member
Thanks Meter: 38
 
27 posts
Join Date:Joined: Sep 2005
Quote:
Originally Posted by coolnessQ

Aaahw why didnt you post this 4 weeks back

Than my bills for my vacation were lower...

Ouch . I'm afraid I can't offer anything but my sympathy... 4 weeks ago I was still using CM10 on my old phone, so I didn't need it...
The Following User Says Thank You to oma For This Useful Post: [ View ]
30th August 2013, 01:59 AM   |  #7  
Account currently disabled
Flag Rotterdam
Thanks Meter: 300
 
918 posts
Join Date:Joined: Aug 2012
Donate to Me
More
Quote:
Originally Posted by oma

Ouch . I'm afraid I can't offer anything but my sympathy... 4 weeks ago I was still using CM10 on my old phone, so I didn't need it...

Ah not a big deal still many thanks for this app

Verstuurd van mijn GT-I9505
30th August 2013, 11:11 AM   |  #8  
Member
Thanks Meter: 1
 
42 posts
Join Date:Joined: Jan 2011
More
Quote:
Originally Posted by oma

Was anyone able to actually test it yet, either by roaming onto a foreign network, or popping in a foreign SIM?

Yes, for me its works perfect.
I have national roaming, and the "R" sign is gone -> so i can switch off the data roaming, which is much safer....
Thanks again.
1st September 2013, 02:43 PM   |  #9  
Junior Member
Thanks Meter: 0
 
3 posts
Join Date:Joined: Aug 2007
I'm living in Austria using Hutchinsons Network "3". Yesterday I tested your module near the Czech Republic and it works perfect!

With data roaming disabled data transfer in the czech network did not work (as expected) but swiching between "3"'s austrian 2G-networks works fine.

Congratulation, great work. Let us know when we can find your program in google's play store.

Sent from my Mobistel Cynus T5 using xda app-developers app
1st September 2013, 11:44 PM   |  #10  
OP Junior Member
Thanks Meter: 38
 
27 posts
Join Date:Joined: Sep 2005
That's good to hear! Before I put it on the Play Store, I want to add an activity that does some sanity checks (is Xposed installed? enabled? module enabled?) and tells the user what to do if anything isn't set up correctly so I don't get loads of "I installed this and it doesn't do anything, there's not even a launcher icon!!!1" comments.

Post Reply Subscribe to Thread

Tags
mod, national roaming, xposed
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes