Update TeleService callback and reduce update frequency.

1. Changed name of the initial callback on the binder interface.
2. Made it so that we dont issue updates for Incoming and Disconnected
calls. Incoming calls dont change until their state changes and
disconnected calls dont change at all. What was happening is that the
redundant calls to onUpdate were executing before onDisconnect and
onIncoming effectively changing the state of the call before the
functions that were meant to change them to those states.
Additionally, with disconnected calls, we start tearing down the system
once the last call ends, which would happen twice: one with onUpdate and
once with onDisconnect.  This caused additional binder activity after we
already started tearing things down.

bug:10682538
Change-Id: I47161c12429455f5f4fbca9113e6b06438028eb1
diff --git a/src/com/android/phone/CallModeler.java b/src/com/android/phone/CallModeler.java
index 8848f73..79e77f6 100644
--- a/src/com/android/phone/CallModeler.java
+++ b/src/com/android/phone/CallModeler.java
@@ -301,18 +301,18 @@
         for (com.android.internal.telephony.Call telephonyCall : telephonyCalls) {
 
             for (Connection connection : telephonyCall.getConnections()) {
-                // We do not create incoming or disconnected calls on update.  Those are created
-                // from the associated onNewRingingConnection and onDisconnected which do this
-                // process on their own and slightly differently.
-                boolean create = connection.getState().isAlive() &&
+                // We only send updates for live calls which are not incoming (ringing).
+                // Disconnected and incoming calls are handled by onDisconnect and
+                // onNewRingingConnection.
+                boolean shouldUpdate = connection.getState().isAlive() &&
                         !connection.getState().isRinging();
 
                 // New connections return a Call with INVALID state, which does not translate to
                 // a state in the internal.telephony.Call object.  This ensures that staleness
                 // check below fails and we always add the item to the update list if it is new.
-                final Call call = getCallFromMap(mCallMap, connection, create);
+                final Call call = getCallFromMap(mCallMap, connection, shouldUpdate /* create */);
 
-                if (call == null) {
+                if (call == null || !shouldUpdate) {
                     continue;
                 }