Prevent preciseCallStateChanged from firing for media capabilities change.
Tyler Gunn [Mon, 20 Jul 2015 20:49:53 +0000 (13:49 -0700)]
In processCallStateChanged, there was the potential for
"notifyPreciseCallStateChanged()" to be called, even if ignoreState was
true.  Moved the code for invoking the precise call state changed
callback into the "else" clause of the conditional.

Bug: 22564433
Change-Id: Ib2a05bd5f592005d57623812c6cd40c2bfcbf253

src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java

index cc45639..c152fcc 100644 (file)
@@ -940,15 +940,16 @@ public final class ImsPhoneCallTracker extends CallTracker {
         // State updates will be triggered through individual callbacks
         // i.e. onCallHeld, onCallResume, etc and conn.update will be responsible for the update
         if (ignoreState) {
-            changed = conn.updateMediaCapabilities(imsCall);
-        } else {
-            changed = conn.update(imsCall, state);
-            if (state == ImsPhoneCall.State.DISCONNECTED) {
-                changed = conn.onDisconnect(cause) || changed;
-                //detach the disconnected connections
-                conn.getCall().detach(conn);
-                removeConnection(conn);
-            }
+            conn.updateMediaCapabilities(imsCall);
+            return;
+        }
+
+        changed = conn.update(imsCall, state);
+        if (state == ImsPhoneCall.State.DISCONNECTED) {
+            changed = conn.onDisconnect(cause) || changed;
+            //detach the disconnected connections
+            conn.getCall().detach(conn);
+            removeConnection(conn);
         }
 
         if (changed) {