]> nv-tegra.nvidia Code Review - android/platform/packages/apps/Phone.git/blobdiff - src/com/android/phone/CallNotifier.java
TODO fixes from Teleca 090527
[android/platform/packages/apps/Phone.git] / src / com / android / phone / CallNotifier.java
index 7bd8fd2e3566551f0de6780fcab72d99d159a1c5..edb00cd91ec2dbc28eceea068894d448e7a8eee0 100644 (file)
@@ -80,9 +80,10 @@ public class CallNotifier extends Handler
     private static final int PHONE_DISCONNECT = 3;
     private static final int PHONE_UNKNOWN_CONNECTION_APPEARED = 4;
     private static final int PHONE_INCOMING_RING = 5;
+    private static final int PHONE_CDMA_CALL_WAITING = 6;
     // Events generated internally:
-    private static final int PHONE_MWI_CHANGED = 6;
-    private static final int PHONE_BATTERY_LOW = 7;
+    private static final int PHONE_MWI_CHANGED = 7;
+    private static final int PHONE_BATTERY_LOW = 8;
 
     private PhoneApp mApplication;
     private Phone mPhone;
@@ -100,6 +101,7 @@ public class CallNotifier extends Handler
         mPhone.registerForDisconnect(this, PHONE_DISCONNECT, null);
         mPhone.registerForUnknownConnection(this, PHONE_UNKNOWN_CONNECTION_APPEARED, null);
         mPhone.registerForIncomingRing(this, PHONE_INCOMING_RING, null);
+        mPhone.registerForCallWaiting(this,PHONE_CDMA_CALL_WAITING, null);
         mRinger = ringer;
         mBluetoothHandsfree = btMgr;
 
@@ -131,7 +133,10 @@ public class CallNotifier extends Handler
                     if (DBG) log("RING before NEW_RING, skipping");
                 }
                 break;
-
+            case PHONE_CDMA_CALL_WAITING:
+                if (DBG) log("CDMA CALL WAITING... ");
+                onCdmaCallwaiting((AsyncResult) msg.obj);
+                break;
             case PHONE_STATE_CHANGED:
                 onPhoneStateChanged((AsyncResult) msg.obj);
                 break;
@@ -186,7 +191,6 @@ public class CallNotifier extends Handler
     private void onNewRingingConnection(AsyncResult r) {
         Connection c = (Connection) r.result;
         if (DBG) log("onNewRingingConnection(): " + c);
-        PhoneApp app = PhoneApp.getInstance();
 
         // Incoming calls are totally ignored if the device isn't provisioned yet
         boolean provisioned = Settings.Secure.getInt(mPhone.getContext().getContentResolver(),
@@ -258,6 +262,10 @@ public class CallNotifier extends Handler
         if (VDBG) log("- onNewRingingConnection() done.");
     }
 
+    private void onCdmaCallwaiting(AsyncResult r) {
+       return;
+    }
+
     /**
      * Helper method to manage the start of incoming call queries
      */
@@ -431,6 +439,23 @@ public class CallNotifier extends Handler
         }
     }
 
+    void updateCallNotifierRegistrationsAfterRadioTechnologyChange() {
+        if(DBG) Log.d(LOG_TAG, "updateCallNotifierRegistrationsAfterRadioTechnologyChange...");
+        //Unregister all events from the old obsolete phone
+        mPhone.unregisterForNewRingingConnection(this);
+        mPhone.unregisterForPhoneStateChanged(this);
+        mPhone.unregisterForDisconnect(this);
+        mPhone.unregisterForUnknownConnection(this);
+        mPhone.unregisterForIncomingRing(this);
+
+        //Register all events new to the new active phone
+        mPhone.registerForNewRingingConnection(this, PHONE_NEW_RINGING_CONNECTION, null);
+        mPhone.registerForPhoneStateChanged(this, PHONE_STATE_CHANGED, null);
+        mPhone.registerForDisconnect(this, PHONE_DISCONNECT, null);
+        mPhone.registerForUnknownConnection(this, PHONE_UNKNOWN_CONNECTION_APPEARED, null);
+        mPhone.registerForIncomingRing(this, PHONE_INCOMING_RING, null);
+    }
+
     /**
      * Implemented for CallerInfoAsyncQuery.OnQueryCompleteListener interface.
      * refreshes the CallCard data when it called.  If called with this
@@ -601,7 +626,7 @@ public class CallNotifier extends Handler
                 // the user deliberately rejected.)
 
                 PhoneUtils.CallerInfoToken info =
-                    PhoneUtils.startGetCallerInfo(mApplication, c, this, new Long(date));
+                        PhoneUtils.startGetCallerInfo(mApplication, c, this, Long.valueOf(date));
                 if (info != null) {
                     // at this point, we've requested to start a query, but it makes no
                     // sense to log this missed call until the query comes back.