FORUMS
Remove All Ads from XDA

[Xposed] [EXPERIMENTAL] National Roaming

34 posts
Thanks Meter: 43
 
By oma, Member on 25th August 2013, 11:50 PM
Post Reply Email Thread
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, 21700 views)
The Following 42 Users Say Thank You to oma For This Useful Post: [ View ] Gift oma Ad-Free
 
 
29th August 2013, 09:09 PM |#2  
Junior Member
Thanks Meter: 0
 
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.
29th August 2013, 10:51 PM |#3  
Member
Thanks Meter: 19
 
More
Thank you very much, oma, for this great little module --> this is really useful for me...!
29th August 2013, 10:55 PM |#4  
OP Member
Thanks Meter: 43
 
More
Was anyone able to actually test it yet, either by roaming onto a foreign network, or popping in a foreign SIM?
29th August 2013, 11:12 PM |#5  
Account currently disabled
Flag Rotterdam
Thanks Meter: 300
 
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
29th August 2013, 11:22 PM |#6  
OP Member
Thanks Meter: 43
 
More
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 ] Gift oma Ad-Free
30th August 2013, 12:59 AM |#7  
Account currently disabled
Flag Rotterdam
Thanks Meter: 300
 
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, 10:11 AM |#8  
Member
Thanks Meter: 19
 
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, 01:43 PM |#9  
Junior Member
Thanks Meter: 0
 
More
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, 10:44 PM |#10  
OP Member
Thanks Meter: 43
 
More
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.
1st September 2013, 10:49 PM |#11  
Senior Member
Flag Frisco
Thanks Meter: 217
 
More
This app might prove useful to me when I visit my home country in a few months.
Post Reply Subscribe to Thread

Tags
mod, national roaming, xposed

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes