new class AudioRouter manages audio routing for the phone call

This CL only has support between bluetooth/earpiece

Of Note:
- New shared class AudioMode defines different modes for audio routing
- New class AudioRouter manages between EARPIECE and Bluetooth modes.
- Add function in CallCommandService and CallHandlerService for audio
  mode

Change-Id: I52ff70e53868c45e5202b757cc80a13af3abe5f8
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index 9db596b..914db15 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -169,6 +169,7 @@
     Phone phone;
     PhoneInterfaceManager phoneMgr;
 
+    private AudioRouter audioRouter;
     private BluetoothManager bluetoothManager;
     private CallCommandService callCommandService;
     private CallHandlerServiceProxy callHandlerServiceProxy;
@@ -550,8 +551,12 @@
             // Plays DTMF Tones
             dtmfTonePlayer = new DTMFTonePlayer(mCM, callModeler);
 
+            // Audio router
+            audioRouter = new AudioRouter(this, bluetoothManager);
+
             // Service used by in-call UI to control calls
-            callCommandService = new CallCommandService(this, mCM, callModeler, dtmfTonePlayer);
+            callCommandService = new CallCommandService(this, mCM, callModeler, dtmfTonePlayer,
+                    audioRouter);
 
             // Sends call state to the UI
             callHandlerServiceProxy = new CallHandlerServiceProxy(this, callModeler,