Do not include related code if INS is not enabled
[platform/upstream/connman.git] / plugins / iospm.c
old mode 100644 (file)
new mode 100755 (executable)
index af6250b..cded9e0
@@ -2,7 +2,7 @@
  *
  *  Connection Manager
  *
- *  Copyright (C) 2007-2009  Intel Corporation. All rights reserved.
+ *  Copyright (C) 2007-2012  Intel Corporation. All rights reserved.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2 as
 
 static DBusConnection *connection;
 
-static void send_indication(const char *path, connman_bool_t enabled)
+static void send_indication(const char *path, bool enabled)
 {
        DBusMessage *message;
        const char *method;
 
        DBG("path %s enabled %d", path, enabled);
 
-       if (enabled == TRUE)
+       if (enabled)
                method = "IndicateStart";
        else
                method = "IndicateStop";
 
        message = dbus_message_new_method_call(IOSPM_SERVICE, path,
                                                IOSPM_INTERFACE, method);
-       if (message == NULL)
+       if (!message)
                return;
 
        dbus_message_set_no_reply(message, TRUE);
@@ -61,36 +61,35 @@ static void send_indication(const char *path, connman_bool_t enabled)
        dbus_message_unref(message);
 }
 
-static void iospm_device_enabled(enum connman_device_type type,
-                                               connman_bool_t enabled)
+static void iospm_service_enabled(enum connman_service_type type,
+                                               bool enabled)
 {
        switch (type) {
-       case CONNMAN_DEVICE_TYPE_UNKNOWN:
-       case CONNMAN_DEVICE_TYPE_VENDOR:
-       case CONNMAN_DEVICE_TYPE_ETHERNET:
-       case CONNMAN_DEVICE_TYPE_WIFI:
-       case CONNMAN_DEVICE_TYPE_WIMAX:
-       case CONNMAN_DEVICE_TYPE_GPS:
-       case CONNMAN_DEVICE_TYPE_HSO:
-       case CONNMAN_DEVICE_TYPE_NOZOMI:
-       case CONNMAN_DEVICE_TYPE_HUAWEI:
-       case CONNMAN_DEVICE_TYPE_NOVATEL:
+       case CONNMAN_SERVICE_TYPE_UNKNOWN:
+       case CONNMAN_SERVICE_TYPE_SYSTEM:
+       case CONNMAN_SERVICE_TYPE_ETHERNET:
+       case CONNMAN_SERVICE_TYPE_WIFI:
+       case CONNMAN_SERVICE_TYPE_CELLULAR:
+       case CONNMAN_SERVICE_TYPE_GPS:
+       case CONNMAN_SERVICE_TYPE_VPN:
+       case CONNMAN_SERVICE_TYPE_GADGET:
+       case CONNMAN_SERVICE_TYPE_P2P:
                break;
-       case CONNMAN_DEVICE_TYPE_BLUETOOTH:
+       case CONNMAN_SERVICE_TYPE_BLUETOOTH:
                send_indication(IOSPM_BLUETOOTH, enabled);
                break;
        }
 }
 
-static void iospm_offline_mode(connman_bool_t enabled)
+static void iospm_offline_mode(bool enabled)
 {
        send_indication(IOSPM_FLIGHT_MODE, enabled);
 }
 
-static struct connman_notifier iospm_notifier = {
+static const struct connman_notifier iospm_notifier = {
        .name           = "iospm",
        .priority       = CONNMAN_NOTIFIER_PRIORITY_DEFAULT,
-       .device_enabled = iospm_device_enabled,
+       .service_enabled= iospm_service_enabled,
        .offline_mode   = iospm_offline_mode,
 };