call-forwarding: Update conditional setting logic
authorOleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Mon, 6 Feb 2012 12:33:56 +0000 (14:33 +0200)
committerDenis Kenzior <denkenz@gmail.com>
Wed, 22 Feb 2012 10:29:16 +0000 (04:29 -0600)
Due to how the quiescent behavior of conditional call forwarding rules
when CFU is active, do not allow the user to try and set conditional
rules.  This will fail at the network level anyway.

src/call-forwarding.c

index 8b8d5a8..7d9b533 100644 (file)
@@ -802,6 +802,13 @@ static DBusMessage *cf_set_property(DBusConnection *conn, DBusMessage *msg,
                if (strlen(number) > 0 && !valid_phone_number_format(number))
                        return __ofono_error_invalid_format(msg);
 
+               /*
+                * Don't set conditional cfs when cfu is active
+                */
+               if (type != CALL_FORWARDING_TYPE_UNCONDITIONAL &&
+                               number[0] != '\0' && is_cfu_enabled(cf))
+                       return __ofono_error_not_available(msg);
+
                if (number[0] != '\0')
                        string_to_phone_number(number, &ph);