r2661 - in trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src

njp at sita.openmoko.org njp at sita.openmoko.org
Tue Aug 7 16:29:41 CEST 2007


Author: njp
Date: 2007-08-07 16:29:40 +0200 (Tue, 07 Aug 2007)
New Revision: 2661

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.c
Log:
2007-08-07  Neil J. Patel  <njp at o-hand.com>

	* src/moko-dialer.c: (on_keypad_dial_clicked):
	Make sure new entry's are written to the journal.

	* src/moko-notify.c: (moko_notify_check_brightness),
	(moko_notify_start):
	Check the LCD brightness, if it is under 5000, set it to 5000.

Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog	2007-08-07 12:22:30 UTC (rev 2660)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog	2007-08-07 14:29:40 UTC (rev 2661)
@@ -1,5 +1,14 @@
 2007-08-07  Neil J. Patel  <njp at o-hand.com>
 
+	* src/moko-dialer.c: (on_keypad_dial_clicked):
+	Make sure new entry's are written to the journal.
+
+	* src/moko-notify.c: (moko_notify_check_brightness),
+	(moko_notify_start):
+	Check the LCD brightness, if it is under 5000, set it to 5000.
+
+2007-08-07  Neil J. Patel  <njp at o-hand.com>
+
 	* src/dialer-main.c: (main):
 	* src/moko-dialer.c: (on_call_progress_changed),
 	(moko_dialer_init):

Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c	2007-08-07 12:22:30 UTC (rev 2660)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-dialer.c	2007-08-07 14:29:40 UTC (rev 2661)
@@ -250,6 +250,7 @@
   if (entry)
     moko_journal_entry_set_contact_uid (priv->entry, entry->contact->uid);
   moko_journal_add_entry (priv->journal, priv->entry);
+  moko_journal_write_to_storage (priv->journal);
   moko_time_free (priv->time);
   priv->entry = NULL;
   priv->time = NULL;

Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.c	2007-08-07 12:22:30 UTC (rev 2660)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-notify.c	2007-08-07 14:29:40 UTC (rev 2661)
@@ -57,7 +57,37 @@
 static guint notify_signals[LAST_SIGNAL] = {0, };
 */
 
+static void
+moko_notify_check_brightness (void)
+{
+  gint fd;
+  gchar buf[50];
+  gint brightness, len;
 
+  fd = g_open (SYS_BRIGHTNESS"/brightness", O_WRONLY, 0);
+  if (fd == -1)
+  {
+    g_warning ("Unable to open brightness device");
+    return;
+  }
+  if (read (fd, buf, sizeof (buf)) == -1)
+  {
+    close (fd);
+    return;
+  }
+  brightness = atoi (buf);
+
+  if (brightness >= 5000)
+  {
+    close (fd);
+    return;
+  }
+  
+  len = g_sprintf (buf, "%d", 5000);
+  write (fd, buf, len);
+  close (fd);
+}
+
 static void
 on_bus_eos (GstBus *bus, GstMessage *message, MokoNotify *notify)
 {
@@ -213,6 +243,7 @@
     return;
   priv->started = TRUE;
 
+  moko_notify_check_brightness ();
   moko_notify_start_vibrate ();
   moko_notify_start_ringtone (notify);
 }





More information about the commitlog mailing list