Emergency redial implementation

Define connection event to notify
Telecom/InCallUi about change in
account handle after redial and extra
for emergency phone handle.

Bug: 27059146
Change-Id: Ie72ab2901ec05d972204ed11f115a05b79173c1d
diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
index 80e3c33..b1617f4 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
@@ -72,6 +72,7 @@
     private static final int MSG_ON_RTT_INITIATION_FAILURE = 31;
     private static final int MSG_ON_RTT_REMOTELY_TERMINATED = 32;
     private static final int MSG_ON_RTT_UPGRADE_REQUEST = 33;
+    private static final int MSG_SET_PHONE_ACCOUNT_CHANGED = 34;
 
     private final IConnectionServiceAdapter mDelegate;
 
@@ -318,6 +319,16 @@
                 case MSG_ON_RTT_UPGRADE_REQUEST:
                     mDelegate.onRemoteRttRequest((String) msg.obj, null /*Session.Info*/);
                     break;
+                case MSG_SET_PHONE_ACCOUNT_CHANGED: {
+                    SomeArgs args = (SomeArgs) msg.obj;
+                    try {
+                        mDelegate.onPhoneAccountChanged((String) args.arg1,
+                                (PhoneAccountHandle) args.arg2, null /*Session.Info*/);
+                    } finally {
+                        args.recycle();
+                    }
+                    break;
+                }
             }
         }
     };
@@ -581,6 +592,15 @@
                 throws RemoteException {
             mHandler.obtainMessage(MSG_ON_RTT_UPGRADE_REQUEST, connectionId).sendToTarget();
         }
+
+        @Override
+        public void onPhoneAccountChanged(String callId, PhoneAccountHandle pHandle,
+                Session.Info sessionInfo) {
+            SomeArgs args = SomeArgs.obtain();
+            args.arg1 = callId;
+            args.arg2 = pHandle;
+            mHandler.obtainMessage(MSG_SET_PHONE_ACCOUNT_CHANGED, args).sendToTarget();
+        }
     };
 
     public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) {