Update Telecom usage of renamed API constants.

Also, ensuring the handover success/failure callbacks are called (found
this while cleaning up API constants).

Test: Make Manual
Change-Id: I7b8fdaf66862c119a372439e95ea6201c6c570a3
Fixes: 73751004
Fixes: 73750515
Fixes: 73750817
Fixes: 74250501
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 4086775..28a54ad 100644
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -2472,15 +2472,17 @@
     private void rejectHandoverTo(Call handoverTo) {
         Call handoverFrom = handoverTo.getHandoverSourceCall();
         Log.i(this, "rejectHandoverTo: from=%s, to=%s", handoverFrom.getId(), handoverTo.getId());
-        Log.addEvent(handoverFrom, LogUtils.Events.HANDOVER_FAILED, "from=%s, to=%s",
+        Log.addEvent(handoverFrom, LogUtils.Events.HANDOVER_FAILED, "from=%s, to=%s, rejected",
                 handoverTo.getId(), handoverFrom.getId());
-        Log.addEvent(handoverTo, LogUtils.Events.HANDOVER_FAILED, "from=%s, to=%s",
+        Log.addEvent(handoverTo, LogUtils.Events.HANDOVER_FAILED, "from=%s, to=%s, rejected",
                 handoverTo.getId(), handoverFrom.getId());
 
         // Inform the "from" Call (ie the source call) that the handover from it has
         // failed; this allows the InCallService to be notified that a handover it
         // initiated failed.
         handoverFrom.onConnectionEvent(Connection.EVENT_HANDOVER_FAILED, null);
+        handoverFrom.onHandoverFailed(android.telecom.Call.Callback.HANDOVER_FAILURE_USER_REJECTED);
+
         // Inform the "to" ConnectionService that handover to it has failed.  This
         // allows the ConnectionService the call was being handed over
         if (handoverTo.getConnectionService() != null) {
@@ -2488,6 +2490,8 @@
             // early on in the handover process, the CS will be unbound and we won't be
             // able to send the call event.
             handoverTo.sendCallEvent(android.telecom.Call.EVENT_HANDOVER_FAILED, null);
+            handoverTo.getConnectionService().handoverFailed(handoverTo,
+                    android.telecom.Call.Callback.HANDOVER_FAILURE_USER_REJECTED);
         }
         handoverTo.markFinishedHandoverStateAndCleanup(HandoverState.HANDOVER_FAILED);
     }
@@ -2496,7 +2500,9 @@
         Call handoverFrom = handoverTo.getHandoverSourceCall();
         Log.i(this, "acceptHandoverTo: from=%s, to=%s", handoverFrom.getId(), handoverTo.getId());
         handoverTo.setHandoverState(HandoverState.HANDOVER_ACCEPTED);
+        handoverTo.onHandoverComplete();
         handoverFrom.setHandoverState(HandoverState.HANDOVER_ACCEPTED);
+        handoverFrom.onHandoverComplete();
 
         Log.addEvent(handoverTo, LogUtils.Events.ACCEPT_HANDOVER, "from=%s, to=%s",
                 handoverFrom.getId(), handoverTo.getId());
@@ -3411,7 +3417,7 @@
         boolean isHandoverToSupported = isHandoverToPhoneAccountSupported(handoverToHandle);
         if (!isHandoverFromSupported || !isHandoverToSupported) {
             handoverFromCall.onHandoverFailed(
-                    android.telecom.Call.Callback.HANDOVER_FAILURE_DEST_NOT_SUPPORTED);
+                    android.telecom.Call.Callback.HANDOVER_FAILURE_NOT_SUPPORTED);
             return;
         }
 
@@ -3642,7 +3648,7 @@
                 hasEmergencyCall()) {
             Log.w(this, "acceptHandover: Handover not supported");
             notifyHandoverFailed(call,
-                    android.telecom.Call.Callback.HANDOVER_FAILURE_DEST_NOT_SUPPORTED);
+                    android.telecom.Call.Callback.HANDOVER_FAILURE_NOT_SUPPORTED);
             return;
         }
 
@@ -3650,7 +3656,7 @@
         if (phoneAccount == null) {
             Log.w(this, "acceptHandover: Handover not supported. phoneAccount = null");
             notifyHandoverFailed(call,
-                    android.telecom.Call.Callback.HANDOVER_FAILURE_DEST_NOT_SUPPORTED);
+                    android.telecom.Call.Callback.HANDOVER_FAILURE_NOT_SUPPORTED);
             return;
         }
         call.setIsSelfManaged(phoneAccount.isSelfManaged());