Add Telecom command for setting connectionservice filter
For testing we need the emergency call to go through the CTS
ConnectionService. This is achieved by passing in a package
name filter for testing, which restricts which ConnectionServices
are available for emergency calling.
For safety this filter will be bypassed if the user calls an
actual emergency number (instead of a test number).
Bug: 138741228
Test: atest CtsTelecomTestCases
Change-Id: I656533e4a36a7bba48625bf6f763731991695aed
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java
index 6409203..12066c4 100644
--- a/telecomm/java/android/telecom/TelecomManager.java
+++ b/telecomm/java/android/telecom/TelecomManager.java
@@ -2059,12 +2059,13 @@
/**
* Handles {@link Intent#ACTION_CALL} intents trampolined from UserCallActivity.
* @param intent The {@link Intent#ACTION_CALL} intent to handle.
+ * @param callingPackageProxy The original package that called this before it was trampolined.
* @hide
*/
- public void handleCallIntent(Intent intent) {
+ public void handleCallIntent(Intent intent, String callingPackageProxy) {
try {
if (isServiceConnected()) {
- getTelecomService().handleCallIntent(intent);
+ getTelecomService().handleCallIntent(intent, callingPackageProxy);
}
} catch (RemoteException e) {
Log.e(TAG, "RemoteException handleCallIntent: " + e);
diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
index 7047498..6a1b78f 100644
--- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
+++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
@@ -282,6 +282,11 @@
void acceptHandover(in Uri srcAddr, int videoState, in PhoneAccountHandle destAcct);
/**
+ * @see TelecomServiceImpl#setTestEmergencyPhoneAccountPackageNameFilter
+ */
+ void setTestEmergencyPhoneAccountPackageNameFilter(String packageName);
+
+ /**
* @see TelecomServiceImpl#isInEmergencyCall
*/
boolean isInEmergencyCall();
@@ -289,7 +294,7 @@
/**
* @see TelecomServiceImpl#handleCallIntent
*/
- void handleCallIntent(in Intent intent);
+ void handleCallIntent(in Intent intent, in String callingPackageProxy);
void setTestDefaultCallRedirectionApp(String packageName);
@@ -302,9 +307,9 @@
void setTestAutoModeApp(String packageName);
/**
- * @see TelecomServiceImpl#setSystemDialerPackage
+ * @see TelecomServiceImpl#setSystemDialer
*/
- void setSystemDialerPackage(in String packageName);
+ void setSystemDialer(in ComponentName testComponentName);
/**
* @see TelecomServiceImpl#setTestDefaultDialer