Stop overwriting CALL_WAITING with INCOMING

Code too ambitious about setting INCOMING state caused CALL_WAITING
state to be overwritten.
Also fixed unnecessary setting of DISCONNECT.  In both cases the method
updateCallFromConnection() was already setting the states...and in the
call waiting case...a more accurate state.

bug:10396126
Change-Id: Ib0bb7ab2ed87858c441ef0c1bd38820a1c09baa6
diff --git a/common/src/com/android/services/telephony/common/Call.java b/common/src/com/android/services/telephony/common/Call.java
index f397f62..debad61 100644
--- a/common/src/com/android/services/telephony/common/Call.java
+++ b/common/src/com/android/services/telephony/common/Call.java
@@ -372,7 +372,7 @@
     public String toString() {
         return Objects.toStringHelper(this)
                 .add("mCallId", mCallId)
-                .add("mState", mState)
+                .add("mState", STATE_MAP.get(mState))
                 .add("mDisconnectCause", mDisconnectCause)
                 .add("mCapabilities", mCapabilities)
                 .add("mConnectTime", mConnectTime)
diff --git a/src/com/android/phone/CallModeler.java b/src/com/android/phone/CallModeler.java
index 6b7a137..393e054 100644
--- a/src/com/android/phone/CallModeler.java
+++ b/src/com/android/phone/CallModeler.java
@@ -199,7 +199,6 @@
         final Call call = getCallFromMap(mCallMap, conn, true);
 
         updateCallFromConnection(call, conn, false);
-        call.setState(Call.State.INCOMING);
 
         for (int i = 0; i < mListeners.size(); ++i) {
             if (call != null) {
@@ -217,7 +216,6 @@
             final boolean wasConferenced = call.getState() == State.CONFERENCED;
 
             updateCallFromConnection(call, conn, false);
-            call.setState(Call.State.DISCONNECTED);
 
             for (int i = 0; i < mListeners.size(); ++i) {
                 mListeners.get(i).onDisconnect(call);