[Gen9 Android Development] trevd:
Hi surdu_petru and AOKP fans.

Great work as always, It's not a rom i'll ever use but It's the first time I've loaded an AOKP Rom, I like notification layout, I'll be having that away for my own personal rom :cowboy: Anyway I was more just passing through and noticed 3G was not working yet. As seen as though that seems to be my speciality and preoccupation/addiction for the last 9 months I thought I do something to remedy that situation for you.

Here's an hotfile link to download the update [ 3g-archos-aopk.7z ] this should contain everything you need to get the Archos 3G Dongle, just for ****s and giggles as a extra bonus i've also included the huawei support file as well :good:

Installation:

From a command prompt / bash terminal

7z x 3g-archos-aopk.7z
adb push 3g /
adb shell reboot_into sde

extracting the 3g-archos-aopk.7z will give youu a 3g directory in you current directory, we then push the contents of the 3g directory to the root direcotry on the device. This operation is recursive.

Have Fun!

What follows is a detailed explanation of what files and modifications are required to add 3G support.

Archos 3G Stick

The changes / additions to add this functionality breaks down like this ; The following required binary's were on the device already:

** /lib/modules/hso.ko is insmod'd by the device specific init file /etc/init/init.<model>.rc

/lib/modules/hso.ko[B]**[/B]
/usr/bin/usb_modeswitch
/system/lib/libtcl-ril.so
/system/bin/rild
/system/bin/pppd
/system/xbin/chat
/etc/ppp/init_pppd_datakey
/etc/ppp/ip-up-datakey
/etc/ppp/ip-down-datakey
/etc/ppp/peers/datakey
/etc/chatscripts/datakey_start
/etc/chatscripts/datakey_stop
/etc/usb_modeswitch/1bbb_f000

The following required services were already defined in the device specific init.rc's located in /etc/init/init.<model>.rc ,

*** switch_ms_3g defined by /etc/init/init.archos.rc

service service switch_ms_to_3g[B]***[/B]
service pppd_secrets
service pppd_datakey
service ril-daemon

So what's missing? you may ask as this pretty much is everything that is needed by the Archos 3G Stick.

Standard Archos Roms use the UsbKeyManager.apk system service to start the switch_ms_to_3g and ril-daemon service's. I replace that with my own ueventd handling native service and add an additional to configuration file keep everything clean

/system/bin/hotplugd
/init.dongle.rc

I've added the following line to the top of the /init.rc

import init.dongle.rc

All that is left to do now is enable mobile networks on the rom. I used apktool to decompile the /system/framework/framework-res.apk and change the following values

res/values/bools.xml

<bool name="config_voice_capable">true</bool>
<bool name="config_sms_capable">true</bool>

res/values/arrays.xml

<string-array name="networkAttributes">
<item>wifi,1,1,1,-1,true</item>
<item>mobile,0,0,0,-1,true</item>
<item>mobile_mms,2,0,2,60000,true</item>
<item>mobile_supl,3,0,2,60000,true</item>
<item>mobile_hipri,5,0,3,60000,true</item>
<item>mobile_fota,10,0,2,60000,true</item>
<item>mobile_ims,11,0,2,60000,true</item>
<item>mobile_cbs,12,0,2,60000,true</item>
<item>wifi_p2p,13,1,0,-1,true</item>
</string-array>
<string-array name="radioAttributes">
<item>"1,1"</item>
<item>"0,1"</item>
<item>"7,1"</item>
<item>"9,1"</item>
</string-array>

res/values/strings.xml

<string name="config_datause_iface">ppp1</string>

Huawei Support

The extend this functionality further I added the following files

/etc/ppp/init_pppd_gprs
/etc/ppp/ip-up-gprs
/etc/ppp/ip-down-gprs
/etc/ppp/peers/gprs
/etc/chatscripts/gprs_start
/etc/chatscripts/gprs_stop
/etc/usb_modeswitch/ [ numerous configurations files ]
/lib/modules/usb_wwan.ko
/lib/modules/option.ko
/system/lib/libhuaweigeneric-ril.so

We also need to chmod 6755 /system/bin/pppd but that is handled/checked in the /init.dongle.rc so there is no need to do that manually