Fix the incorrect display of the phone account info for an ecall

Notify Telecom of the change so that the proper PhoneAccount can be
displayed, if phoneAccountHandle is adjusted using another phone in
service when an emergency call.

Test: manual
Test: atest TelephonyConnectionServiceTest
Bug: 222657080

Change-Id: I437e0e3aba3a0056a0f41be33300baa9fa497382
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index b3b0686..1eb9813 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -1140,6 +1140,11 @@
                             "Invalid phone type",
                             phone.getPhoneId()));
         }
+        if (!Objects.equals(request.getAccountHandle(), accountHandle)) {
+            Log.i(this, "onCreateOutgoingConnection, update phoneAccountHandle, accountHandle = "
+                    + accountHandle);
+            connection.setPhoneAccountHandle(accountHandle);
+        }
         connection.setAddress(handle, PhoneConstants.PRESENTATION_ALLOWED);
         connection.setTelephonyConnectionInitializing();
         connection.setTelephonyVideoState(request.getVideoState());