[Gen9 Android Development] trevd:
3G Support Added

Hi Folks

Just to let you know I've cracked the 3G Support for both the Archos Dongles and Huawei (usb_wwan) dongles. :victory:

It's got full connectivity service support and you can also use the standard android app to send sms, I presume mms will work aswell.

I also enabled voice but I don't know whether my dongles have voice support on. :good:

What Follows is a bit of a brain dump :)

There seems to one outstanding issue, it seems the usb hub is suspending if idle for too long ( although just typing that last sentence has given me an idea of where to look :) ) Anyway if there's any linux kernel power management experts out there your input will be most welcome.

It's got something to do with sysfs and rfkill functionality, Areas which I am yet to get a proper grasp on.

@JackpotClavin I'll push it all to my github fork today and then you can pull it if you like!

For those buidling along at home :) you can change your config.xml which is in the device/overlay to look like this

<resources>
<bool translatable="false" name="config_bluetooth_adapter_quick_switch">false</bool>
<bool name="config_disableMenuKeyInLockScreen">false</bool>
<bool name="config_voice_capable">true</bool>
<bool name="config_sms_capable">true</bool>
<string name="config_networkLocationProvider">com.google.android.location.NetworkLocationProvider</string>
<string name="config_geocodeProvider">com.google.android.location.GeocodeProvider</string>
<string name="config_datause_iface">ppp1</string>
<string-array translatable="false" name="networkAttributes">
<item>"wifi,1,1,2,-1,true"</item>
<item>"mobile,0,0,1,-1,true"</item>
<item>"mobile_mms,2,0,2,60000,true"</item>
<item>"mobile_supl,3,0,2,60000,true"</item>
<item>"mobile_dun,4,0,5,60000,true"</item>
<item>"mobile_hipri,5,0,3,60000,true"</item>
<item>"bluetooth,7,7,0,-1,true"</item>
<item>"ethernet,9,9,9,-1,true"</item>
<item>"mobile_fota,10,0,2,60000,true"</item>
<item>"mobile_ims,11,0,2,-1,true"</item>
<item>"mobile_cbs,12,0,2,60000,true"</item>
<item>"wifi_p2p,13,1,0,-1,true"</item>
</string-array>
<string-array translatable="false" name="radioAttributes">
<item>"9,1"</item>
<item>"1,1"</item>
<item>"0,1"</item>
<item>"7,1"</item>
</string-array>
</resources>

This file gets built into the framework-res.apk and with these changes we now get the signal icon/status in the notifaction tray and the Mobile Networks Settings Box appears. :)

After that I copied all the files needed for 3G. which are

/lib/modules/usb_wwan.ko
/lib/modules/hso.ko
/lib/modules/option.ko
/etc/chatscripts/*
/etc/usb_modeswitch/*
/etc/ppp/init_pppd_gprs
/etc/ppp/ip-up-gprs
/etc/ppp/ip-down-gprs
/etc/ppp/init_pppd_datakey
/etc/ppp/ip-up-datekey
/etc/ppp/ip-down-datakey
/etc/ppp/write_secrets
/etc/ppp/peers/gprs
/etc/ppp/peers/datakey
/system/xbin/chat
/system/lib/libtcl-ril.so
/system/lib/libhuaweigeneric-ril (for huawei modems)

We need to chmod 6755 /system/bin/pppd to work with the huawei-ril, this probably wants sorting out because the archos ril doesn't require root permissions.

I also reused the hotplugd native service which I wrote to handle device insertion and extended it to handle the Archos Stick aswell, although init /ueventd does have provisions for handling device "hotplugging" (in the documentation at least), I am yet to see it used by any vendor and a quick grep on the AOSP source code reveals it is more future-ware than a option available to us at this time, unless I've missed something obvious. This needs a little bit of work to handle the cold boot scenario which I will do today.

A final thought. I had to manually setup my APN, although it appears my apns-conf.xml was it incorrect, but it is something to be aware of.

On Last Tip

adb logcat -b radio

is your friend when it comes to hacking on the modems

Happy Hacking People! Now to build