[Pkg-maemo-commits] r81 ./osso-gwconnect/debian: * Merge with trunk branch.

Jonny Lamb jonnylamb at jonnylamb.com
Fri Nov 30 11:29:59 UTC 2007


------------------------------------------------------------
revno: 81
committer: Jonny Lamb <jonnylamb at jonnylamb.com>
branch nick: osso-gwconnect
timestamp: Fri 2007-09-21 18:14:47 +0100
message:
  * Merge with trunk branch.
modified:
  configure.ac
  debian/changelog
  debian/rules
  src/btcond-bt.c
  src/btcond-dbus.c
  src/btcond.c
  src/btsdp-bt.c
  src/btsdp-bt.h
  src/btsdp-dbus.c
  src/btsearch-bt.c
  src/btsearch-bt.h
  src/btsearch-dbus.c
  src/dbus-helper.c
  src/dbus-helper.h
  src/state.c
  src/state.h
    ------------------------------------------------------------
    revno: 47.1.2
    committer: jh
    timestamp: Mon 2007-08-13 11:48:40 +0000
    message:
      Get rid of offline mode tracking since the UI will take care of it
    modified:
      configure.ac
      debian/changelog
      debian/rules
      src/btcond-bt.c
      src/btcond-dbus.c
      src/btcond.c
      src/btsdp-bt.c
      src/btsdp-bt.h
      src/btsdp-dbus.c
      src/btsearch-bt.c
      src/btsearch-bt.h
      src/btsearch-dbus.c
      src/dbus-helper.c
      src/dbus-helper.h
      src/state.c
      src/state.h
-------------- next part --------------
=== modified file 'configure.ac'
--- a/configure.ac	2007-06-19 07:54:07 +0000
+++ b/configure.ac	2007-08-13 11:48:40 +0000
@@ -1,4 +1,4 @@
-AC_INIT([osso-gwconnect],[1.0.11])
+AC_INIT([osso-gwconnect],[1.0.12])
 
 AM_CONFIG_HEADER(config.h)
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)

=== modified file 'debian/changelog'
--- a/debian/changelog	2007-07-23 14:49:11 +0000
+++ b/debian/changelog	2007-09-21 17:14:47 +0000
@@ -1,4 +1,4 @@
-osso-gwconnect (1.0.11.debian-1) UNRELEASED; urgency=low
+osso-gwconnect (1.0.12.debian-1) UNRELEASED; urgency=low
 
   [ Loic Minier ]
   * Set Debian Maemo Maintainers as Maintainer; add myself to Uploaders.
@@ -24,6 +24,12 @@
 
  -- Jonny Lamb <jonnylamb at jonnylamb.com>  Mon, 23 Jul 2007 15:48:50 +0100
 
+osso-gwconnect (1.0.12) unstable; urgency=low
+
+  * Remove offline mode stuff (as this is taken care of by the UI) 
+
+ -- Johan Hedberg <johan.hedberg at nokia.com>  Mon, 13 Aug 2007 14:38:16 +0300
+
 osso-gwconnect (1.0.11) unstable; urgency=low
 
   * Delay start of btcond. Fixes: NB#60079 

=== modified file 'debian/rules'
--- a/debian/rules	2007-07-23 14:49:11 +0000
+++ b/debian/rules	2007-09-21 17:14:47 +0000
@@ -6,8 +6,7 @@
 
 confflags += --enable-tracing  \
 	     --enable-ossolog  \
-	     --enable-nokiahci \
-	     --enable-mce
+	     --enable-nokiahci
 
 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
   confflags += --build $(DEB_HOST_GNU_TYPE)

=== modified file 'src/btcond-bt.c'
--- a/src/btcond-bt.c	2007-03-30 12:49:33 +0000
+++ b/src/btcond-bt.c	2007-08-13 11:48:40 +0000
@@ -766,13 +766,6 @@
 
     debug("schedule_capability_update(%s, %s)", bda ? bda : "[def]", svc ? svc : "[all]");
 
-    if (bt_disabled()) {
-        g_set_error(err, BT_COND_ERROR,
-                    BT_COND_ERROR_BT_DISABLED,
-                    "Bluetooth is disabled");
-        return FALSE;
-    }
-
     dev = get_dev(bda);
 
     if (dev == NULL) {
@@ -806,13 +799,6 @@
             auth ? "auth" : "noauth", encr ? "encrypt" : "noencrypt",
             role ? role : "any");
 
-    if (bt_disabled()) {
-        g_set_error(err, BT_COND_ERROR,
-                    BT_COND_ERROR_BT_DISABLED,
-                    "Bluetooth is disabled");
-        return FALSE;
-    }
-
     bd = get_dev(bda);
 
     if (bd == NULL) {

=== modified file 'src/btcond-dbus.c'
--- a/src/btcond-dbus.c	2006-09-26 14:07:11 +0000
+++ b/src/btcond-dbus.c	2007-08-13 11:48:40 +0000
@@ -1045,9 +1045,6 @@
         error("dbus_connection_register_object_path failed");
 
 #ifdef USE_MCE
-    if (!add_mode_listener(connection, mode_change))
-        error("Adding mode listener failed");
-
     if (ignore_special_hw_events())
         return;
 

=== modified file 'src/btcond.c'
--- a/src/btcond.c	2006-05-26 07:49:29 +0000
+++ b/src/btcond.c	2007-08-13 11:48:40 +0000
@@ -210,7 +210,6 @@
 int main(int argc, char *argv[])
 {
     GError *err = NULL;
-    gchar *mode;
     gint i, old_pid;
 
     program_name = argv[0];
@@ -248,17 +247,6 @@
     update_cover_state();
 #endif
 
-    mode = get_device_mode(get_dbus_connection());
-    if (mode != NULL) {
-        mode_change(mode);
-        g_free(mode);
-        mode = NULL;
-    }
-    else {
-        error("Unable to determine actual device mode. Assuming normal mode.");
-        mode_change("normal");
-    }
-
     report("Bluetooth Connection Daemon %s started.", VERSION);
 
     /* Enter main loop */

=== modified file 'src/btsdp-bt.c'
--- a/src/btsdp-bt.c	2006-05-26 07:49:29 +0000
+++ b/src/btsdp-bt.c	2007-08-13 11:48:40 +0000
@@ -245,24 +245,3 @@
     return TRUE;
 }
 
-gboolean bt_ok(void)
-{
-    gboolean ret;
-    gchar *mode;
-
-    mode = get_device_mode(get_dbus_connection());
-    if (mode == NULL) {
-        error("get_device_mode() returned NULL!");
-        /* Assume that BT is usable */
-        return TRUE;
-    }
-
-    if (g_str_equal(mode, "normal"))
-        ret = TRUE;
-    else
-        ret = FALSE;
-
-    g_free(mode);
-
-    return ret;
-}

=== modified file 'src/btsdp-bt.h'
--- a/src/btsdp-bt.h	2006-05-26 07:49:29 +0000
+++ b/src/btsdp-bt.h	2007-08-13 11:48:40 +0000
@@ -45,6 +45,4 @@
 gboolean get_services(const char *bda, GSList *l,
                       sdp_cb_data_t *data, GError **err);
 
-gboolean bt_ok(void);
-
 #endif /* _BTSDP_BT_H_ */

=== modified file 'src/btsdp-dbus.c'
--- a/src/btsdp-dbus.c	2006-05-26 07:49:29 +0000
+++ b/src/btsdp-dbus.c	2007-08-13 11:48:40 +0000
@@ -147,14 +147,6 @@
         return DBUS_HANDLER_RESULT_HANDLED;
     }
 
-    if (!bt_ok()) {
-        reply = new_dbus_error(message, BTSDP_ERROR_BT_DISABLED, NULL);
-        if (!send_and_unref(connection, reply))
-            error("Unable to send bt_disabled error reply");
-        g_main_loop_quit(event_loop);
-        return DBUS_HANDLER_RESULT_HANDLED;
-    }
-
     dbus_message_iter_init(message, &iter);
     /* We can't use get_dbus_iter_args because after the call the iter points on the
      * second argument if the message had two arguments, but on the third argument if 

=== modified file 'src/btsearch-bt.c'
--- a/src/btsearch-bt.c	2006-05-26 07:49:29 +0000
+++ b/src/btsearch-bt.c	2007-08-13 11:48:40 +0000
@@ -30,24 +30,3 @@
 #include "dbus-helper.h"
 #include "btsearch-bt.h"
 
-gboolean bt_ok(void)
-{
-    gboolean ret;
-    gchar *mode;
-
-    mode = get_device_mode(get_dbus_connection());
-    if (mode == NULL) {
-        error("get_device_mode() returned NULL!");
-        /* Assume that BT is usable */
-        return TRUE;
-    }
-
-    if (g_str_equal(mode, "normal"))
-        ret = TRUE;
-    else
-        ret = FALSE;
-
-    g_free(mode);
-
-    return ret;
-}

=== modified file 'src/btsearch-bt.h'
--- a/src/btsearch-bt.h	2006-05-26 07:49:29 +0000
+++ b/src/btsearch-bt.h	2007-08-13 11:48:40 +0000
@@ -22,6 +22,4 @@
 #ifndef _BTSEARCH_BT_H_
 #define _BTSEARCH_BT_H_
 
-gboolean bt_ok(void);
-
 #endif /* _BTSEARCH_BT_H_ */

=== modified file 'src/btsearch-dbus.c'
--- a/src/btsearch-dbus.c	2006-05-26 07:49:29 +0000
+++ b/src/btsearch-dbus.c	2007-08-13 11:48:40 +0000
@@ -83,14 +83,6 @@
 
     remove_exit_timer();
 
-    if (!bt_ok()) {
-        reply = new_dbus_error(message, BTSEARCH_ERROR_BT_DISABLED, NULL);
-        if (!send_and_unref(connection, reply))
-            error("Unable to send bt_disabled error reply");
-        g_main_loop_quit(event_loop);
-        return DBUS_HANDLER_RESULT_HANDLED;
-    }
-
     init_search(sender);
 
     if (dbus_message_get_no_reply(message))

=== modified file 'src/dbus-helper.c'
--- a/src/dbus-helper.c	2006-05-26 07:49:29 +0000
+++ b/src/dbus-helper.c	2007-08-13 11:48:40 +0000
@@ -176,31 +176,6 @@
     return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 }
 
-#ifdef USE_MCE
-static DBusHandlerResult mode_filter(DBusConnection *connection,
-                                     DBusMessage    *message,
-                                     void (*mode_cb)(const gchar *mode))
-{
-    char *mode;
-
-    if (!dbus_message_is_signal(message,
-                                MCE_SIGNAL_IF,
-                                MCE_DEVICE_MODE_SIG))
-        return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-
-    if (!dbus_message_get_args(message, NULL,
-                               DBUS_TYPE_STRING, &mode,
-                               DBUS_TYPE_INVALID)) {
-        error("Invalid arguments for device_mode_ind signal");
-        return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-    }
-
-    mode_cb(mode);
-
-    return DBUS_HANDLER_RESULT_HANDLED;
-}
-#endif
-
 DBusMessage *new_dbus_signal(const char *path,
                              const char *interface,
                              const char *name,
@@ -334,59 +309,6 @@
     return ret;
 }
 
-gchar *get_device_mode(DBusConnection *connection)
-{
-#ifdef USE_MCE
-    DBusError derror;
-    char *mode, *ret;
-    DBusMessage *message, *reply;
-
-    message = new_dbus_method_call(MCE_SERVICE,
-                                   MCE_REQUEST_PATH,
-                                   MCE_REQUEST_IF,
-                                   MCE_DEVICE_MODE_GET);
-
-    dbus_error_init(&derror);
-    reply = dbus_connection_send_with_reply_and_block(connection, message,
-                                                      -1, &derror);
-    dbus_message_unref(message);
-    if (dbus_error_is_set(&derror)) {
-        error("Getting device mode from MCE failed: %s", derror.message);
-        dbus_error_free(&derror);
-        return NULL;
-    }
-
-    if (!dbus_message_get_args(reply, NULL,
-                               DBUS_TYPE_STRING, &mode,
-                               DBUS_TYPE_INVALID)) {
-        error("Invalid arguments for MCE req_device_mode reply");
-        dbus_message_unref(reply);
-        return NULL;
-    }
-
-    ret = g_strdup(mode);
-
-    dbus_message_unref(reply);
-
-    return ret;
-#else /* USE_MCE */
-    return g_strdup("normal");
-#endif
-}
-
-#ifdef USE_MCE
-gboolean add_mode_listener(DBusConnection *connection,
-                           void (*mode_cb)(const gchar *mode))
-{
-
-    dbus_bus_add_match(connection, "interface=" MCE_SIGNAL_IF, NULL);
-    return dbus_connection_add_filter(connection,
-                                      (DBusHandleMessageFunction)mode_filter,
-                                      mode_cb,
-                                      NULL);
-}
-#endif
-
 gboolean add_name_listener(DBusConnection *connection, const char *name,
                            name_cb func, gpointer user_data)
 {

=== modified file 'src/dbus-helper.h'
--- a/src/dbus-helper.h	2006-05-26 07:49:29 +0000
+++ b/src/dbus-helper.h	2007-08-13 11:48:40 +0000
@@ -52,24 +52,6 @@
 
 DBusMessage *new_dbus_error_gerr(DBusMessage *message, GError *err);
 
-/** Get device mode from MCE
- * @param connection D-BUS connection to use
- * @returns device mode (as reported by MCE, should be "flight" or "normal")
- */
-gchar *get_device_mode(DBusConnection *connection);
-
-/** Add a function to be called when device mode changes (reported by a D-BUS
- * signal from MCE)
- * @param connection D-BUS connection to listen for MCE signals on
- * @param mode_cb function to call when the mode changes
- * @returns TRUE on success, FALSE on failure
- */
-#ifdef USE_MCE
-gboolean add_mode_listener(DBusConnection *connection,
-                           void (*mode_cb)(const gchar *mode));
-
-#endif
-
 gboolean add_name_listener(DBusConnection *connection, const char *name,
                            name_cb func, gpointer user_data);
 

=== modified file 'src/state.c'
--- a/src/state.c	2006-12-13 09:14:18 +0000
+++ b/src/state.c	2007-08-13 11:48:40 +0000
@@ -45,10 +45,8 @@
 static GSList *connections = NULL;
 
 static gboolean _bt_down = FALSE;
-static gboolean _flight_mode = FALSE;
-static gboolean _down_before_flight = FALSE;
+#ifdef USE_MCE
 static gboolean _cover_closed = FALSE;
-#ifdef USE_MCE
 static gboolean _inactive = FALSE;
 #endif
 
@@ -72,6 +70,7 @@
     connections = NULL;
 }
 
+#ifdef USE_MCE
 static void disable_bt(void)
 {
     bt_disconnect(NULL, TRUE);
@@ -84,6 +83,7 @@
 {
     hci_bt_up();
 }
+#endif
 
 #if 0
 static void free_info(struct connection_info *info, gpointer user_data)
@@ -193,7 +193,7 @@
 
 ConnStatus connection_status(const gchar *bda)
 {
-    if (_flight_mode)
+    if (_bt_down)
         return CONN_STATUS_DISABLED;
 
     if (get_connection_info(bda))
@@ -213,43 +213,6 @@
     return info->bda;
 }
 
-gboolean bt_disabled(void)
-{
-    if (_flight_mode == TRUE || _cover_closed == TRUE)
-        return TRUE;
-
-    if (_bt_down)
-        enable_bt();
-
-    return FALSE;
-}
-
-void mode_change(const char *mode)
-{
-    if (g_str_equal(mode, "flight")) {
-        /* Ignore flight->flight mode transition */
-        if (_flight_mode)
-            return;
-        _down_before_flight = _bt_down;
-        disable_bt();
-        _flight_mode = TRUE;
-    }
-    else if (g_str_equal(mode, "normal")) {
-        /* Ignore normal->normal mode transition */
-        if (!_flight_mode)
-            return;
-        _flight_mode = FALSE;
-#ifdef USE_MCE
-        if (_cover_closed)
-            return;
-#endif
-        if (!_down_before_flight)
-            enable_bt();
-    }
-    else
-        error("Invalid mode \"%s\" passed to mode_change()", mode);
-}
-
 #ifdef USE_MCE
 # define SYSFS_COVER_FILE "/sys/devices/platform/gpio-switch/prot_shell/cover_switch"
 void update_cover_state()
@@ -266,13 +229,10 @@
 
     if (strncmp(buf, "closed", strlen("closed")) == 0) {
         debug("Cover state: closed");
-        if (!bt_disabled())
-            disable_bt();
+	disable_bt();
         _cover_closed = TRUE;
     } else {
         debug("Cover state: open");
-        if (!_flight_mode)
-            enable_bt();
         _cover_closed = FALSE;
     }
 
@@ -285,15 +245,15 @@
 {
     _inactive = inactive;
 
-    debug("update_inactive_state: inactive=%d, _bt_down=%d, _cover_closed=%d, _flight_mode=%d",
-            inactive, _bt_down, _cover_closed, _flight_mode);
+    debug("update_inactive_state: inactive=%d, _bt_down=%d, _cover_closed=%d",
+            inactive, _bt_down, _cover_closed);
 
     if (inactive) {
         if (!connections)
             disable_bt();
     }
     else {
-        if (_bt_down && !_cover_closed && !_flight_mode)
+        if (_bt_down && !_cover_closed)
             enable_bt();
     }
 }

=== modified file 'src/state.h'
--- a/src/state.h	2006-05-26 07:49:29 +0000
+++ b/src/state.h	2007-08-13 11:48:40 +0000
@@ -28,7 +28,7 @@
 typedef enum {
         CONN_STATUS_CONNECTED,    /**< Active connection to device */
         CONN_STATUS_DISCONNECTED, /**< Device is disconnected */
-        CONN_STATUS_DISABLED      /**< BT disabled (eg. flight mode) */
+        CONN_STATUS_DISABLED      /**< BT disabled */
 } ConnStatus;
 
 /** Query device connection status
@@ -37,16 +37,6 @@
  */
 ConnStatus connection_status(const gchar *bda);
 
-/** Query the device mode
- * @returns TRUE for flight mode, FALSE for normal mode
- */
-gboolean bt_disabled(void);
-
-/** Change mode
- * @param mode Either "flight" or "normal"
- */
-void mode_change(const gchar *mode);
-
 #ifdef USE_MCE
 void update_cover_state(void);
 void update_inactive_state(gboolean inactive);
@@ -60,5 +50,4 @@
 
 gboolean handle_is_connected(uint16_t handle);
 
-
 #endif /* _STATE_H_ */



More information about the Pkg-maemo-commits mailing list