Add xml file for telephony component injection
Providing telephony_injection.xml in resources to configure
TelephonyComponentFactory during the boot time. So that OEM can
use their own component factory implementations from specified
jars. PhoneGlobals will start the injection before initializing
telephony framework.
Test: Manual
Bug: 116353399
Change-Id: If037c39d40beb4699d5db510738ad327f5478b7d
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index 5009bfe..2cefd52 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -25,6 +25,7 @@
import android.content.ContextWrapper;
import android.content.Intent;
import android.content.IntentFilter;
+import android.content.res.XmlResourceParser;
import android.media.AudioManager;
import android.net.ConnectivityManager;
import android.net.Uri;
@@ -59,6 +60,7 @@
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.SettingsObserver;
import com.android.internal.telephony.TelephonyCapabilities;
+import com.android.internal.telephony.TelephonyComponentFactory;
import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.telephony.dataconnection.DataConnectionReasons;
import com.android.internal.telephony.dataconnection.DataConnectionReasons.DataDisallowedReasonType;
@@ -281,6 +283,9 @@
// getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY_VOICE_CALLS);
if (mCM == null) {
+ // Inject telephony component factory if configured using other jars.
+ XmlResourceParser parser = getResources().getXml(R.xml.telephony_injection);
+ TelephonyComponentFactory.getInstance().injectTheComponentFactory(parser);
// Initialize the telephony framework
PhoneFactory.makeDefaultPhones(this);