Merge "Add Call redirection app in Telecom test-commands" am: 58ee538e62
am: 32827c217b

Change-Id: Ie2b8265b69771835609679e9656c4e6bade96e3f
diff --git a/cmds/telecom/src/com/android/commands/telecom/Telecom.java b/cmds/telecom/src/com/android/commands/telecom/Telecom.java
index f3bf6e7..a39f5e3 100644
--- a/cmds/telecom/src/com/android/commands/telecom/Telecom.java
+++ b/cmds/telecom/src/com/android/commands/telecom/Telecom.java
@@ -46,6 +46,7 @@
     private static final String COMMAND_SET_PHONE_ACCOUNT_DISABLED = "set-phone-account-disabled";
     private static final String COMMAND_REGISTER_PHONE_ACCOUNT = "register-phone-account";
     private static final String COMMAND_REGISTER_SIM_PHONE_ACCOUNT = "register-sim-phone-account";
+    private static final String COMMAND_SET_TEST_CALL_REDIRECTION_APP = "set-test-call-redirection-app";
     private static final String COMMAND_SET_TEST_CALL_SCREENING_APP = "set-test-call-screening-app";
     private static final String COMMAND_ADD_OR_REMOVE_CALL_COMPANION_APP =
             "add-or-remove-call-companion-app";
@@ -68,6 +69,7 @@
                 "usage: telecom set-phone-account-enabled <COMPONENT> <ID> <USER_SN>\n" +
                 "usage: telecom set-phone-account-disabled <COMPONENT> <ID> <USER_SN>\n" +
                 "usage: telecom register-phone-account <COMPONENT> <ID> <USER_SN> <LABEL>\n" +
+                "usage: telecom set-test-call-redirection-app <PACKAGE>\n" +
                 "usage: telecom set-test-call-screening-app <PACKAGE>\n" +
                 "usage: telecom set-test-auto-mode-app <PACKAGE>\n" +
                 "usage: telecom add-or-remove-call-companion-app <PACKAGE> <1/0>\n" +
@@ -120,6 +122,9 @@
             case COMMAND_REGISTER_PHONE_ACCOUNT:
                 runRegisterPhoneAccount();
                 break;
+            case COMMAND_SET_TEST_CALL_REDIRECTION_APP:
+                runSetTestCallRedirectionApp();
+                break;
             case COMMAND_SET_TEST_CALL_SCREENING_APP:
                 runSetTestCallScreeningApp();
                 break;
@@ -189,6 +194,11 @@
         System.out.println("Success - " + handle + " registered.");
     }
 
+    private void runSetTestCallRedirectionApp() throws RemoteException {
+        final String packageName = nextArg();
+        mTelecomService.setTestDefaultCallRedirectionApp(packageName);
+    }
+
     private void runSetTestCallScreeningApp() throws RemoteException {
         final String packageName = nextArg();
         mTelecomService.setTestDefaultCallScreeningApp(packageName);
diff --git a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
index 143b323..d64efea 100644
--- a/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
+++ b/telecomm/java/com/android/internal/telecom/ITelecomService.aidl
@@ -305,6 +305,8 @@
      */
     void handleCallIntent(in Intent intent);
 
+    void setTestDefaultCallRedirectionApp(String packageName);
+
     void setTestDefaultCallScreeningApp(String packageName);
 
     void addOrRemoveTestCallCompanionApp(String packageName, boolean isAdded);