Adding new BluetoothManager class

Previously, the UI-heavy InCallScreen handled all the bluetooth code.
This code does not add very much logic at all...it's mostly copying from
InCallScreen and whatever Bluetooth code existed in PhoneGlobals.

Changes of note:
- New BluetoothManager class from InCallScreen bluetooth code
- I removed the REQUEST_BLUETOOTH... code from InCallScreen since it was
  there to "update" the UI, which no longer runs.
- Added a Listener to the BluetoothManager for anyone that wants to
  listen in on changes.  This helped remove PhoneGlobals references from
  BluetoothManager code.  Currently PhoneGlobals is the only listener
  (for some proximity sensor-related code) but in the next CL there will
  be an AudioRouter class that will also listen to those changes.
- Previous callers of InCallScreen->whateverBluetooth has been updated
  to use BluetoothManager, or the code was commented because it was
  primarily UI code which is being replaced.

Change-Id: I6f86d16c8bd9cd1da2156c1f3743886f32e84c25
diff --git a/src/com/android/phone/CallNotifier.java b/src/com/android/phone/CallNotifier.java
index 669f9b0..31b0c66 100644
--- a/src/com/android/phone/CallNotifier.java
+++ b/src/com/android/phone/CallNotifier.java
@@ -167,15 +167,19 @@
     // Cached AudioManager
     private AudioManager mAudioManager;
 
+    private final BluetoothManager mBluetoothManager;
+
     /**
      * Initialize the singleton CallNotifier instance.
      * This is only done once, at startup, from PhoneApp.onCreate().
      */
     /* package */ static CallNotifier init(PhoneGlobals app, Phone phone, Ringer ringer,
-            CallLogger callLogger, CallStateMonitor callStateMonitor) {
+            CallLogger callLogger, CallStateMonitor callStateMonitor,
+            BluetoothManager bluetoothManager) {
         synchronized (CallNotifier.class) {
             if (sInstance == null) {
-                sInstance = new CallNotifier(app, phone, ringer, callLogger, callStateMonitor);
+                sInstance = new CallNotifier(app, phone, ringer, callLogger, callStateMonitor,
+                        bluetoothManager);
             } else {
                 Log.wtf(LOG_TAG, "init() called multiple times!  sInstance = " + sInstance);
             }
@@ -185,11 +189,12 @@
 
     /** Private constructor; @see init() */
     private CallNotifier(PhoneGlobals app, Phone phone, Ringer ringer, CallLogger callLogger,
-            CallStateMonitor callStateMonitor) {
+            CallStateMonitor callStateMonitor, BluetoothManager bluetoothManager) {
         mApplication = app;
         mCM = app.mCM;
         mCallLogger = callLogger;
         mCallStateMonitor = callStateMonitor;
+        mBluetoothManager = bluetoothManager;
 
         mAudioManager = (AudioManager) mApplication.getSystemService(Context.AUDIO_SERVICE);
 
@@ -753,7 +758,9 @@
         // There's no need to force a UI update since we update the
         // in-call notification ourselves (below), and the InCallScreen
         // listens for phone state changes itself.
-        mApplication.updateBluetoothIndication(false);
+        // TODO(klp): Have BluetoothManager listen to CallModeler instead of relying on
+        // CallNotifier
+        mBluetoothManager.updateBluetoothIndication();
 
 
         // Update the phone state and other sensor/lock.