OEM/Google Implementation of the com.android.internal.telephony.Call class in Android
android, android-source, telephony
Solution
You are correct. It is indeed the `com.android.internal.telephony.Call` interface that OEMs implement. More specifically it is the `com.android.internal.telephony.Phone` interface that needs to be implemented, which uses the `Call`, `Connection`, and many more interfaces.
For your second question, Google/ASOP (Android Open Source Project) does actually provide implementation of all these classes for GSM and CDMA. So there is a `GSMPhone` and a `CDMAPhone` implementation in the android source of the `Phone` interface.
You can clone the git `https://android.googlesource.com/platform/frameworks/base` if you do not want to clone the entire Android source code. Have a look under `(frameworks/base)/telephony/java/com/android/internal/telephony/` in either the `gsm/` or `cdma/` folder. Here you will find e.g. `GSMCall.java` which is the implementation of the `com.android.internal.telephony.Call` interface that you ask about.
The android telephony stack looks approximately something like this:
+------------------------------------+
| Phone | Contacts | (other apps) |
+------------------------------------+
|android internal telephony framework|
+------------------------------------+
| Radio Interface Layer (RIL) |
+------------------------------------+
| GSM/CDMA modem |
+------------------------------------+
Where the GSM/CDMA modem is usually supplied by some vendor, and the RIL layer needs to be customized for the specific GSM/CDMA modem used. So in practice vendors don't have to modify the existing implementation of the `Call`, `Connection`, `Phone`, etc. interfaces in `com.android.internal.telephony` package unless they want to provide support for something different than a GSM/CDMA Phone.
Problem
I've been looking into the source code for Android's telephony capabilities and I'm a bit lost. I've basically gathered that unless you're Google or the OEM there is no way to handle the CDMA/GSM devices. Now I'm just trying to figure out where it is the OEM puts their code to handle phone calls in, ie what classes/interfaces do they inherit from/implement. While going through the phone app's `InCallScreen` activity, I traced back the click handler for the end call button to `PhoneUtils.hangup(CallManager)` which ultimately makes a call to `com.android.internal.telephony.Call.hangup()`. Since `com.android.internal.telephony.Call` is an abstract class and `com.android.internal.telephony.Call.hangup()` is an abstract method, I was wondering if this is one of the classes that an OEM would override to provide telephony services. A little more of a shot in the dark is asking if anyone knows of any open-source implementations of this class so I could get some more insight into what is going on behind the scenes.