call-barring: Check if ussd is busy
authorYang Gu <yang.gu@intel.com>
Mon, 6 Sep 2010 02:19:55 +0000 (10:19 +0800)
committerDenis Kenzior <denkenz@gmail.com>
Thu, 9 Sep 2010 14:01:28 +0000 (09:01 -0500)
src/call-barring.c

index 7607f3f..a8bb3bd 100644 (file)
@@ -669,7 +669,7 @@ static DBusMessage *cb_get_properties(DBusConnection *conn, DBusMessage *msg,
 {
        struct ofono_call_barring *cb = data;
 
-       if (cb->pending)
+       if (cb->pending || __ofono_ussd_is_busy(cb->ussd))
                return __ofono_error_busy(msg);
 
        if (!cb->driver->query)
@@ -822,7 +822,7 @@ static DBusMessage *cb_set_property(DBusConnection *conn, DBusMessage *msg,
        int cls;
        int mode;
 
-       if (cb->pending)
+       if (cb->pending || __ofono_ussd_is_busy(cb->ussd))
                return __ofono_error_busy(msg);
 
        if (!dbus_message_iter_init(msg, &iter))
@@ -894,7 +894,7 @@ static DBusMessage *cb_disable_all(DBusConnection *conn, DBusMessage *msg,
        if (!cb->driver->set)
                return __ofono_error_not_implemented(msg);
 
-       if (cb->pending)
+       if (cb->pending || __ofono_ussd_is_busy(cb->ussd))
                return __ofono_error_busy(msg);
 
        if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &passwd,
@@ -941,7 +941,7 @@ static DBusMessage *cb_set_passwd(DBusConnection *conn, DBusMessage *msg,
        if (!cb->driver->set_passwd)
                return __ofono_error_not_implemented(msg);
 
-       if (cb->pending)
+       if (cb->pending || __ofono_ussd_is_busy(cb->ussd))
                return __ofono_error_busy(msg);
 
        if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &old_passwd,