voicecall: Don't set indicators during transitions
authorDenis Kenzior <denkenz@gmail.com>
Tue, 6 Mar 2012 15:24:54 +0000 (09:24 -0600)
committerDenis Kenzior <denkenz@gmail.com>
Wed, 7 Mar 2012 12:17:06 +0000 (06:17 -0600)
src/voicecall.c

index e224d3a..c128227 100644 (file)
@@ -825,6 +825,19 @@ static void notify_emulator_call_status(struct ofono_voicecall *vc)
                }
        }
 
+       /*
+        * Perform some basic sanity checks for transitionary states;
+        * if a transitionary state is detected, then ignore it.  The call
+        * indicators will be updated properly in the follow-on calls to
+        * this function once the final state has been reached
+        */
+
+       if (incoming && (held || call))
+               return;
+
+       if (waiting && (held == FALSE && call == FALSE))
+               return;
+
        data.status = call || held ? OFONO_EMULATOR_CALL_ACTIVE :
                                        OFONO_EMULATOR_CALL_INACTIVE;