Move ACTION_SIP_INCOMING_CALL back to Manifest
The ACTION_SIP_INCOMING_CALL intent receiver along with
all of the other SIP intent receivers were moved to
dynamic registration because background check
was not letting them be received. Since
ACTION_SIP_INCOMING_CALL is an explicit intent, this
caused this intent to not be received anymore and
caused SIP incoming calls to not show InCall UI.
This change moves that intent back to the manifest
so that it can be received.
Bug: 64508600
Test: Manual
Change-Id: Ie330f748790fc0470a2b59128258c50e17d4cdf7
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index 20eedeb..98b94cc 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -65,7 +65,7 @@
import com.android.phone.common.CallLogAsync;
import com.android.phone.settings.SettingsConstants;
import com.android.phone.vvm.CarrierVvmPackageInstalledReceiver;
-import com.android.services.telephony.sip.SipBroadcastReceiver;
+import com.android.services.telephony.sip.SipAccountRegistry;
import com.android.services.telephony.sip.SipUtil;
import java.io.FileDescriptor;
@@ -176,7 +176,7 @@
// Broadcast receiver for various intent broadcasts (see onCreate())
private final BroadcastReceiver mReceiver = new PhoneAppBroadcastReceiver();
// Broadcast receiver for SIP based intents (see onCreate())
- private final SipBroadcastReceiver mSipBroadcastReceiver = new SipBroadcastReceiver();
+ private final SipReceiver mSipReceiver = new SipReceiver();
private final CarrierVvmPackageInstalledReceiver mCarrierVvmPackageInstalledReceiver =
new CarrierVvmPackageInstalledReceiver();
@@ -247,7 +247,7 @@
case EVENT_RESTART_SIP:
// This should only run if the Phone process crashed and was restarted. We do
// not want this running if the device is still in the FBE encrypted state.
- // This is the same procedure that is triggered in the SipBroadcastReceiver
+ // This is the same procedure that is triggered in the SipIncomingCallReceiver
// upon BOOT_COMPLETED.
UserManager userManager = UserManager.get(sMe);
if (userManager != null && userManager.isUserUnlocked()) {
@@ -367,11 +367,10 @@
registerReceiver(mReceiver, intentFilter);
IntentFilter sipIntentFilter = new IntentFilter(Intent.ACTION_BOOT_COMPLETED);
- sipIntentFilter.addAction(SipManager.ACTION_SIP_INCOMING_CALL);
sipIntentFilter.addAction(SipManager.ACTION_SIP_SERVICE_UP);
sipIntentFilter.addAction(SipManager.ACTION_SIP_CALL_OPTION_CHANGED);
sipIntentFilter.addAction(SipManager.ACTION_SIP_REMOVE_PHONE);
- registerReceiver(mSipBroadcastReceiver, sipIntentFilter);
+ registerReceiver(mSipReceiver, sipIntentFilter);
mCarrierVvmPackageInstalledReceiver.register(this);
@@ -763,6 +762,31 @@
}
}
+ private class SipReceiver extends BroadcastReceiver {
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+
+ SipAccountRegistry sipAccountRegistry = SipAccountRegistry.getInstance();
+ if (action.equals(Intent.ACTION_BOOT_COMPLETED)) {
+ SipUtil.startSipService();
+ } else if (action.equals(SipManager.ACTION_SIP_SERVICE_UP)
+ || action.equals(SipManager.ACTION_SIP_CALL_OPTION_CHANGED)) {
+ sipAccountRegistry.setup(context);
+ } else if (action.equals(SipManager.ACTION_SIP_REMOVE_PHONE)) {
+ if (DBG) {
+ Log.d(LOG_TAG, "SIP_REMOVE_PHONE "
+ + intent.getStringExtra(SipManager.EXTRA_LOCAL_URI));
+ }
+ sipAccountRegistry.removeSipProfile(intent.getStringExtra(
+ SipManager.EXTRA_LOCAL_URI));
+ } else {
+ if (DBG) Log.d(LOG_TAG, "onReceive, action not processed: " + action);
+ }
+ }
+ }
+
private void handleServiceStateChanged(Intent intent) {
/**
* This used to handle updating EriTextWidgetProvider this routine