Calls partially working on U8185 on CyanogenMod 9

I recently got GSM working on the Huawei U8185 on CyanogenMod 9. SMS, USSD, SIM Toolkit, etc were all working, but for some reason making telephone calls wasn’t; the call would initiate, crash to the home screen, and then continue in the background. During the crash the audio would route to the loudspeaker for a few seconds and then revert to the earpiece, leading me to suspect an audio routing issue.

Here’s what the relevant parts of logcat during the crash looked like:


I/ActivityManager(  207): START {act=android.intent.action.MAIN flg=0x10840000 cmp=com.android.phone/.InCallScreen} from pid 1347
I/InCallScreen( 1347): onCreate()...  this = com.android.phone.InCallScreen@40daa0f0
D/InCallScreen( 1347): - onCreate: phone state = OFFHOOK
I/dalvikvm( 1347): threadid=1: stack overflow on call to Landroid/util/SparseArray;.get:LIL
I/dalvikvm( 1347):   method requires 28+20+16=64 bytes, fp is 0x4384b318 (24 left)
I/dalvikvm( 1347):   expanding stack end (0x4384b300 to 0x4384b000)
I/dalvikvm( 1347): Shrank stack (to 0x4384b300, curFrame is 0x4384b34c)
E/ActivityThread( 1347): Failed to inflate
E/ActivityThread( 1347): android.view.InflateException: Binary XML file line #35: Error inflating class 
E/ActivityThread( 1347): 	at android.view.LayoutInflater.createView(LayoutInflater.java:606)
...
W/ActivityManager(  207):   Force finishing activity com.android.phone/.InCallScreen

After inspecting the log a few times, I noticed the bit about dalvikvm failing to allocate more memory.

dalvik.vm.heapsize to the rescue!

As I hadn’t specified what dalvik heap size to use, I guess it was using the Android default (32 megs? 35?), which is a plausible explanation for this crash (Ice Cream Sandwich apps are huge!). I had a glance at Ricardo Cerqueira’s LG e400 repo (as the e400 is almost exactly the same device as the U8185) and noticed he was using 76m.

Dalvik tweaks in u8185.mk:


PRODUCT_TAGS += dalvik.gc.type-precise
PRODUCT_PROPERTY_OVERRIDES += \
    dalvik.vm.heapstartsize=5m \
    dalvik.vm.heapgrowthlimit=32m \
    dalvik.vm.heapsize=76m

After this I was successfully able to place a call without the UI activity crashing:

… but the remote side couldn’t hear me. So that’s a problem for another day!

Another problem is going to be the limited RAM in the U8185 (256 MB). I’ll have to see if I can get some compression (zram) / page caching (zcache) working in the kernel, as our msm7225a CPU is really fast.

18 thoughts on “Calls partially working on U8185 on CyanogenMod 9

  1. My dailer is working properly. The error was that the dailer did not allow ldpi. when you change the dpi to 160, the dialer works. I replaced it with a working Phone.apk of 120dpi and it works like charm 😉

    1. Hmm, that’s interesting. I think my issue was due to memory allocation, though. Are you using my U8185 CM9 device tree?

      1. I cloned the exact device tree on GITHUB. Use your first compilation but change the ro.sf.lcd_density=120 to 160. The Phone.apk could not inflate at 120dpi but infaltes well at 160dpi

        1. Ok, that’s interesting. Increasing the dalvik heap size does fix the problem as well. I will try it again at 160 DPI because I’m curious.

  2. My dialer crashed despite using the dalvik tweak from Alan. Pushing an ldpi Phone.apk each time you build is a pain, so I added an overlay for Phone with ldpi assets and voila! problem solved.

    1. Weird, I can confirm that the build definitely works as it is from my repo. But I think using an LDPI overlay is a better approach, especially if it allows us to use a smaller Dalvik heap.

      1. cyanon00b created an LDPI Phone overlay*, and works without the big Dalvik heap. That should help the RAM issue…

        *https://github.com/alanorth/android_device_huawei_u8185/commit/99b4a1cc10842c406dee89bc9790d8db43b934ef

        I still get Trebuchet dying in the background quite often though… heh.

    1. Wow, thanks. I’d love to collaborate! So this new Phone.apk, does call audio work? Also, are any 4pda.ru hackers able to help me port Wi-Fi module to the 3.0.8 kernel?

  3. Don’t know, maybe. As I know, the problem with WiFi isn’t interesting for “hackers” on 4pda.ru’s 8186 forum tree…
    Is there any way to use kernel, for example, from CM9 for U8818, U8815 or U8655 with working WiFi?
    Here I saw a CM9 for 8818, this device is using the same baseband (109808) as U8185/8186. Why not to try it’s kernel?

  4. Forgot to say…
    Kashtanmax has built his CM9 from one of LG’s smarthones… So the Phone.apk I mentionned is the same that u use in your CM9.
    Don’t know why but it works.
    I think i can get this CM9, but later.

    1. Ah, that would be good. I bet he used the LG e400, it’s msm7x27a and LDPI like our U8185/U8186.

      When you say that the Phone works, what do you mean? Audio?

      1. yeah. The audio works, everybody can hear you!. I’ve replaced the Phone.apk of your CM9’s version by the Phone.apk from 4pda.ru. And it’s from LG e400, that’s right.

  5. Hello friends i have state person to help in this rom i would be grateful if you could give me the link to download the phonea.apk in 4pda.ru but not on this page because i could download it from here ,please i hope your help

Comments are closed.