In Android emulator, it would use a qemud socket as GSM modem and it can simulate GSM network. Like camp to GSM base station (Android 3G :P), receive incoming call, dial out a phone call, has a simulated SIM Card, send SMS messages....etc. In my previous article about tracing RIL, I tried to run two emulators and made a phone call to each other. It's pretty fun, coz it can simulate real GSM network.
But it's still a fake one, not real GSM network, it doesn't camp to the nearby network like your mobile does. Therefore..... I changed few lines and made Android emulator to run an external GSM modem. Here is my experiment!
rild: allow it to use other GSM device in qemu
diff --git a/rild/rild.c b/rild/rild.c
index 14a6ea9..bd91314 100644
@@ -161,7 +161,7 @@ int main(int argc, char **argv)
- if (strstr(buffer, "android.qemud=") != NULL)
+ if (strstr(buffer, "android.qemud=") == NULL)
/* the qemud daemon is launched after rild, so
* give it some time to create its GSM socket
Modify rild lib argument and change device name
diff --git a/target/board/generic/system.prop b/target/board/generic/system.prop
index f2424c9..1b84596 100644
@@ -3,4 +3,4 @@
GTA02 NEO phone
erin@daydreamer:~$ sudo ifconfig usb0 192.168.0.200
erin@daydreamer:~$ ssh firstname.lastname@example.org
root@om-gta02:~# echo 1 > /sys/devices/platform/neo1973-pm-gsm.0/power_on
root@om-gta02:~# echo ate1 | ./tickminicom
root@om-gta02:~# nc -l -p 4270 < /dev/ttySAC0 > /dev/ttySAC0 &
PS. tickminicom is here
Running pty in host machine
# ./pty 192.168.0.202 4270
PS.1 where is pty? how do I know it? it's from Thomas! I was co-working with him about gsmd and dialer UI in 2007.
Running emulator with serial port option
erin@daydreamer:~/android/mydroid_emu/out$ ./host/linux-x86/bin/emulator -system ./target/product/generic/system.img -sysdir ./target/product/generic/system -data ./target/product/generic/userdata.img -kernel ../prebuilt/android-arm/kernel/kernel-qemu -ramdisk ./target/product/generic/ramdisk.img -qemu -serial /dev/pts/2
Cannot receive any incoming call
I was stuck on this case and it would send hangup command to any incoming calls without any notification UI. I found this issue is a known one and we can set 'Settings.Secure.DEVICE_PROVISIONED' to 1. Then no problem now.
What it can do now?
* Camp to GSM network
* Dial out a phone call
* Receive an incoming call
* Send SMS
* Receive SMS