[MTCD Android Head Units General] scorillo_ro:
Later edit: This modification is now part of the version 3 of Malaysk's ROM!

Hi all,

I think I have good news in what regards placing bluetooth phone calls directly from Contacts apps using MtcDialer, but without the "send sms" trick (which is still the easiest way).

I'm not an android expert and actually had no previous experience until I got my PX5 unit, so I'm not sure that what I've discovered is safe or not for our units. Maybe someone like @Malaysk can take a look and if it's safe enough maybe include the solution in his ROM.

So be warned: don't mess with your system if you don't know what you are doing!

What I did was to change just one boolean (com.android.internal.R.bool.config_voice_capable) to true.

Did that by extracting/decompiling the framework-res.apk, then changed the following line in framework-res/res/values/bools.xml (was set to false)

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

and finally repacked/compiled a new apk.

From the new apk I extracted the resources.arsc file and used it to replace the resources.arsc file in the original framework-res.apk

unzip framework-res-new.apk resources.arsc
zip framework-res.apk "resources.arsc"

The final step was to replace /system/framework/framework-res.apk from a root shell on my unit.

Did that by first copying the modified framework-res.apk to /system/framework/framework-res.apk_voice, then

chmod 644 /system/framework/framework-res.apk_voice
mv /system/framework/framework-res.apk_voice /system/framework/framework-res.apk

After reboot I was able to chose MtcDialer as the default app for placing calls when I used my Contacts app (see attached photos).

As I was saying I'm not an android developer but looking in the system logs (using aLogcat) I didn't saw any related errors, just some info messages that are repeating:

I/Telecom ( 593): PhoneAccountRegistrar: [ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, [2be88ca4242c76e8253ac62474851065032d6833], UserHandle{0}(icon: Icon(typ=BITMAP size=24x30) -> Icon(typ=BITMAP size=24x30))(lbl: -> null)(desc: -> null)]
I/Telecom ( 593): : Sending phone-account intent as user
I/Telephony( 707): AccountEntry: Registered phoneAccount: [[ ] PhoneAccount: ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, [2be88ca4242c76e8253ac62474851065032d6833], UserHandle{0} Capabilities: 54 Schemes: tel voicemail ] with handle: ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, [2be88ca4242c76e8253ac62474851065032d6833], UserHandle{0}
I/Telephony( 707): PstnIncomingCallNotifier: Registering: Handler (com.android.internal.telephony.gsm.GSMPhone) {1859d95}
I/Telecom ( 593): PhoneAccountRegistrar: [ComponentInfo{com.android.phone/com.android.services.telephony.TelephonyConnectionService}, [2be88ca4242c76e8253ac62474851065032d6833], UserHandle{0}(icon: Icon(typ=BITMAP size=24x30) -> Icon(typ=BITMAP size=24x30))]
I/Telecom ( 593): : Sending phone-account intent as user

Also, I don't know if declaring our units as voice capable is affecting other system capabilities. I will let the experts to decide if this is safe enough to be included in the custom roms.