[maemo-commits] [maemo-commits] r18633 - in projects/haf/trunk/ke-recv-extra: . debian src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Jun 5 17:53:08 EEST 2009
Author: kihamala
Date: 2009-06-05 17:53:07 +0300 (Fri, 05 Jun 2009)
New Revision: 18633

Modified:
   projects/haf/trunk/ke-recv-extra/Makefile.in
   projects/haf/trunk/ke-recv-extra/debian/changelog
   projects/haf/trunk/ke-recv-extra/debian/rules
   projects/haf/trunk/ke-recv-extra/src/Makefile.in
   projects/haf/trunk/ke-recv-extra/src/hulda.c
   projects/haf/trunk/ke-recv-extra/src/kdbus.c
Log:
commit some fixes


Modified: projects/haf/trunk/ke-recv-extra/Makefile.in
===================================================================
--- projects/haf/trunk/ke-recv-extra/Makefile.in	2009-06-05 14:37:46 UTC (rev 18632)
+++ projects/haf/trunk/ke-recv-extra/Makefile.in	2009-06-05 14:53:07 UTC (rev 18633)
@@ -76,7 +76,6 @@
 STRIP = @STRIP@
 VERSION = @VERSION@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_STRIP = @ac_ct_STRIP@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__include = @am__include@
@@ -85,18 +84,25 @@
 bindir = @bindir@
 build_alias = @build_alias@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host_alias = @host_alias@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@

Modified: projects/haf/trunk/ke-recv-extra/debian/changelog
===================================================================
--- projects/haf/trunk/ke-recv-extra/debian/changelog	2009-06-05 14:37:46 UTC (rev 18632)
+++ projects/haf/trunk/ke-recv-extra/debian/changelog	2009-06-05 14:53:07 UTC (rev 18633)
@@ -1,6 +1,14 @@
 ke-recv-extra (0.6-1~unreleased) unstable; urgency=low
 
   * Remove a bunch of auto-generated files from SVN.
+  * Disable OTG error tracking.
+  * Disable input device tracking.
+  * Fixes: NB#120150 - Entering text with virtual keyboard does not work when
+    wired headphones (model HS-48) are connected
+  * Remove some unneeded logging.
+  * Remove unsafe function calls from signal handlers.
+  * Add polling of /proc/mounts to detect read-only memory card mounting and
+    show infonote about r-o mounting if it happens, related to NB#114795.
 
  -- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>  Fri,  5 Jun 2009 14:33:33 +0300
 

Modified: projects/haf/trunk/ke-recv-extra/debian/rules
===================================================================
--- projects/haf/trunk/ke-recv-extra/debian/rules	2009-06-05 14:37:46 UTC (rev 18632)
+++ projects/haf/trunk/ke-recv-extra/debian/rules	2009-06-05 14:53:07 UTC (rev 18633)
@@ -48,7 +48,6 @@
 	# Add here commands to configure the package.
 	CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
 
-
 build: build-stamp
 
 build-stamp:  config.status

Modified: projects/haf/trunk/ke-recv-extra/src/Makefile.in
===================================================================
--- projects/haf/trunk/ke-recv-extra/src/Makefile.in	2009-06-05 14:37:46 UTC (rev 18632)
+++ projects/haf/trunk/ke-recv-extra/src/Makefile.in	2009-06-05 14:53:07 UTC (rev 18633)
@@ -76,7 +76,6 @@
 STRIP = @STRIP@
 VERSION = @VERSION@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_STRIP = @ac_ct_STRIP@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__include = @am__include@
@@ -85,18 +84,25 @@
 bindir = @bindir@
 build_alias = @build_alias@
 datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host_alias = @host_alias@
+htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
+psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@

Modified: projects/haf/trunk/ke-recv-extra/src/hulda.c
===================================================================
--- projects/haf/trunk/ke-recv-extra/src/hulda.c	2009-06-05 14:37:46 UTC (rev 18632)
+++ projects/haf/trunk/ke-recv-extra/src/hulda.c	2009-06-05 14:53:07 UTC (rev 18633)
@@ -41,7 +41,7 @@
 static DBusMessage* the_message = NULL;
 
 void send_error(const char* s);
-static void show_infoprint(const char *text);
+void show_infonote(const char *text);
 
 /* strcmp() with checks for NULL pointers */
 static int strcmp2(const char* s1, const char* s2)
@@ -85,7 +85,9 @@
                 handle_event(E_BGKILL_OFF_SIGNAL);
             }
         }
-    } else if (strcmp2(path, "/sys/devices/platform/musb_hdrc/usb1/otg_last_error") == 0) {
+    }
+#if 0
+    else if (strcmp2(path, "/sys/devices/platform/musb_hdrc/usb1/otg_last_error") == 0) {
         if (strncmp(value, "OTG01", 5) == 0) {
             show_infoprint(gettext("stab_me_usb_otg_not_supported"));
         } else if (strncmp(value, "OTG02", 5) == 0) {
@@ -96,6 +98,7 @@
             show_infoprint(gettext("stab_me_usb_cannot_connect"));
         }
     }
+#endif
     /* invalidate */
     the_connection = NULL;
 }
@@ -104,22 +107,33 @@
 #define FDO_OBJECT_PATH "/org/freedesktop/Notifications"
 #define FDO_INTERFACE "org.freedesktop.Notifications"
 
-static void show_infoprint(const char *text)
+void show_infonote(const char *text)
 {
     DBusMessage* m = NULL;
     DBusError err;
     dbus_bool_t ret;
+    char *btext = "";
+    int type = 0;
 
-    assert(ses_conn != NULL);
     dbus_error_init(&err);
+    if (!ses_conn) {
+        ses_conn = dbus_bus_get(DBUS_BUS_SESSION, &err);
+        if (!ses_conn) {
+                ULOG_ERR_F("couldn't open session bus");
+                return;
+        }
+    }
 
     m = dbus_message_new_method_call(FDO_SERVICE, FDO_OBJECT_PATH,
-                                     FDO_INTERFACE, "SystemNoteInfoprint");
+                                     FDO_INTERFACE, "SystemNoteDialog");
     if (m == NULL) {
         ULOG_ERR_F("couldn't create message");
         return;
     }
+
     ret = dbus_message_append_args(m, DBUS_TYPE_STRING, &text,
+                                   DBUS_TYPE_UINT32, &type,
+                                   DBUS_TYPE_STRING, &btext,
                                    DBUS_TYPE_INVALID);
     if (!ret) {
         ULOG_ERR_F("couldn't append arguments");
@@ -133,16 +147,20 @@
         ULOG_ERR_F("dbus_connection_send failed");
         return;
     }
+    dbus_connection_flush(ses_conn);
 }
 
 /* this callback is called directly from kdbus code, the message
  * does not come from the DBus bus */
 void handle_kevent(DBusMessage* m)
 {
+#if 0  /* nothing done here because input device tracking is not needed */
+        /*
     ULOG_DEBUG_F("i|m|p: %s|%s|%s",
                  dbus_message_get_interface(m), 
                  dbus_message_get_member(m),
                  dbus_message_get_path(m));
+                 */
     the_connection = sys_conn;
     the_message = NULL; /* replying to message 'm' wouldn't work */
 
@@ -167,6 +185,7 @@
     }
     /* invalidate */
     the_connection = NULL;
+#endif
 }
 
 /**
@@ -177,10 +196,12 @@
 		              void *data)
 {
     gboolean handled = FALSE;
+    /*
     ULOG_DEBUG_L("i|m|p: %s|%s|%s",
                dbus_message_get_interface(m), 
                dbus_message_get_member(m),
                dbus_message_get_path(m));
+               */
     the_connection = c;
     the_message = m;
     if (dbus_message_is_signal(m, DBUS_PATH_LOCAL, "Disconnected")) {
@@ -307,11 +328,15 @@
 
     wait(&status);
     if (WIFEXITED(status)) {
-        ULOG_INFO_L("child exited with code %d, exiting",
+            /*
+        printf("child exited with code %d, exiting\n",
                     WEXITSTATUS(status));
+                    */
     } else if (WIFSIGNALED(status)) {
-        ULOG_INFO_L("child exited with signal %d, exiting",
+            /*
+        printf("child exited with signal %d, exiting\n",
                     WTERMSIG(status));
+                    */
     }
 
     exit(1);
@@ -341,6 +366,16 @@
       exit(1);
     }
 
+    if (setlocale(LC_ALL, "") == NULL) {
+        ULOG_ERR_L("couldn't set locale");
+    }
+    if (bindtextdomain("hildon-status-bar-usb", LOCALEDIR) == NULL) {
+        ULOG_ERR_L("bindtextdomain() failed");
+    }
+    if (textdomain("hildon-status-bar-usb") == NULL) {
+        ULOG_ERR_L("textdomain() failed");
+    }
+
     if ((child_pid = fork()) == -1) {
       ULOG_CRIT_L("fork() failed: %s", strerror(errno));
       exit(1);
@@ -372,24 +407,13 @@
       if (sysfs_bgkill_file != NULL) {
         setup_sysfs_poll(sysfs_bgkill_file, pipefd[1]);
       }
-      setup_sysfs_poll("/sys/devices/platform/musb_hdrc/usb1/otg_last_error",
-                       pipefd[1]);
+      setup_sysfs_poll("/proc/mounts", pipefd[1]);
 
       g_main_loop_run(mainloop); 
       ULOG_DEBUG_L("Returned from the main loop");
       exit(0);
     }
 
-    if (setlocale(LC_ALL, "") == NULL) {
-        ULOG_ERR_L("couldn't set locale");
-    }
-    if (bindtextdomain("hildon-status-bar-usb", LOCALEDIR) == NULL) {
-        ULOG_ERR_L("bindtextdomain() failed");
-    }
-    if (textdomain("hildon-status-bar-usb") == NULL) {
-        ULOG_ERR_L("textdomain() failed");
-    }
-
     {
       DBusError error;
       DBusConnection *conn = NULL;

Modified: projects/haf/trunk/ke-recv-extra/src/kdbus.c
===================================================================
--- projects/haf/trunk/ke-recv-extra/src/kdbus.c	2009-06-05 14:37:46 UTC (rev 18632)
+++ projects/haf/trunk/ke-recv-extra/src/kdbus.c	2009-06-05 14:53:07 UTC (rev 18633)
@@ -36,6 +36,7 @@
 #include <glib.h>
 #include <errno.h>
 #include <assert.h>
+#include <libintl.h>
 
 #ifndef NETLINK_KOBJECT_UEVENT
 #define NETLINK_KOBJECT_UEVENT 15
@@ -60,6 +61,7 @@
 
 void sysfs_change(const char *path, const char *value);
 void handle_kevent(DBusMessage* m);
+void show_infonote(const char *text);
 
 static DBusConnection* sysbus;
 static int pipe_fd;
@@ -205,6 +207,14 @@
         return TRUE;
 }
 
+#define MOUNTS_FILE "/proc/mounts"
+#define INT_MMC "/home/user/MyDocs vfat"
+#define INT_MMC_RO "/home/user/MyDocs vfat ro"
+#define INT_MMC_RW "/home/user/MyDocs vfat rw"
+#define EXT_MMC "/media/mmc1 vfat"
+#define EXT_MMC_RO "/media/mmc1 vfat ro"
+#define EXT_MMC_RW "/media/mmc1 vfat rw"
+
 static gboolean
 sysfs_file_cb(GIOChannel* ch, GIOCondition cond, gpointer data)
 {
@@ -214,7 +224,70 @@
         gsize len;
         const char *file = data;
 
-        if (cond & G_IO_IN || cond & G_IO_PRI) {
+        if (strcmp(MOUNTS_FILE, file) == 0) {
+                static int ext_ro = 0;
+                static int int_ro = 0;
+
+                /*
+                ULOG_DEBUG_F(MOUNTS_FILE " changed");
+                */
+
+                /* check if either card is now read-only */
+                if (g_file_get_contents(MOUNTS_FILE, &str, NULL, NULL)) {
+                        int show_note = 0;
+
+                        if (strstr(str, INT_MMC)) {
+                                /*
+                                ULOG_DEBUG_F("internal card found");
+                                */
+                                if (!int_ro && strstr(str, INT_MMC_RO)) {
+                                        int_ro = 1;
+                                        show_note = 1;
+                                        ULOG_DEBUG_F(
+                                                "internal card is read-only");
+                                } else if (int_ro && strstr(str, INT_MMC_RW)) {
+                                        int_ro = 0;
+                                        ULOG_DEBUG_F(
+                                                "internal card is read-write");
+                                }
+                        } else
+                                int_ro = 0;
+
+                        if (strstr(str, EXT_MMC)) {
+                                /*
+                                ULOG_DEBUG_F("external card found");
+                                */
+                                if (!ext_ro && strstr(str, EXT_MMC_RO)) {
+                                        ext_ro = 1;
+                                        show_note = 1;
+                                        ULOG_DEBUG_F(
+                                                "external card is read-only");
+                                } else if (ext_ro && strstr(str, EXT_MMC_RW)) {
+                                        ext_ro = 0;
+                                        ULOG_DEBUG_F(
+                                                "external card is read-write");
+                                }
+                        } else
+                                ext_ro = 0;
+                        g_free(str);
+
+                        if (show_note) {
+                                show_infonote(dgettext("ke-recv",
+                                              "card_ia_corrupted"));
+                        }
+                }
+
+                /* seek to zero offset so that the poll() works */
+                g_io_channel_seek_position(ch, 0, G_SEEK_SET, &error);
+                if (error != NULL) {
+                        ULOG_ERR_F("g_io_channel_seek_position(): %s",
+                                   error->message);
+                        g_error_free(error);
+                        g_io_channel_unref(ch);
+                        return FALSE;
+                }
+                return TRUE;
+        } else if (cond & G_IO_IN || cond & G_IO_PRI) {
                 ret = g_io_channel_read_line(ch, &str, &len, NULL, &error);
                 if (error != NULL) {
                         ULOG_ERR_F("g_io_channel_read_line(): %s",
@@ -228,7 +301,9 @@
                         int n;
 
                         str = g_strchomp(str);
+                        /*
                         ULOG_DEBUG_F("%s: '%s'", file, str);
+                        */
                         /* make the data look like a kevent message */
                         n = snprintf(buf, PIPE_MSG_LEN, "%s@%s", str, file);
                         g_free(str);
@@ -270,7 +345,6 @@
         } else if (cond & G_IO_ERR) {
                 ULOG_ERR_F("file error for %s", file);
                 g_io_channel_unref(ch);
-                exit(1);
         } else {
                 ULOG_ERR_F("unknown GIOCondition: %d", cond);
                 g_io_channel_unref(ch);


More information about the maemo-commits mailing list