[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, debian, updated. debian/0.9.5.9+git20110512-1-44-g2b0bd1a

Felix Huber felix.huber at schyf.de
Tue May 15 11:58:58 UTC 2012


The following commit has been merged in the debian branch:
commit 1a7e3b2662b031ab881021f8027cba9e12afc382
Author: Felix Huber <felix.huber at schyf.de>
Date:   Wed Jan 4 23:20:46 2012 +0100

    fix #2305: GSM connection hangs up when during a call a second is not answered

diff --git a/etc/freesmartphone/oevents/rules.yaml b/etc/freesmartphone/oevents/rules.yaml
index 65d0644..695f5ff 100644
--- a/etc/freesmartphone/oevents/rules.yaml
+++ b/etc/freesmartphone/oevents/rules.yaml
@@ -57,21 +57,32 @@
     actions:
              - SetDisplayBrightness("0", 90)
 -
+    # fix Bug #2305                                                           
+    # we must keep the scenario and COU as long as there is a call left, not when     
+    # any call indicates release                                                
+    # IMPORTANT
+    # For this to work, the filter function in fso_triggers.py needs a patch,
+    # because the evaluation is from outside to inside.
+    # Note to the "vala reimplementors":
+    # The filter parser should be in such a
+    # way that the inner terms get called first, because the current implementation
+    # slows down excecution by repeatedly calling already evaluated and even empty functions
     while: CallStatus()
-    filters: Not(HasAttr(status, "release"))
+    filters:
+            - Or(CallListContains("outgoing"), CallListContains("active"))
     actions:
             - OccupyResource(CPU)
 -
     while: CallStatus()
     filters:
-            - Or(HasAttr(status, "outgoing"), HasAttr(status, "active"))
+            - Or(CallListContains("outgoing"), CallListContains("active"))
             - Not(BTHeadsetIsConnected())
     actions:
             - SetScenario(gsmhandset)
 -
     while: CallStatus()
     filters:
-            - Or(HasAttr(status, "outgoing"), HasAttr(status, "active"))
+            - Or(CallListContains("outgoing"), CallListContains("active"))
             - BTHeadsetIsConnected()
     actions:
             - SetScenario(gsmbluetooth)
diff --git a/framework/subsystems/oeventsd/action.py b/framework/subsystems/oeventsd/action.py
index b5eafd4..30a40dc 100644
--- a/framework/subsystems/oeventsd/action.py
+++ b/framework/subsystems/oeventsd/action.py
@@ -37,13 +37,18 @@ class Action(AutoFunction):
     #
     # public
     #
+    # Fixme: the outside to inside evaluation unnecessarily
+    # calls theese, consuming only time
     def __init__( self ):
         AutoFunction.__init__( self )
+        logger.debug("UnamedAction : init")
 
     def trigger( self, **kwargs ):
+        logger.debug("UnamedAction : trigger")
         pass
 
     def untrigger( self, **kwargs ):
+        logger.debug("UnamedAction : untrigger")
         pass
 
     def __repr__( self ):
diff --git a/framework/subsystems/oeventsd/filter.py b/framework/subsystems/oeventsd/filter.py
index a0fa026..c3d16a5 100644
--- a/framework/subsystems/oeventsd/filter.py
+++ b/framework/subsystems/oeventsd/filter.py
@@ -36,6 +36,7 @@ class Filter( object ):
 
     def filter( self, **kargs ):
         # The default filter is always True
+        # Fixme: unnecessary and time consuming call due to outside to inside evaluations
         return True
 
     def __invert__( self ):
@@ -65,6 +66,9 @@ class Filter( object ):
         """disable the filter"""
         pass
 
+    def __repr__( self ):
+        return "base filter"
+
 #============================================================================#
 class AttributeFilter( Filter ):
 #============================================================================#
diff --git a/framework/subsystems/oeventsd/fso_triggers.py b/framework/subsystems/oeventsd/fso_triggers.py
index 4274ac5..5afd195 100644
--- a/framework/subsystems/oeventsd/fso_triggers.py
+++ b/framework/subsystems/oeventsd/fso_triggers.py
@@ -36,6 +36,7 @@ class CallStatusTrigger(DBusTrigger):
             'org.freesmartphone.GSM.Call',
             'CallStatus'
         )
+
     def on_signal(self, id, status, properties):
         logger.info("Receive CallStatus, status = %s", status)
         self._trigger(id=id, status=status, properties=properties)
@@ -63,6 +64,16 @@ class CallListContains(WhileRule):
         else:
             super(CallListContains, self).untrigger()
 
+    # needed to fix Bug #2305                                                          
+    # The filter functions need a patch, because they evaluate 
+    # from outside to inside, that would not corerctly evaluate terms like
+    # Or(CallListContains("outgoing"), CallListContains("active"))
+    # because the CallListContains status gets updates after Or was called
+    def filter( self, id=None, status=None, properties=None, **kargs ):
+        """The filter is True if the rule is triggered"""                                                
+        self.trigger(id, status, properties, **kargs)
+        return self.triggered                                                                            
+
     def __repr__(self):
         return "CallListContains(%s)" % self.status
 
diff --git a/framework/subsystems/oeventsd/rule.py b/framework/subsystems/oeventsd/rule.py
index ed5be6f..4ecf033 100644
--- a/framework/subsystems/oeventsd/rule.py
+++ b/framework/subsystems/oeventsd/rule.py
@@ -104,7 +104,7 @@ class WhileRule( Rule, Filter ):
 
     def untrigger( self, **kargs ):
         if not self.triggered:
-            logger.warning( "Untrigger for '%s' called, but not yet triggered. Not untriggering", self )
+            #being untriggerd while not triggered is not an error
             return
         self._untrigger( **kargs )
         self.triggered = False

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list