Cdma call waiting

There are special notifications received for call waiting on CDMA
phones.  These special notifications are handled by CallNotifier
which has special logic to handle the fact that CDMA devices do not
give us an indication of success/failure on operations to the CDMA call
waiting calls.

This fix adds functions to CallModeler that are called directly from
CallNotifier. These functions translate the events into Call objects
that it can send to the UI layer.

bug:10769004
Change-Id: Ic208ddb879c7ec76212914914b8750b55a578ac0
diff --git a/src/com/android/phone/CallNotifier.java b/src/com/android/phone/CallNotifier.java
index de5052f..64a77f3 100644
--- a/src/com/android/phone/CallNotifier.java
+++ b/src/com/android/phone/CallNotifier.java
@@ -141,6 +141,7 @@
     private Ringer mRinger;
     private BluetoothHeadset mBluetoothHeadset;
     private CallLogger mCallLogger;
+    private CallModeler mCallModeler;
     private boolean mSilentRingerRequested;
 
     // ToneGenerator instance for playing SignalInfo tones
@@ -175,11 +176,11 @@
      */
     /* package */ static CallNotifier init(PhoneGlobals app, Phone phone, Ringer ringer,
             CallLogger callLogger, CallStateMonitor callStateMonitor,
-            BluetoothManager bluetoothManager) {
+            BluetoothManager bluetoothManager, CallModeler callModeler) {
         synchronized (CallNotifier.class) {
             if (sInstance == null) {
                 sInstance = new CallNotifier(app, phone, ringer, callLogger, callStateMonitor,
-                        bluetoothManager);
+                        bluetoothManager, callModeler);
             } else {
                 Log.wtf(LOG_TAG, "init() called multiple times!  sInstance = " + sInstance);
             }
@@ -189,12 +190,14 @@
 
     /** Private constructor; @see init() */
     private CallNotifier(PhoneGlobals app, Phone phone, Ringer ringer, CallLogger callLogger,
-            CallStateMonitor callStateMonitor, BluetoothManager bluetoothManager) {
+            CallStateMonitor callStateMonitor, BluetoothManager bluetoothManager,
+            CallModeler callModeler) {
         mApplication = app;
         mCM = app.mCM;
         mCallLogger = callLogger;
         mCallStateMonitor = callStateMonitor;
         mBluetoothManager = bluetoothManager;
+        mCallModeler = callModeler;
 
         mAudioManager = (AudioManager) mApplication.getSystemService(Context.AUDIO_SERVICE);
 
@@ -1680,6 +1683,8 @@
             //Create the SignalInfo tone player and pass the ToneID
             new SignalInfoTonePlayer(toneID).start();
         }
+
+        mCallModeler.onCdmaCallWaiting(infoCW);
     }
 
     /**
@@ -1733,6 +1738,10 @@
             //Reset the mCallWaitingTimeOut boolean
             mCallWaitingTimeOut = false;
         }
+
+        // Call modeler needs to know about this event regardless of the
+        // state conditionals in the previous code.
+        mCallModeler.onCdmaCallWaitingReject();
     }
 
     /**