Fixing Google Voice to work with new incallui

We were not previously storing and sending the gateway information to
the UI.  This change consolidates Call gateway functionality from
InCallUiState and PhoneUtils into a new class CallGatewayManager.  It is
responsible for storing a mapping from the call's connection to the
gateway used to make that connection.  It also adds gateway packagename
and number to the Call object sent to the UI so that it can show UI
appropriately.

bug: 10393622
Change-Id: Ic5a0b068475bcab60e8cc96470273e36005ccc2e
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index 9ed0470..165ae67 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -171,6 +171,7 @@
     private AudioRouter audioRouter;
     private BluetoothManager bluetoothManager;
     private CallCommandService callCommandService;
+    private CallGatewayManager callGatewayManager;
     private CallHandlerServiceProxy callHandlerServiceProxy;
     private CallModeler callModeler;
     private CallStateMonitor callStateMonitor;
@@ -474,10 +475,13 @@
 
             CallLogger callLogger = new CallLogger(this, new CallLogAsync());
 
+            callGatewayManager = new CallGatewayManager();
+
             // Create the CallController singleton, which is the interface
             // to the telephony layer for user-initiated telephony functionality
             // (like making outgoing calls.)
-            callController = CallController.init(this, callLogger);
+            callController = CallController.init(this, callLogger, callGatewayManager);
+
             // ...and also the InCallUiState instance, used by the CallController to
             // keep track of some "persistent state" of the in-call UI.
             inCallUiState = InCallUiState.init(this);
@@ -495,7 +499,8 @@
             rejectWithTextMessageManager = new RejectWithTextMessageManager();
 
             // Creates call models for use with CallHandlerService.
-            callModeler = new CallModeler(callStateMonitor, mCM, rejectWithTextMessageManager);
+            callModeler = new CallModeler(callStateMonitor, mCM, rejectWithTextMessageManager,
+                    callGatewayManager);
 
             // Plays DTMF Tones
             dtmfTonePlayer = new DTMFTonePlayer(mCM, callModeler);