Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,769,820 Members 49,692 Now Online
XDA Developers Android and Mobile Development Forum

[Xposed] [EXPERIMENTAL] National Roaming

Tip us?
 
oma
Old
(Last edited by oma; 29th August 2013 at 10:42 PM.) Reason: v0.2
#1  
Junior Member - OP
Thanks Meter 33
Posts: 27
Join Date: Sep 2005
Default [Xposed] [EXPERIMENTAL] National Roaming

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, 3461 views)
The Following 32 Users Say Thank You to oma For This Useful Post: [ Click to Expand ]
 
robspr
Old
(Last edited by robspr; 29th August 2013 at 10:09 PM.) Reason: Got a newer version
#2  
Junior Member
Thanks Meter 0
Posts: 1
Join Date: Apr 2011
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.
 
Lion_1
Old
#3  
Member
Thanks Meter 1
Posts: 42
Join Date: Jan 2011
Thank you very much, oma, for this great little module --> this is really useful for me...!
 
oma
Old
#4  
Junior Member - OP
Thanks Meter 33
Posts: 27
Join Date: Sep 2005
Was anyone able to actually test it yet, either by roaming onto a foreign network, or popping in a foreign SIM?
 
coolnessQ
Old
#5  
Account currently disabled
Thanks Meter 300
Posts: 955
Join Date: Aug 2012
Location: Rotterdam

 
DONATE TO ME
Aaahw why didnt you post this 4 weeks back

Than my bills for my vacation were lower...

Verstuurd van mijn GT-I9505
 
oma
Old
#6  
Junior Member - OP
Thanks Meter 33
Posts: 27
Join Date: Sep 2005
Quote:
Originally Posted by coolnessQ View Post
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: [ Click to Expand ]
 
coolnessQ
Old
#7  
Account currently disabled
Thanks Meter 300
Posts: 955
Join Date: Aug 2012
Location: Rotterdam

 
DONATE TO ME
Quote:
Originally Posted by oma View Post
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
 
Lion_1
Old
#8  
Member
Thanks Meter 1
Posts: 42
Join Date: Jan 2011
Quote:
Originally Posted by oma View Post
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.
 
neugieriger
Old
#9  
Junior Member
Thanks Meter 0
Posts: 3
Join Date: 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
 
oma
Old
#10  
Junior Member - OP
Thanks Meter 33
Posts: 27
Join Date: 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.

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

Advanced Search
Display Modes