From: Marcel Holtmann Date: Tue, 20 Jan 2009 16:44:01 +0000 (+0100) Subject: Rename FlightMode to OfflineMode X-Git-Tag: 2.0_alpha~4061 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31200365b3a59e89ee6d2d00b01b6cec33075688;p=framework%2Fconnectivity%2Fconnman.git Rename FlightMode to OfflineMode --- diff --git a/doc/manager-api.txt b/doc/manager-api.txt index bf3d1de..5ff5f6a 100644 --- a/doc/manager-api.txt +++ b/doc/manager-api.txt @@ -57,15 +57,15 @@ Properties string State [readonly] device defines which becomes the default connection when multiple are available. - boolean FlightMode [readwrite] + boolean OfflineMode [readwrite] - The flight mode indicates the global setting for - switching all radios on or off. Changing flight mode + The offline mode indicates the global setting for + switching all radios on or off. Changing offline mode to true results in powering down all devices. When - leaving flight mode the individual policy of each + leaving offline mode the individual policy of each device decides to switch the radio back on or not. - During flight mode, it is still possible to switch + During offline mode, it is still possible to switch certain technologies manually back on. For example the limited usage of WiFi or Bluetooth devices might be allowed in some situations. diff --git a/src/connman.h b/src/connman.h index 545183e..b944465 100644 --- a/src/connman.h +++ b/src/connman.h @@ -163,7 +163,7 @@ void __connman_device_decrease_connections(struct connman_device *device); connman_bool_t __connman_device_has_driver(struct connman_device *device); -int __connman_device_set_flightmode(connman_bool_t flightmode); +int __connman_device_set_offlinemode(connman_bool_t offlinemode); #include diff --git a/src/device.c b/src/device.c index d107bf4..f9c153d 100644 --- a/src/device.c +++ b/src/device.c @@ -1159,10 +1159,10 @@ const char *connman_device_get_string(struct connman_device *device, return NULL; } -static void set_flightmode(struct connman_element *element, gpointer user_data) +static void set_offlinemode(struct connman_element *element, gpointer user_data) { struct connman_device *device = element->device; - connman_bool_t flightmode = GPOINTER_TO_UINT(user_data); + connman_bool_t offlinemode = GPOINTER_TO_UINT(user_data); connman_bool_t powered; DBG("element %p name %s", element, element->name); @@ -1170,7 +1170,7 @@ static void set_flightmode(struct connman_element *element, gpointer user_data) if (device == NULL) return; - powered = (flightmode == TRUE) ? FALSE : TRUE; + powered = (offlinemode == TRUE) ? FALSE : TRUE; if (device->powered == powered) return; @@ -1178,12 +1178,12 @@ static void set_flightmode(struct connman_element *element, gpointer user_data) set_powered(device, powered); } -int __connman_device_set_flightmode(connman_bool_t flightmode) +int __connman_device_set_offlinemode(connman_bool_t offlinemode) { - DBG("flightmode %d", flightmode); + DBG("offlinmode %d", offlinemode); __connman_element_foreach(NULL, CONNMAN_ELEMENT_TYPE_DEVICE, - set_flightmode, GUINT_TO_POINTER(flightmode)); + set_offlinemode, GUINT_TO_POINTER(offlinemode)); return 0; } diff --git a/src/manager.c b/src/manager.c index f943720..a2f1be8 100644 --- a/src/manager.c +++ b/src/manager.c @@ -35,7 +35,7 @@ enum connman_policy { }; static enum connman_policy global_policy = CONNMAN_POLICY_SINGLE; -static connman_bool_t global_flightmode = FALSE; +static connman_bool_t global_offlinemode = FALSE; static const char *policy2string(enum connman_policy policy) { @@ -185,8 +185,8 @@ static DBusMessage *get_properties(DBusConnection *conn, connman_dbus_dict_append_variant(&dict, "Policy", DBUS_TYPE_STRING, &str); - connman_dbus_dict_append_variant(&dict, "FlightMode", - DBUS_TYPE_BOOLEAN, &global_flightmode); + connman_dbus_dict_append_variant(&dict, "OfflineMode", + DBUS_TYPE_BOOLEAN, &global_offlinemode); dbus_message_iter_close_container(&array, &dict); @@ -222,17 +222,17 @@ static DBusMessage *set_property(DBusConnection *conn, return __connman_error_invalid_arguments(msg); global_policy = policy; - } else if (g_str_equal(name, "FlightMode") == TRUE) { - connman_bool_t flightmode; + } else if (g_str_equal(name, "OfflineMode") == TRUE) { + connman_bool_t offlinemode; - dbus_message_iter_get_basic(&value, &flightmode); + dbus_message_iter_get_basic(&value, &offlinemode); - if (global_flightmode == flightmode) + if (global_offlinemode == offlinemode) return __connman_error_invalid_arguments(msg); - global_flightmode = flightmode; + global_offlinemode = offlinemode; - __connman_device_set_flightmode(flightmode); + __connman_device_set_offlinemode(offlinemode); } return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); diff --git a/test/test-manager b/test/test-manager index e9f1231..7915eaf 100755 --- a/test/test-manager +++ b/test/test-manager @@ -54,7 +54,7 @@ def print_properties(key, value): for key in properties.keys(): if key in ["Profiles", "Devices", "Connections"]: print_properties(key, properties[key]) - elif key in ["FlightMode"]: + elif key in ["OfflineMode"]: print "%s" % (key) if properties[key] == dbus.Boolean(1): print " true"