View Single Post
Posts: 30 | Thanked: 25 times | Joined on Jul 2012
#810
I have tested this kind of trick:

Switch background connections on:
Code:
/sbin/initctl restart xsession/icd2
sleep 5
gconftool-2 -t bool -s /system/osso/connectivity/network_type/restricted_mode false
And switch off:

Code:
gconftool-2 -t bool -s /system/osso/connectivity/network_type/restricted_mode true
sleep 5
/sbin/initctl restart xsession/icd2
After a little testing, it seems to work otherwise OK, but problem is that doing this way will terminate ongoing data transfer. I guess it might be possible to make phone wait until data transfer is complete, but I have no idea how. It might also be impossible to do this without opensh...

I added those sleeps, because it seemed to cause connection to freeze sometimes, if two other command were executed without waiting for a while. Not really sure if they are needed.

Please note, that reliability of this trick is far from certain! I've only tested it on my N9 for about a week.

EDIT:

Setting the internet on/off with mcetools instead of restarting icd2
seems to give a reliable result. (See: http://talk.maemo.org/showpost.php?p...&postcount=983)

I now switch background connections on by:

Code:
/sbin/mcetool --disable-radio=wlan
sleep 1
/sbin/mcetool --enable-radio=wlan
sleep 1
gconftool-2 -t bool -s /system/osso/connectivity/network_type/restricted_mode false
and off by:

Code:
gconftool-2 -t bool -s /system/osso/connectivity/network_type/restricted_mode true
/sbin/mcetool --disable-radio=wlan
sleep 1
/sbin/mcetool --enable-radio=wlan

Last edited by kkarioja; 2013-04-18 at 15:38. Reason: Better solution found
 

The Following 8 Users Say Thank You to kkarioja For This Useful Post: