[PATCH v2 9/9] manager: Setting SessionMode must not disconnect all services

patrik.flykt at linux.intel.com patrik.flykt at linux.intel.com
Fri Nov 2 06:16:04 PDT 2012


From: Patrik Flykt <patrik.flykt at linux.intel.com>

Change SessionMode property handling so that the value is changed but
the operation does not disconnect all services.
---
 src/manager.c |   24 ------------------------
 src/session.c |    3 ---
 2 files changed, 27 deletions(-)

diff --git a/src/manager.c b/src/manager.c
index d4f8c3d..f45a555 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -110,16 +110,8 @@ static DBusMessage *set_property(DBusConnection *conn,
 
 		dbus_message_iter_get_basic(&value, &sessionmode);
 
-		if (session_mode_pending != NULL)
-			return __connman_error_in_progress(msg);
-
 		__connman_session_set_mode(sessionmode);
 
-		if (sessionmode == TRUE && connman_state_idle == FALSE) {
-			session_mode_pending = dbus_message_ref(msg);
-			return NULL;
-		}
-
 	} else
 		return __connman_error_invalid_property(msg);
 
@@ -168,28 +160,12 @@ static DBusMessage *remove_provider(DBusConnection *conn,
 
 static DBusConnection *connection = NULL;
 
-static void session_mode_notify(void)
-{
-	DBusMessage *reply;
-
-	reply = g_dbus_create_reply(session_mode_pending, DBUS_TYPE_INVALID);
-	g_dbus_send_message(connection, reply);
-
-	dbus_message_unref(session_mode_pending);
-	session_mode_pending = NULL;
-}
-
 static void idle_state(connman_bool_t idle)
 {
 
 	DBG("idle %d", idle);
 
 	connman_state_idle = idle;
-
-	if (connman_state_idle == FALSE || session_mode_pending == NULL)
-		return;
-
-	session_mode_notify();
 }
 
 static struct connman_notifier technology_notifier = {
diff --git a/src/session.c b/src/session.c
index 4601407..e66f222 100644
--- a/src/session.c
+++ b/src/session.c
@@ -1823,9 +1823,6 @@ void __connman_session_set_mode(connman_bool_t enable)
 				CONNMAN_MANAGER_INTERFACE, "SessionMode",
 				DBUS_TYPE_BOOLEAN, &sessionmode);
 	}
-
-	if (sessionmode == TRUE)
-		__connman_service_disconnect_all();
 }
 
 static void service_add(struct connman_service *service,
-- 
1.7.10.4




More information about the connman mailing list