From 3a0b56317e5473e81c4891303153f14b616b817e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 29 Jun 2009 18:06:31 +0200 Subject: [PATCH] The global policy also makes no sense and so remove that, too --- doc/manager-api.txt | 12 ---------- src/manager.c | 53 +-------------------------------------------- 2 files changed, 1 insertion(+), 64 deletions(-) diff --git a/doc/manager-api.txt b/doc/manager-api.txt index 7f1924e1..8eb2262e 100644 --- a/doc/manager-api.txt +++ b/doc/manager-api.txt @@ -81,18 +81,6 @@ Properties string State [readonly] the value "connected". This can only be seen if previously no connection was present. - string Policy [readwrite] - - The global connection policy of a system. This - allows to configure how connections are established - and also when they are taken down again. - - Possible values are "single", "multiple" and "ask". - - For the single policy, the priority setting of the - device defines which becomes the default connection - when multiple are available. - boolean OfflineMode [readwrite] The offline mode indicates the global setting for diff --git a/src/manager.c b/src/manager.c index 4a61d49b..a6c60216 100644 --- a/src/manager.c +++ b/src/manager.c @@ -27,44 +27,8 @@ #include "connman.h" -enum connman_policy { - CONNMAN_POLICY_UNKNOWN = 0, - CONNMAN_POLICY_SINGLE = 1, - CONNMAN_POLICY_MULTIPLE = 2, - CONNMAN_POLICY_ASK = 3, -}; - -static enum connman_policy global_policy = CONNMAN_POLICY_SINGLE; static connman_bool_t global_offlinemode = FALSE; -static const char *policy2string(enum connman_policy policy) -{ - switch (policy) { - case CONNMAN_POLICY_UNKNOWN: - break; - case CONNMAN_POLICY_SINGLE: - return "single"; - case CONNMAN_POLICY_MULTIPLE: - return "multiple"; - case CONNMAN_POLICY_ASK: - return "ask"; - } - - return NULL; -} - -static enum connman_policy string2policy(const char *policy) -{ - if (g_str_equal(policy, "single") == TRUE) - return CONNMAN_POLICY_SINGLE; - else if (g_str_equal(policy, "multiple") == TRUE) - return CONNMAN_POLICY_MULTIPLE; - else if (g_str_equal(policy, "ask") == TRUE) - return CONNMAN_POLICY_ASK; - else - return CONNMAN_POLICY_UNKNOWN; -} - static void append_profiles(DBusMessageIter *dict) { DBusMessageIter entry, value, iter; @@ -204,11 +168,6 @@ static DBusMessage *get_properties(DBusConnection *conn, connman_dbus_dict_append_variant(&dict, "State", DBUS_TYPE_STRING, &str); - str = policy2string(global_policy); - if (str != NULL) - connman_dbus_dict_append_variant(&dict, "Policy", - DBUS_TYPE_STRING, &str); - connman_dbus_dict_append_variant(&dict, "OfflineMode", DBUS_TYPE_BOOLEAN, &global_offlinemode); @@ -236,17 +195,7 @@ static DBusMessage *set_property(DBusConnection *conn, CONNMAN_SECURITY_PRIVILEGE_MODIFY) < 0) return __connman_error_permission_denied(msg); - if (g_str_equal(name, "Policy") == TRUE) { - enum connman_policy policy; - const char *str; - - dbus_message_iter_get_basic(&value, &str); - policy = string2policy(str); - if (policy == CONNMAN_POLICY_UNKNOWN) - return __connman_error_invalid_arguments(msg); - - global_policy = policy; - } else if (g_str_equal(name, "OfflineMode") == TRUE) { + if (g_str_equal(name, "OfflineMode") == TRUE) { connman_bool_t offlinemode; dbus_message_iter_get_basic(&value, &offlinemode); -- 2.34.1