Add new API to notify CallRedirectionService timed out.

Currently, CallRedirectionService is unable to know if a call failed due
to timeout. Add new API to notify them and call it when Telecom wait too
long to complete a call redirection request.

Bug: 187346611
Test: CTS test
Change-Id: I65aa0a893b3e35a412851ec969f6cdec74af8fab
diff --git a/src/com/android/server/telecom/callredirection/CallRedirectionProcessor.java b/src/com/android/server/telecom/callredirection/CallRedirectionProcessor.java
index e93ef22..34975aa 100644
--- a/src/com/android/server/telecom/callredirection/CallRedirectionProcessor.java
+++ b/src/com/android/server/telecom/callredirection/CallRedirectionProcessor.java
@@ -124,6 +124,17 @@
             }
         }
 
+        public void notifyTimeout() {
+            if (mService != null) {
+                try {
+                    mService.notifyTimeout();
+                } catch (RemoteException e) {
+                    Log.e(this, e, "Failed to notify call redirection timed out to "
+                            + mServiceType + " call redirection service");
+                }
+            }
+        }
+
         private class CallRedirectionServiceConnection implements ServiceConnection {
             @Override
             public void onServiceConnected(ComponentName componentName, IBinder service) {
@@ -394,6 +405,7 @@
                     Log.addEvent(mCall, serviceType.equals(SERVICE_TYPE_USER_DEFINED)
                             ? LogUtils.Events.REDIRECTION_TIMED_OUT_USER
                             : LogUtils.Events.REDIRECTION_TIMED_OUT_CARRIER);
+                    mAttempt.notifyTimeout();
                     if (serviceType.equals(SERVICE_TYPE_USER_DEFINED)) {
                         mUiAction = UI_TYPE_USER_DEFINED_TIMEOUT;
                         mShouldCancelCall = true;