I have made the following changes intended for : CE:UX:MTF / mce Please review and accept ASAP - BOSS has already processed this request and suggests ??? See the "Messages from BOSS" section below
https://build.pub.meego.com/request/show/2652 Thank You, bossbot ([email protected]) [This message was auto-generated] --- Request # 2652: Messages from BOSS: None State: new 2011-10-24T17:22:32 bossbot Reviews: from bossbot :BOSS suggests accepting this review. See email for more details. BOSS accepted this review because: Target repo CE_UX_MTF_armv7hl found. accepted on No date Changes: submit: Project:MTF / mce -> CE:UX:MTF / mce Index: mce.changes =================================================================== --- mce.changes (revision 0) +++ mce.changes (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,106 @@ +* Thu Sep 15 2011 Marko Saukko <[email protected]> - 1.10.92-17 +- Systemd service file +- Added yaml and fixed packaging +- changed the DSME socket file location with env variable in systemd. + +* Tue Jul 12 2011 Timo Rongas <[email protected]> - 1.10.92-16 +- Add reference counting for active calls (BMC#17539) + +* Wed Jun 29 2011 Mika Laitio <[email protected]> - 1.10.92-15 +- BMC#19806 fix the periodic display unblank bug which happens if + the sysuid process frozes in a way that it does not die but on the + other hand does not also respond to anything. + mce-1.10.92-bmc19806-do-not-unblank-display-if-dbus-send-fails.patch + +* Wed May 11 2011 Mika Laitio <[email protected]> - 1.10.92-14 +- BMC#17416 fix by checking from the tklock whether the + screen lock ui active or not when handling the power button + event. Patch is made to updated version of + mce-1.10.92-pwr-btn-fix-for-display-blank-and-unblank.patch +- reorganized the order how patches are applied on spec file + as 2 of the patches touches same tklock file + +* Wed May 11 2011 Timo Rongas <[email protected]> - 1.10.92-13 +- Added ofono signal listening to call state module. Knowing call + state makes it possible to enable screen blanking/locking via + proximity sensor during calls (BMC#14990) + +* Wed May 11 2011 Mika Laitio <[email protected]> - 1.10.92-12 +- BMC#17413 fix with patch + mce-1.10.92-fix-n900-tsc2005-sysfs-disable-path-for-newer-kernels.patch. + Sysfs path for disabling/enabling the touschreen has changed in + newer kernels for N900 to /sys/devices/platform/omap2_mcspi.1/spi1.0/disable + This patch will make mce to check both the new and old path for finding + the correct sysfs file path. + +* Mon May 09 2011 Mika Laitio <[email protected]> - 1.10.92-11 +- BMC#15953 Changed the behaviour of power key in unlock case. + When the screen is off(blank) and power key is pressed, screen is unblanked + but the "lock ui" application is not disabled. Lock key will work just + like with the previous version, so it will unblank the screen and + also disable the lock ui application. + +* Fri May 06 2011 Mika Laitio <[email protected]> - 1.10.92-10 +- When the device is booted, the initial blanking delay needs to be + longer to prevent the display to be blanked during the device + boot-up or immediately after that. +- Simplified mce-1.10.92-pwr-btn-fix-for-display-blank-and-unblank.patch + by taking out MCE_DISPLAY_TOGGLE related code that this patch + added, because it was not needed anymore. + +* Thu May 05 2011 Mika Laitio <[email protected]> - 1.10.92-9 +- (BMC#15953) Fixed the usage of lock key for locking the screen. +- Fixedthe power button usage for blanking the screen to follow the + same behaviour with lock/unlock key. + When the screen is now blanked, it can not be activated anymore + by simply touching the touchscreen. Instead the user can unblank + the display either by using the power button or lock/unlock button again. +- The power button will now blank/unblank the screen after release event + instead of press-event. This will allow user to see the shutdown + ui, in the case user keeps power button down for a long time in order + to shutdown the device. +- increased the blanking timeout during inactivity from 30 to 60 sec + +* Mon Apr 18 2011 Mika Laitio <[email protected]> - 1.10.92-8 +- (BMC#16313) Added dependency from mce to dsme because mce fails to start + if dsme is not running. + +* Thu Apr 07 2011 Mika Laitio <[email protected]> - 1.10.92-7 +- (BMC#15233) Added MCE_DISPLAY_TOGGLE value to mce.h and and + send TOGGLE request from the power button keypreses in the event-input.c. + Added also the code to meegodisplay.c to handle these display toggle requests. + +* Wed Apr 06 2011 Mika Laitio <[email protected]> - 1.10.92-6 +- (BMC#14738) Additional fix. Sometimes the screen got invoked couple of + seconds after blanking it even thought there were not any user activity. + This was caused by the code in event-input.c which suspended the event + reading for a while in certain situations after sending the activity + event. I removed the suspend code and instead use the input events time + as a filter so that only one activity event is send in maximum on each + second from the touchscreen events. + +* Mon Apr 04 2011 Mika Laitio <[email protected]> - 1.10.92-5 +- (BMC#14738) Add new displaymeego module which simplifies the display blanking + code that was used in display module by removing all dimming related + functionality that's not needed and had problems. +- Drop previously used display-module-disabled patch + +* Wed Mar 09 2011 Tapio Rantala <[email protected]> - 1.10.92-4 +- Add silent-fd-close patch from upstream svn (BMC#14264) + + Don't print unnecessary info on startup +- Add pwr-button-event-name patch from upstream svn + + Added event driver name for the power button in various MeeGo devices +- Refresh display-module-disabled patch + +* Mon Feb 28 2011 Tapio Rantala <[email protected]> - 1.10.92-3 +- Do not load display module (BMC#13332) + +* Wed Jan 26 2011 Tapio Rantala <[email protected]> - 1.10.92-2 +- Drop init script, part of fix for (BMC#12898) + +* Fri Jan 21 2011 Tapio Rantala <[email protected]> - 1.10.92-1 +- New upstream version (BMC#12782) +- Drop deprecated-names patch, applied upstream + +* Fri Jan 14 2011 Tapio Rantala <[email protected]> - 1.10.90-1 +- Initial meego packaging (FEA#5525) (FEA#5526) (FEA#5527) (FEA#5528) Index: mce.service =================================================================== --- mce.service (revision 0) +++ mce.service (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,13 @@ +[Unit] +Description=Mode Control Entity (MCE) +Requires=dsme.service +After=dsme.service + +[Service] +Environment=DSME_SOCKFILE=/run/dsme.socket +ExecStartPre=-/bin/mkdir /run/mce +ExecStart=/sbin/mce +Restart=always + +[Install] +WantedBy=default.target Index: mce-1.10.92-add-ofono-call-state-handling.patch =================================================================== --- mce-1.10.92-add-ofono-call-state-handling.patch (revision 0) +++ mce-1.10.92-add-ofono-call-state-handling.patch (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,263 @@ +diff -urN -x .git mce-1.10.92.orig/modules/callstate.c mce-1.10.92/modules/callstate.c +--- mce-1.10.92.orig/modules/callstate.c 2011-01-28 12:06:22.000000000 +0200 ++++ mce-1.10.92/modules/callstate.c 2011-05-11 15:05:07.733993982 +0300 +@@ -26,6 +26,8 @@ + #include "mce.h" + #include "callstate.h" + ++#include "ofono-dbus-names.h" ++ + #include <mce/mode-names.h> /* MCE_CALL_STATE_NONE, + * MCE_CALL_STATE_ACTIVE, + * MCE_CALL_STATE_SERVICE, +@@ -463,6 +465,185 @@ + } + + /** ++ * Parses an ofono property message from given iterator. ++ * ++ * Actions related to the property are done. ++ * ++ * @param it Iterator to ofono property. ++ * @return TRUE on success, FALSE on failure. ++ */ ++static gboolean ofono_handle_call_property(DBusMessageIter *it) ++{ ++ gboolean status = FALSE; ++ gboolean call_state_changed = FALSE; ++ DBusMessageIter entit; ++ DBusMessageIter varit; ++ gchar *propname; ++ gchar *prop_value_str; ++ gboolean prop_value_bool; ++ call_state_t old_call_state = datapipe_get_gint(call_state_pipe); ++ call_type_t old_call_type = datapipe_get_gint(call_type_pipe); ++ call_state_t call_state = old_call_state; ++ call_type_t call_type = old_call_type; ++ ++ if (dbus_message_iter_get_arg_type(it) != DBUS_TYPE_STRING) { ++ mce_log(LL_WARN, "Parsing failure with ofono signal"); ++ goto EXIT; ++ } ++ dbus_message_iter_get_basic(it, (void *)&propname); ++ mce_log(LL_DEBUG, "Handling call property '%s' from ofono", propname); ++ ++ dbus_message_iter_next(it); ++ ++ if (dbus_message_iter_get_arg_type(it) != DBUS_TYPE_VARIANT) { ++ mce_log(LL_WARN, "Parsing failure with ofono signal"); ++ goto EXIT; ++ } ++ dbus_message_iter_recurse(it, &varit); ++ ++ if (!strcmp(propname, "State")) { ++ if (dbus_message_iter_get_arg_type(&varit) != DBUS_TYPE_STRING) { ++ mce_log(LL_WARN, "Parsing failure with ofono signal"); ++ goto EXIT; ++ } ++ dbus_message_iter_get_basic(&varit, (void *)&prop_value_str); ++ ++ if (!strcmp(prop_value_str, "incoming") || ++ !strcmp(prop_value_str, "dialing")) { ++ call_state = CALL_STATE_RINGING; ++ } else if (!strcmp(prop_value_str, "disconnected")) { ++ call_state = CALL_STATE_NONE; ++ } else { ++ call_state = CALL_STATE_ACTIVE; ++ } ++ ++ if (old_call_state != call_state) ++ call_state_changed = TRUE; ++ ++ } else if (!strcmp(propname, "Emergency")) { ++ if (dbus_message_iter_get_arg_type(&varit) != DBUS_TYPE_BOOLEAN) { ++ mce_log(LL_WARN, "Parsing failure with ofono signal"); ++ goto EXIT; ++ } ++ dbus_message_iter_get_basic(&varit, (void *)&prop_value_bool); ++ ++ if (prop_value_bool) { ++ call_type = EMERGENCY_CALL; ++ } else { ++ call_type = NORMAL_CALL; ++ } ++ ++ if (old_call_type != call_type) ++ call_state_changed = TRUE; ++ ++ } else { ++ mce_log(LL_DEBUG, ++ "No handling for property '%s' from ofono", propname); ++ } ++ ++ if (call_state_changed) { ++ (void)execute_datapipe(&call_state_pipe, ++ GINT_TO_POINTER(call_state), ++ USE_INDATA, CACHE_INDATA); ++ ++ (void)execute_datapipe(&call_type_pipe, ++ GINT_TO_POINTER(call_type), ++ USE_INDATA, CACHE_INDATA); ++ } ++ ++ status = TRUE; ++EXIT: ++ return status; ++} ++ ++/** ++ * D-Bus callback for ofono call added signal. ++ * ++ * @param msg The D-Bus message. ++ * @return TRUE on success, FALSE on failure. ++ */ ++ static gboolean ofono_call_added_dbus_cb(DBusMessage *const msg) ++ { ++ gboolean status = FALSE; ++ DBusMessageIter msgit; ++ DBusMessageIter arrit; ++ DBusMessageIter entit; ++ DBusError error; ++ ++ /* Register error channel */ ++ dbus_error_init(&error); ++ ++ mce_log(LL_DEBUG, ++ "Received call added signal from ofono"); ++ ++ dbus_message_iter_init(msg, &msgit); ++ ++ /* Message correctness checking */ ++ if (dbus_message_iter_get_arg_type(&msgit) != DBUS_TYPE_OBJECT_PATH) { ++ mce_log(LL_WARN, "Parsing failure with ofono signal"); ++ goto EXIT; ++ } ++ ++ if (!dbus_message_iter_next(&msgit) || ++ dbus_message_iter_get_arg_type(&msgit) != DBUS_TYPE_ARRAY) { ++ mce_log(LL_WARN, "Parsing failure with ofono signal"); ++ goto EXIT; ++ } ++ ++ dbus_message_iter_recurse(&msgit, &arrit); ++ ++ if (dbus_message_iter_get_arg_type(&arrit) != DBUS_TYPE_DICT_ENTRY) { ++ mce_log(LL_WARN, "Parsing failure with ofono signal"); ++ goto EXIT; ++ } ++ ++ dbus_message_iter_recurse(&arrit, &entit); ++ ++ do { ++ if (!ofono_handle_call_property(&entit)) { ++ mce_log(LL_WARN, ++ "Failed to parse call property change from ofono"); ++ } ++ goto EXIT; ++ } while (dbus_message_iter_next(&entit)); ++ ++ status = TRUE; ++EXIT: ++ return status; ++ } ++ ++/** ++ * D-Bus callback for ofono call property changed signal. ++ * ++ * @param msg The D-Bus message. ++ * @return TRUE on success, FALSE on failure. ++ */ ++ static gboolean ofono_call_props_changed_dbus_cb(DBusMessage *const msg) ++ { ++ gboolean status = FALSE; ++ DBusMessageIter msgit; ++ DBusError error; ++ ++ /* Register error channel */ ++ dbus_error_init(&error); ++ ++ mce_log(LL_DEBUG, ++ "Received call property changed signal from ofono"); ++ ++ dbus_message_iter_init(msg, &msgit); ++ ++ if (!ofono_handle_call_property(&msgit)) { ++ mce_log(LL_WARN, ++ "Failed to parse call property change from ofono"); ++ goto EXIT; ++ } ++ ++ status = TRUE; ++EXIT: ++ return status; ++} ++ ++/** + * Init function for the call state module + * + * @todo XXX status needs to be set on error! +@@ -491,6 +672,22 @@ + get_call_state_dbus_cb) == NULL) (63 more lines skipped) Index: mce-1.10.92-fix-delay-when-processing-touchscreen-events.patch =================================================================== --- mce-1.10.92-fix-delay-when-processing-touchscreen-events.patch (revision 0) +++ mce-1.10.92-fix-delay-when-processing-touchscreen-events.patch (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,132 @@ +From abfb66e4336816c8470cc0803de5e60e275d7b29 Mon Sep 17 00:00:00 2001 +From: Mika Laitio <[email protected]> +Date: Wed, 6 Apr 2011 20:06:24 +0300 +Subject: [PATCH 2/2] fix delay when processing touchscreen events + +BMC#14738, additional fix. Sometimes the screen got invoked couple of +seconds after blanking it even thought there were not any user activity. +This was caused by the code in event-input.c which suspended the event +reading for a while in certain situations after sending the activity +event. I removed the suspend code and instead use the input events time +as a filter so that only one activity event is send in maximum on each +second from the touchscreen events. + +Signed-off-by: Mika Laitio <[email protected]> +--- + event-input.c | 66 +++++++++++++-------------------------------------------- + 1 files changed, 15 insertions(+), 51 deletions(-) + +diff --git a/event-input.c b/event-input.c +index fce0728..c5ea85e 100644 +--- a/event-input.c ++++ b/event-input.c +@@ -110,6 +110,8 @@ static gboolean gpio_key_disable_exists = FALSE; + + static void update_inputdevices(const gchar *device, gboolean add); + ++static time_t prev_handled_touchscreen_activity_seconds = 0; ++ + /** + * Enable the specified GPIO key + * non-existing or already enabled keys are silently ignored +@@ -237,27 +239,6 @@ static void unregister_io_monitor(gpointer io_monitor, gpointer user_data) + } + + /** +- * Timeout function for touchscreen I/O monitor reprogramming +- * +- * @param data Unused +- * @return Always returns FALSE, to disable the timeout +- */ +-static gboolean touchscreen_io_monitor_timeout_cb(gpointer data) +-{ +- (void)data; +- +- touchscreen_io_monitor_timeout_cb_id = 0; +- +- /* Resume I/O monitors */ +- if (touchscreen_dev_list != NULL) { +- g_slist_foreach(touchscreen_dev_list, +- (GFunc)resume_io_monitor, NULL); +- } +- +- return FALSE; +-} +- +-/** + * Cancel timeout for touchscreen I/O monitor reprogramming + */ + static void cancel_touchscreen_io_monitor_timeout(void) +@@ -269,19 +250,6 @@ static void cancel_touchscreen_io_monitor_timeout(void) + } + + /** +- * Setup timeout for touchscreen I/O monitor reprogramming +- */ +-static void setup_touchscreen_io_monitor_timeout(void) +-{ +- cancel_touchscreen_io_monitor_timeout(); +- +- /* Setup new timeout */ +- touchscreen_io_monitor_timeout_cb_id = +- g_timeout_add_seconds(MONITORING_DELAY, +- touchscreen_io_monitor_timeout_cb, NULL); +-} +- +-/** + * I/O monitor callback for the touchscreen + * + * @param data The new data +@@ -289,9 +257,9 @@ static void setup_touchscreen_io_monitor_timeout(void) + */ + static void touchscreen_cb(gpointer data, gsize bytes_read) + { +- display_state_t display_state = datapipe_get_gint(display_state_pipe); + submode_t submode = mce_get_submode_int32(); + struct input_event *ev; ++ time_t time_now; + + ev = data; + +@@ -305,26 +273,22 @@ static void touchscreen_cb(gpointer data, gsize bytes_read) + goto EXIT; + } + ++ /* ignore all other tousch screen events except the first one happened at same second */ ++ if ((ev->time.tv_sec - prev_handled_touchscreen_activity_seconds) == 0) { ++ goto EXIT; ++ } ++ prev_handled_touchscreen_activity_seconds = ev->time.tv_sec; ++ ++ time(&time_now); ++ if ((time_now - ev->time.tv_sec) > 2) { ++ // ignore events that are more than 2 seconds old ++ goto EXIT; ++ } ++ + /* Generate activity */ + (void)execute_datapipe(&device_inactive_pipe, GINT_TO_POINTER(FALSE), + USE_INDATA, CACHE_INDATA); + +- /* If the display is on/dim and visual tklock is active +- * or autorelock isn't active, suspend I/O monitors +- */ +- if (((display_state == MCE_DISPLAY_ON) || +- (display_state == MCE_DISPLAY_DIM)) && +- (((submode & MCE_VISUAL_TKLOCK_SUBMODE) != 0) || +- ((submode & MCE_AUTORELOCK_SUBMODE) == 0))) { +- if (touchscreen_dev_list != NULL) { +- g_slist_foreach(touchscreen_dev_list, +- (GFunc)suspend_io_monitor, NULL); +- } +- +- /* Setup a timeout I/O monitor reprogramming */ +- setup_touchscreen_io_monitor_timeout(); +- } +- + /* Ignore non-pressure events */ + if (((ev->type != EV_ABS) || (ev->code != ABS_PRESSURE)) && + ((ev->type != EV_KEY) || (ev->code != BTN_TOUCH))) { +-- +1.7.1 + Index: mce-1.10.92-pwr-button-event-name.patch =================================================================== --- mce-1.10.92-pwr-button-event-name.patch (revision 0) +++ mce-1.10.92-pwr-button-event-name.patch (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,14 @@ +Index: trunk/event-input.h +=================================================================== +--- trunk/event-input.h (revision 19482) ++++ trunk/event-input.h (revision 19483) +@@ -94,6 +94,9 @@ + /** Input layer name for standard PC keyboards */ + "AT Translated Set 2 keyboard", + ++ /** Input layer name for the power button in various MeeGo devices */ ++ "msic_power_btn", ++ + /** Input layer name for the TWL4030 power button */ + "twl4030_pwrbutton", + Index: mce-1.10.92-silent-fd-close.patch =================================================================== --- mce-1.10.92-silent-fd-close.patch (revision 0) +++ mce-1.10.92-silent-fd-close.patch (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,16 @@ +Index: trunk/mce.c +=================================================================== +--- trunk/mce.c (revision 19701) ++++ trunk/mce.c (revision 19702) +@@ -312,10 +312,7 @@ + i++; + retries++; + } else if (errno == EBADF) { +- mce_log(LL_ERR, +- "Failed to close() fd %d; %s. " +- "Ignoring.", +- i + 1, g_strerror(errno)); ++ /* Ignore invalid file descriptors */ + errno = 0; + } else { + mce_log(LL_CRIT, Index: mce-1.10.92-refcounting-for-call-state.patch =================================================================== --- mce-1.10.92-refcounting-for-call-state.patch (revision 0) +++ mce-1.10.92-refcounting-for-call-state.patch (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,44 @@ +commit 0a23e7c60cacceca109f2a2e95d87a86370ccedd +Author: Timo Rongas <[email protected]> +Date: Tue Jul 12 10:46:23 2011 +0300 + + Added rudimentary reference counting as a fix for BMC#17539. + + Call state module now maintains active state until all active calls + have disconnected. + + Signed-off-by: Timo Rongas <[email protected]> + +diff --git a/modules/callstate.c b/modules/callstate.c +index 1646500..0a4dc62 100644 +--- a/modules/callstate.c ++++ b/modules/callstate.c +@@ -138,6 +138,9 @@ static GSList *call_state_monitor_list = NULL; + /** Keep track of whether call state is monitored */ + static gboolean call_state_is_monitored = FALSE; + ++/** Reference counter for number of active calls */ ++static unsigned char num_of_active_calls = 0; ++ + /** + * Send the call state and type + * +@@ -510,9 +513,17 @@ static gboolean ofono_handle_call_property(DBusMessageIter *it) + + if (!strcmp(prop_value_str, "incoming") || + !strcmp(prop_value_str, "dialing")) { ++ num_of_active_calls += 1; + call_state = CALL_STATE_RINGING; + } else if (!strcmp(prop_value_str, "disconnected")) { +- call_state = CALL_STATE_NONE; ++ num_of_active_calls -= 1; ++ /* Only set state to NONE if there are no remaining calls. ++ * This information could also be verified from ofono if ++ * some dbus signals are expected to go missing. */ ++ if (num_of_active_calls <= 0) { ++ num_of_active_calls == 0; ++ call_state = CALL_STATE_NONE; ++ } + } else { + call_state = CALL_STATE_ACTIVE; + } Index: mce-1.10.92-fix-n900-tsc2005-sysfs-disable-path-for-newer-kernels.patch =================================================================== --- mce-1.10.92-fix-n900-tsc2005-sysfs-disable-path-for-newer-kernels.patch (revision 0) +++ mce-1.10.92-fix-n900-tsc2005-sysfs-disable-path-for-newer-kernels.patch (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,48 @@ +From b881236517b9f69c75a0622e68a3f1ecc2e8f07b Mon Sep 17 00:00:00 2001 +From: Mika Laitio <[email protected]> +Date: Wed, 11 May 2011 14:52:22 +0300 +Subject: [PATCH 5/5] fix N900 tsc2005 disable sysfs disable path for newer kernels + +Add new path to check for enable/disable support of touschreen during +the display blank/unblank. In newer kernels the disable path has changed from +/sys/devices/platform/omap2_mcspi.1/spi1.0/ts_disable +to +/sys/devices/platform/omap2_mcspi.1/spi1.0/disable + +Signed-off-by: Mika Laitio <[email protected]> +--- + tklock.c | 3 +++ + tklock.h | 3 ++- + 2 files changed, 5 insertions(+), 1 deletions(-) + +diff --git a/tklock.c b/tklock.c +index a9a513b..0ec3ccb 100644 +--- a/tklock.c ++++ b/tklock.c +@@ -2529,6 +2529,9 @@ gboolean mce_tklock_init(void) + if (g_access(MCE_RM680_TOUCHSCREEN_SYSFS_DISABLE_PATH, W_OK) == 0) { + mce_touchscreen_sysfs_disable_path = + MCE_RM680_TOUCHSCREEN_SYSFS_DISABLE_PATH; ++ } else if (g_access(MCE_RX44_TOUCHSCREEN_SYSFS_DISABLE_PATH_KERNEL2637, W_OK) == 0) { ++ mce_touchscreen_sysfs_disable_path = ++ MCE_RX44_TOUCHSCREEN_SYSFS_DISABLE_PATH_KERNEL2637; + } else if (g_access(MCE_RX44_TOUCHSCREEN_SYSFS_DISABLE_PATH, W_OK) == 0) { + mce_touchscreen_sysfs_disable_path = + MCE_RX44_TOUCHSCREEN_SYSFS_DISABLE_PATH; +diff --git a/tklock.h b/tklock.h +index a963229..3f2e2a9 100644 +--- a/tklock.h ++++ b/tklock.h +@@ -43,7 +43,8 @@ + #define MCE_RM680_TOUCHSCREEN_SYSFS_DISABLE_PATH "/sys/class/i2c-adapter/i2c-2/2-004b/disable_ts" + + /** SysFS interface to enable/disable RX-44/RX-48/RX-51 touchscreen IRQs */ +-#define MCE_RX44_TOUCHSCREEN_SYSFS_DISABLE_PATH "/sys/devices/platform/omap2_mcspi.1/spi1.0/disable_ts" ++#define MCE_RX44_TOUCHSCREEN_SYSFS_DISABLE_PATH "/sys/devices/platform/omap2_mcspi.1/spi1.0/disable_ts" ++#define MCE_RX44_TOUCHSCREEN_SYSFS_DISABLE_PATH_KERNEL2637 "/sys/devices/platform/omap2_mcspi.1/spi1.0/disable" + + /** Default fallback setting for the touchscreen/keypad autolock */ + #define DEFAULT_TK_AUTOLOCK FALSE /* FALSE / TRUE */ +-- +1.7.1 + Index: mce-1.10.90-no-ownership.patch =================================================================== --- mce-1.10.90-no-ownership.patch (revision 0) +++ mce-1.10.90-no-ownership.patch (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,15 @@ +diff -urN a/Makefile b/Makefile +--- a/Makefile 2010-06-03 14:56:43.891856000 +0300 ++++ b/Makefile 2010-06-04 13:18:51.314421784 +0300 +@@ -5,9 +5,9 @@ + + VERSION := 1.10.52 + +-INSTALL := install -o root -g root --mode=755 ++INSTALL := install --mode=755 + INSTALL_DIR := install -d +-INSTALL_DATA := install -o root -g root --mode=644 ++INSTALL_DATA := install --mode=644 + + DOXYGEN := doxygen + Index: mce.yaml =================================================================== --- mce.yaml (revision 0) +++ mce.yaml (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,50 @@ +Name: mce +Summary: Mode Control Entity for Nokia mobile computers +Version: 1.10.92 +Release: 17 +Group: System/System Control +License: LGPLv2 +URL: http://meego.gitorious.org/meego-middleware/mce/ +Sources: + - "%{name}-%{version}.tar.bz2" + - "mce.service" +Patches: + - "%{name}-1.10.90-no-ownership.patch" + - "%{name}-1.10.90-include-i2c-fix.patch" + - "%{name}-1.10.90-no-werror.patch" + - "%{name}-1.10.92-add-and-enable-displaymeego-module.patch" + - "%{name}-1.10.92-silent-fd-close.patch" + - "%{name}-1.10.92-pwr-button-event-name.patch" + - "%{name}-1.10.92-add-ofono-call-state-handling.patch" + - "%{name}-1.10.92-fix-delay-when-processing-touchscreen-events.patch" + - "%{name}-1.10.92-pwr-btn-fix-for-display-blank-and-unblank.patch" + - "%{name}-1.10.92-fix-n900-tsc2005-sysfs-disable-path-for-newer-kernels.patch" + - "%{name}-1.10.92-bmc19806-do-not-unblank-display-if-dbus-send-fails.patch" + - "%{name}-1.10.92-refcounting-for-call-state.patch" +Description: | + This package contains the Mode Control Entity which provides + mode management features. This is a daemon that is the backend + for many features on Nokia's mobile computers. + +Requires: + - dsme +PkgBR: + - kernel-headers >= 2.6.32 + - libi2c-devel +PkgConfigBR: + - dbus-1 >= 1.0.2 + - dbus-glib-1 + - dsme >= 0.58 + - gconf-2.0 + - glib-2.0 >= 2.18.0 + - mce >= 1.10.21 +Configure: none +Builder: make +SubPackages: + - Name: tools + Summary: Tools for interacting with mce + Group: Development/Tools + Description: | + This package contains tools that can be used to interact with + the Mode Control Entity and to get mode information. + Index: mce-1.10.90-include-i2c-fix.patch =================================================================== --- mce-1.10.90-include-i2c-fix.patch (revision 0) +++ mce-1.10.90-include-i2c-fix.patch (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,12 @@ +diff -urN a/modules/led.c b/modules/led.c +--- a/modules/led.c 2010-06-16 21:06:27.315595000 +0300 ++++ b/modules/led.c 2010-06-21 12:01:27.816734760 +0300 +@@ -28,7 +28,7 @@ + #include <string.h> /* strcmp(), strcpy(), strdup() */ + #include <unistd.h> /* close(), W_OK */ + #include <sys/ioctl.h> /* ioctl() */ +-#include <linux/i2c-dev.h> /* i2c_smbus_write_byte_data(), ++#include <libi2c/i2c-dev.h> /* i2c_smbus_write_byte_data(), + * I2C_SLAVE_FORCE + */ + Index: mce-1.10.92-bmc19806-do-not-unblank-display-if-dbus-send-fails.patch =================================================================== --- mce-1.10.92-bmc19806-do-not-unblank-display-if-dbus-send-fails.patch (revision 0) +++ mce-1.10.92-bmc19806-do-not-unblank-display-if-dbus-send-fails.patch (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,17 @@ +diff -Naur mce-1.10.92-orig/tklock.c mce-1.10.92/tklock.c +--- mce-1.10.92-orig/tklock.c 2011-06-30 01:28:57.819048693 +0300 ++++ mce-1.10.92/tklock.c 2011-06-30 01:33:54.103796607 +0300 +@@ -697,8 +697,11 @@ + SYSTEMUI_REQUEST_IF, SYSTEMUI_TKLOCK_OPEN_REQ, + error_msg); + +- /* If the call failed, disable tklock */ +- set_tklock_state(LOCK_OFF); ++ /* Call may fail for example if sysuid process is frozen due to bug in it. ++ * We however should not unlock the screen even in such cases, see bug ++ * https://bugs.meego.com/show_bug.cgi?id=19806 ++ */ ++ //set_tklock_state(LOCK_OFF); + } + + goto EXIT2; Index: mce-1.10.92.tar.bz2 =================================================================== Binary file mce-1.10.92.tar.bz2 added Index: mce-1.10.92-pwr-btn-fix-for-display-blank-and-unblank.patch =================================================================== --- mce-1.10.92-pwr-btn-fix-for-display-blank-and-unblank.patch (revision 0) +++ mce-1.10.92-pwr-btn-fix-for-display-blank-and-unblank.patch (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,184 @@ +From 84172954633d95a0fd90193a4eaf71ef5342165c Mon Sep 17 00:00:00 2001 +From: Mika Laitio <[email protected]> +Date: Wed, 11 May 2011 18:55:21 +0300 +Subject: [PATCH 3/4] pwr-btn fix for display blank/unblank + +Enables the display blanking and unblanking by using the power +button or lock screen button. When display is blanked, it's always +also locked. + +In unblank case there is a difference between lock key and pwr button +key. Power button press only unblanks the screen but leaves the lock ui +still in place. Lock key will also hide the lock ui. + +In the case of power button, the lockkey event is generated only when +the power button is released. This allow user to see the shutdown button +if the device is turned off by keeping the power button down for a long +time. + +Signed-off-by: Mika Laitio <[email protected]> +--- + event-input.c | 65 +++++++++++++++++++++++++++++++++++++++++++-------------- + tklock.c | 19 ++++------------ + tklock.h | 16 ++++++++++++++ + 3 files changed, 70 insertions(+), 30 deletions(-) + +diff --git a/event-input.c b/event-input.c +index c5ea85e..2d56789 100644 +--- a/event-input.c ++++ b/event-input.c +@@ -78,6 +78,7 @@ + * mce_conf_get_string() + */ + #include "datapipe.h" /* execute_datapipe() */ ++#include "tklock.h" + + /** ID for touchscreen I/O monitor timeout source */ + static guint touchscreen_io_monitor_timeout_cb_id = 0; +@@ -357,6 +358,7 @@ static void setup_keypress_repeat_timeout(void) + */ + static void keypress_cb(gpointer data, gsize bytes_read) + { ++ int tklock_ui_state; + submode_t submode = mce_get_submode_int32(); + struct input_event *ev; + +@@ -379,22 +381,53 @@ static void keypress_cb(gpointer data, gsize bytes_read) + USE_INDATA, CACHE_INDATA); + } + +- /* For now there's no reason to cache the keypress +- * +- * If the event eater is active, and this is the press, +- * don't send anything; never eat releases, otherwise +- * the release event for a [power] press might get lost +- * and the device shut down... Not good(tm) +- * +- * Also, don't send repeat events, and don't send +- * keypress events for the focus and screenlock keys +- */ +- if ((ev->code != KEY_CAMERA_FOCUS) && +- (ev->code != KEY_SCREENLOCK) && +- ((((submode & MCE_EVEATER_SUBMODE) == 0) && +- (ev->value == 1)) || (ev->value == 0))) { +- (void)execute_datapipe(&keypress_pipe, &ev, +- USE_INDATA, DONT_CACHE_INDATA); ++ if (ev->code == KEY_POWER) { ++ if (ev->value == 0) { // = power button release event ++ display_state_t display_state = datapipe_get_gint(display_state_pipe); ++ if (display_state == MCE_DISPLAY_OFF) { ++ // open display but leave the lock ui ++ (void)execute_datapipe(&display_state_pipe, ++ GINT_TO_POINTER(MCE_DISPLAY_ON), ++ USE_INDATA, CACHE_INDATA); ++ } ++ else { ++ // display on, check whether we have screen lock ui active ++ tklock_ui_state = get_tklock_ui_state(); ++ if ((tklock_ui_state == MCE_TKLOCK_UI_UNSET) || // = UNSET ++ (tklock_ui_state == MCE_TKLOCK_UI_NONE)) { // MCE_TKLOCK_UI_NONE ++ // no lock ui visible, request to blank and activate lock ui ++ (void)execute_datapipe(&lockkey_pipe, ++ GINT_TO_POINTER(1), ++ USE_INDATA, CACHE_INDATA); ++ } ++ else { ++ // screen lock UI already active --> request just to blank the screen. ++ // we can not call lockkey-pipe here, because it would cause the ++ // lock ui unlock and keep display on ++ (void)execute_datapipe(&display_state_pipe, ++ GINT_TO_POINTER(MCE_DISPLAY_OFF), ++ USE_INDATA, CACHE_INDATA); ++ } } ++ } ++ } ++ else { ++ /* For now there's no reason to cache the keypress ++ * ++ * If the event eater is active, and this is the press, ++ * don't send anything; never eat releases, otherwise ++ * the release event for a [power] press might get lost ++ * and the device shut down... Not good(tm) ++ * ++ * Also, don't send repeat events, and don't send ++ * keypress events for the focus and screenlock keys ++ */ ++ if ((ev->code != KEY_CAMERA_FOCUS) && ++ (ev->code != KEY_SCREENLOCK) && ++ ((((submode & MCE_EVEATER_SUBMODE) == 0) && ++ (ev->value == 1)) || (ev->value == 0))) { ++ (void)execute_datapipe(&keypress_pipe, &ev, ++ USE_INDATA, DONT_CACHE_INDATA); ++ } + } + } + +diff --git a/tklock.c b/tklock.c +index cf9565a..1e8d038 100644 +--- a/tklock.c ++++ b/tklock.c +@@ -143,20 +143,6 @@ static const gchar *mce_keypad_sysfs_disable_path = NULL; + /** Submode at the beginning of a call */ + static submode_t saved_submode = MCE_INVALID_SUBMODE; + +-/** TKLock UI state type */ +-typedef enum { +- /** TKLock UI state unknown */ +- MCE_TKLOCK_UI_UNSET = -1, +- /** No TKLock UI active */ +- MCE_TKLOCK_UI_NONE = 0, +- /** Normal TKLock UI active */ +- MCE_TKLOCK_UI_NORMAL = 1, +- /** Event eater UI active */ +- MCE_TKLOCK_UI_EVENT_EATER = 2, +- /** Slider UI active */ +- MCE_TKLOCK_UI_SLIDER = 3 +-} tklock_ui_state_t; +- + /** TKLock UI state */ + static tklock_ui_state_t tklock_ui_state = MCE_TKLOCK_UI_UNSET; + +@@ -2508,6 +2494,10 @@ EXIT: + return; + } + ++int get_tklock_ui_state(void) { ++ return (int)tklock_ui_state; ++} ++ + /** + * Init function for the touchscreen/keypad lock component + * +@@ -2741,3 +2731,4 @@ void mce_tklock_exit(void) + + return; + } ++ +diff --git a/tklock.h b/tklock.h +index a963229..3a48c4c 100644 +--- a/tklock.h ++++ b/tklock.h +@@ -138,4 +138,20 @@ + gboolean mce_tklock_init(void); + void mce_tklock_exit(void); + ++/** TKLock UI state type */ ++typedef enum { ++ /** TKLock UI state unknown */ ++ MCE_TKLOCK_UI_UNSET = -1, ++ /** No TKLock UI active */ ++ MCE_TKLOCK_UI_NONE = 0, ++ /** Normal TKLock UI active */ ++ MCE_TKLOCK_UI_NORMAL = 1, ++ /** Event eater UI active */ ++ MCE_TKLOCK_UI_EVENT_EATER = 2, ++ /** Slider UI active */ ++ MCE_TKLOCK_UI_SLIDER = 3 ++} tklock_ui_state_t; ++ ++int get_tklock_ui_state(void); ++ + #endif /* _TKLOCK_H_ */ +-- +1.7.1 + Index: mce-1.10.92-add-and-enable-displaymeego-module.patch =================================================================== --- mce-1.10.92-add-and-enable-displaymeego-module.patch (revision 0) +++ mce-1.10.92-add-and-enable-displaymeego-module.patch (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,2220 @@ +From b6bc007ec705651668ca3c49deb445a130953c8c Mon Sep 17 00:00:00 2001 +From: Mika Laitio <[email protected]> +Date: Fri, 6 May 2011 12:29:43 +0300 +Subject: [PATCH 1/3] mce-1.10.92 add and enable displaymeego module + +Add new displaymeego module. This module is used for controlling the +display blanking and unblanking on meego handsets. + +Signed-off-by: Mika Laitio <[email protected]> +--- + Makefile | 1 + + mce.ini | 2 +- + modules/displaymeego.c | 2012 ++++++++++++++++++++++++++++++++++++++++++++++++ + modules/displaymeego.h | 150 ++++ + 4 files changed, 2164 insertions(+), 1 deletions(-) + create mode 100644 modules/displaymeego.c + create mode 100644 modules/displaymeego.h + +diff --git a/Makefile b/Makefile +index debed33..dc8bbb0 100644 +--- a/Makefile ++++ b/Makefile +@@ -46,6 +46,7 @@ MODULES := \ + $(MODULE_DIR)/libalarm.so \ + $(MODULE_DIR)/libbattery.so \ + $(MODULE_DIR)/libdisplay.so \ ++ $(MODULE_DIR)/libdisplaymeego.so \ + $(MODULE_DIR)/libled.so \ + $(MODULE_DIR)/libcallstate.so \ + $(MODULE_DIR)/libaudiorouting.so \ +diff --git a/mce.ini b/mce.ini +index 271f9a7..c94c5fc 100644 +--- a/mce.ini ++++ b/mce.ini +@@ -11,7 +11,7 @@ ModulePath=/usr/lib/mce/modules + # + # List of modules to load + # Note: the name should not include the "lib"-prefix +-Modules=radiostates;display;keypad;led;battery;filter-brightness-als;inactivity;alarm;callstate;audiorouting;proximity;powersavemode ++Modules=radiostates;displaymeego;keypad;led;battery;filter-brightness-als;inactivity;alarm;callstate;audiorouting;proximity;powersavemode + + + [HomeKey] +diff --git a/modules/displaymeego.c b/modules/displaymeego.c +new file mode 100644 +index 0000000..b1cd8af +--- /dev/null ++++ b/modules/displaymeego.c +@@ -0,0 +1,2012 @@ ++/** ++ * @file display.c ++ * Display module -- this implements display handling for MCE ++ * <p> ++ * Copyright ? 2007-2011 Nokia Corporation and/or its subsidiary(-ies). ++ * <p> ++ * @author Mika Laitio <[email protected]> ++ * based on the display.c code by ++ * David Weinehall <[email protected]> ++ * ++ * mce is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU Lesser General Public License ++ * version 2.1 as published by the Free Software Foundation. ++ * ++ * mce is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with mce. If not, see <http://www.gnu.org/licenses/>. ++ */ ++#include <glib.h> ++#include <gmodule.h> ++#include <glib/gstdio.h> /* g_access() */ ++ ++#include <errno.h> /* errno */ ++#include <fcntl.h> /* open() */ ++#include <stdio.h> /* O_RDWR */ ++#include <string.h> /* strcmp() */ ++#include <unistd.h> /* close() */ ++#include <linux/fb.h> /* FBIOBLANK, ++ * FB_BLANK_POWERDOWN, ++ * FB_BLANK_UNBLANK ++ */ ++#include <sys/ioctl.h> /* ioctl() */ ++ ++#include <mce/mode-names.h> /* MCE_CABC_MODE_OFF, ++ * MCE_CABC_MODE_UI, ++ * MCE_CABC_MODE_STILL_IMAGE, ++ * MCE_CABC_MODE_MOVING_IMAGE, ++ * MCE_DISPLAY_ON_STRING, ++ * MCE_DISPLAY_DIM_STRING, ++ * MCE_DISPLAY_OFF_STRING ++ */ ++ ++#include "mce.h" /* display_state_t, ++ * charger_state_pipe, ++ * display_state_pipe, ++ * display_brightness_pipe, ++ * inactivity_timeout_pipe, ++ * led_pattern_deactivate_pipe, ++ * submode_pipe, ++ * system_state_pipe, ++ * device_inactive_pipe ++ */ ++#include "displaymeego.h" ++ ++#include "mce-io.h" /* mce_read_string_from_file(), ++ * mce_read_number_string_from_file(), ++ * mce_write_number_string_to_file() ++ */ ++#include "mce-lib.h" /* strstr_delim(), ++ * mce_translate_string_to_int_with_default(), ++ * mce_translation_t ++ */ ++#include "mce-log.h" /* mce_log(), LL_* */ ++#include "mce-conf.h" /* mce_conf_get_int(), ++ * mce_conf_get_string() ++ */ ++#include "mce-dbus.h" /* Direct: ++ * --- ++ * mce_dbus_handler_add(), ++ * dbus_send_message(), ++ * dbus_new_method_reply(), ++ * dbus_new_signal(), ++ * dbus_message_append_args(), ++ * dbus_message_get_no_reply(), ++ * dbus_message_unref(), ++ * DBusMessage, ++ * DBUS_MESSAGE_TYPE_METHOD_CALL, ++ * DBUS_MESSAGE_TYPE_SIGNAL, ++ * DBUS_TYPE_STRING, ++ * DBUS_TYPE_INVALID, ++ * dbus_bool_t ++ * ++ * Indirect: ++ * --- ++ * MCE_SIGNAL_IF, ++ * MCE_SIGNAL_PATH, ++ * MCE_REQUEST_IF, ++ * MCE_DISPLAY_STATUS_GET, ++ * MCE_DISPLAY_ON_REQ, ++ * MCE_DISPLAY_DIM_REQ, ++ * MCE_DISPLAY_OFF_REQ, ++ * MCE_PREVENT_BLANK_REQ, ++ * MCE_CABC_MODE_GET, ++ * MCE_CABC_MODE_REQ ++ */ ++#include "mce-gconf.h" /* mce_gconf_get_int(), ++ * mce_gconf_get_bool(), ++ * mce_gconf_notifier_add(), ++ * gconf_entry_get_key(), ++ * gconf_value_get_int(), ++ * gconf_value_get_bool(), ++ * GConfClient, GConfEntry, GConfValue ++ */ ++#include "datapipe.h" /* datapipe_get_gint(), ++ * execute_datapipe(), ++ * append_output_trigger_to_datapipe(), ++ * remove_output_trigger_from_datapipe() ++ */ ++ ++/* These defines are taken from devicelock.h, but slightly modified */ ++#ifndef DEVICELOCK_H ++/** Devicelock D-Bus service */ ++#define DEVLOCK_SERVICE "com.nokia.devicelock" ++ ++/** Devicelock D-Bus service */ ++#define DEVLOCK_PATH "/request" ++ ++/** Set devicelock state */ ++#define DEVLOCK_SET "setState" ++ ++// after blanking DISPLAY there comes sometimes activity events from event-input /dev/input2 that ++// could turn the DISPLAY again on. ++#define DISPLAY_UNBLANK_INACTIVITY_FILTER_SECONDS 1 ++ ++/** Enumeration of the valid locks on the device */ ++enum LockType { ++ /** TouchAndKeyboard -- The touch screen and keypad lock */ ++ TouchAndKeyboard = 0, ++ /** Device -- The device lock, password protected lock screen */ ++ Device ++}; ++ ++/** Enumeration of the valid states that a lock can be in */ ++enum LockState { ++ /** Unlocked - The lock is unlocked */ ++ Unlocked = 0, ++ /** Locked - The lock is being used */ ++ Locked, ++ /** Configuration - Open the locks configuration settings */ ++ Configuration, ++/** WipeMMC - Secure wipe of the device */ ++ WipeMMC, ++ /** Inhibit - Stop the lock ui(s) from being displayed */ ++ Inhibit, ++ /** Undefined - Lock state is unknown or the lock does not exist */ ++ Undefined ++}; (2020 more lines skipped) Index: mce-1.10.90-no-werror.patch =================================================================== --- mce-1.10.90-no-werror.patch (revision 0) +++ mce-1.10.90-no-werror.patch (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,12 @@ +diff -urN a/Makefile b/Makefile +--- a/Makefile 2010-06-16 21:06:27.315595000 +0300 ++++ b/Makefile 2010-07-07 10:24:01.530452891 +0300 +@@ -67,7 +67,7 @@ + WARNINGS += -Wmissing-format-attribute + #WARNINGS += -Wswitch-enum -Wunreachable-code + WARNINGS += -Wstack-protector +-WARNINGS += -Werror # -std=c99 ++#WARNINGS += -Werror # -std=c99 + WARNINGS += -Wno-declaration-after-statement + + COMMON_CFLAGS := -D_GNU_SOURCE Index: mce.spec =================================================================== --- mce.spec (revision 0) +++ mce.spec (revision ed3212eccf98e86c2c3b6a23dcc646bf) @@ -0,0 +1,187 @@ +# +# Do NOT Edit the Auto-generated Part! +# Generated by: spectacle version 0.23 +# +# >> macros +# << macros + +Name: mce +Summary: Mode Control Entity for Nokia mobile computers +Version: 1.10.92 +Release: 17 +Group: System/System Control +License: LGPLv2 +URL: http://meego.gitorious.org/meego-middleware/mce/ +Source0: %{name}-%{version}.tar.bz2 +Source1: mce.service +Source100: mce.yaml +Patch0: %{name}-1.10.90-no-ownership.patch +Patch1: %{name}-1.10.90-include-i2c-fix.patch +Patch2: %{name}-1.10.90-no-werror.patch +Patch3: %{name}-1.10.92-add-and-enable-displaymeego-module.patch +Patch4: %{name}-1.10.92-silent-fd-close.patch +Patch5: %{name}-1.10.92-pwr-button-event-name.patch +Patch6: %{name}-1.10.92-add-ofono-call-state-handling.patch +Patch7: %{name}-1.10.92-fix-delay-when-processing-touchscreen-events.patch +Patch8: %{name}-1.10.92-pwr-btn-fix-for-display-blank-and-unblank.patch +Patch9: %{name}-1.10.92-fix-n900-tsc2005-sysfs-disable-path-for-newer-kernels.patch +Patch10: %{name}-1.10.92-bmc19806-do-not-unblank-display-if-dbus-send-fails.patch +Patch11: %{name}-1.10.92-refcounting-for-call-state.patch +Requires: dsme +Requires: systemd +Requires(pre): GConf2 +Requires(preun): GConf2 +Requires(preun): systemd +Requires(post): GConf2 +Requires(post): systemd +Requires(postun): systemd +BuildRequires: pkgconfig(dbus-1) >= 1.0.2 +BuildRequires: pkgconfig(dbus-glib-1) +BuildRequires: pkgconfig(dsme) >= 0.58 +BuildRequires: pkgconfig(gconf-2.0) +BuildRequires: pkgconfig(glib-2.0) >= 2.18.0 +BuildRequires: pkgconfig(mce) >= 1.10.21 +BuildRequires: kernel-headers >= 2.6.32 +BuildRequires: libi2c-devel + + +%description +This package contains the Mode Control Entity which provides +mode management features. This is a daemon that is the backend +for many features on Nokia's mobile computers. + + + +%package tools +Summary: Tools for interacting with mce +Group: Development/Tools +Requires: %{name} = %{version}-%{release} + +%description tools +This package contains tools that can be used to interact with +the Mode Control Entity and to get mode information. + + + +%prep +%setup -q -n %{name}-%{version} + +# %{name}-1.10.90-no-ownership.patch +%patch0 -p1 +# %{name}-1.10.90-include-i2c-fix.patch +%patch1 -p1 +# %{name}-1.10.90-no-werror.patch +%patch2 -p1 +# %{name}-1.10.92-add-and-enable-displaymeego-module.patch +%patch3 -p1 +# %{name}-1.10.92-silent-fd-close.patch +%patch4 -p1 +# %{name}-1.10.92-pwr-button-event-name.patch +%patch5 -p1 +# %{name}-1.10.92-add-ofono-call-state-handling.patch +%patch6 -p1 +# %{name}-1.10.92-fix-delay-when-processing-touchscreen-events.patch +%patch7 -p1 +# %{name}-1.10.92-pwr-btn-fix-for-display-blank-and-unblank.patch +%patch8 -p1 +# %{name}-1.10.92-fix-n900-tsc2005-sysfs-disable-path-for-newer-kernels.patch +%patch9 -p1 +# %{name}-1.10.92-bmc19806-do-not-unblank-display-if-dbus-send-fails.patch +%patch10 -p1 +# %{name}-1.10.92-refcounting-for-call-state.patch +%patch11 -p1 +# >> setup +# << setup + +%build +# >> build pre +# << build pre + + +make %{?jobs:-j%jobs} + +# >> build post +# << build post +%install +rm -rf %{buildroot} +# >> install pre +# << install pre +%make_install + +# >> install post +install -d %{buildroot}/%{_mandir}/man8 +install -m 644 man/mce.8 %{buildroot}/%{_mandir}/man8/mce.8 +install -m 644 man/mcetool.8 %{buildroot}/%{_mandir}/man8/mcetool.8 +install -m 644 man/mcetorture.8 %{buildroot}/%{_mandir}/man8/mcetorture.8 +install -d %{buildroot}/%{_mandir}/sv/man8 +install -m 644 man/mce.sv.8 %{buildroot}/%{_mandir}/sv/man8/mce.8 +install -m 644 man/mcetool.sv.8 %{buildroot}/%{_mandir}/sv/man8/mcetool.8 +install -m 644 man/mcetorture.sv.8 %{buildroot}/%{_mandir}/sv/man8/mcetorture.8 +install -d %{buildroot}/lib/systemd/system/sysinit.target.wants/ +ln -s ../%{name}.service %{buildroot}/lib/systemd/system/sysinit.target.wants/%{name}.service +install -D -m 644 %{SOURCE1} %{buildroot}/lib/systemd/system/%{name}.service +# << install post + +%pre +if [ "$1" -gt 1 ]; then + export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` + gconftool-2 --makefile-uninstall-rule \ + %{_sysconfdir}/gconf/schemas/*.schemas \ + > /dev/null || : +fi + +%preun +if [ "$1" -eq 0 ]; then + export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` + gconftool-2 --makefile-uninstall-rule \ + %{_sysconfdir}/gconf/schemas/*.schemas \ + > /dev/null || : +fi +systemctl stop %{name}.service + +%post +export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` +gconftool-2 --makefile-install-rule \ + %{_sysconfdir}/gconf/schemas/*.schemas > /dev/null || : +systemctl daemon-reload +systemctl reload-or-try-restart %{name}.service + +%postun +systemctl daemon-reload + + + + + +%files +%defattr(-,root,root,-) +# >> files +%doc COPYING debian/changelog debian/copyright TODO +%config(noreplace) %{_sysconfdir}/dbus-1/system.d/mce.conf +%config(noreplace) %{_sysconfdir}/gconf/schemas/*.schemas +%config(noreplace) %{_sysconfdir}/%{name}/mce.ini +/sbin/%{name} +%{_libdir}/%{name}/modules/*.so +%{_sharedstatedir}/%{name}/radio_states.* +%{_datadir}/backup-framework/applications/mcebackup.conf +%{_mandir}/man8/%{name}.8.gz +%{_mandir}/sv/man8/%{name}.8.gz +%{_datadir}/mce/mce-* +/lib/systemd/system/%{name}.service +/lib/systemd/system/sysinit.target.wants/%{name}.service +# << files + + +%files tools +%defattr(-,root,root,-) +# >> files tools +%doc COPYING debian/copyright +%config(noreplace) %{_sysconfdir}/dbus-1/system.d/mcetool.conf +/sbin/mcetool +/sbin/mcetorture +%{_mandir}/man8/mcetool.8.gz +%{_mandir}/sv/man8/mcetool.8.gz +%{_mandir}/man8/mcetorture.8.gz +%{_mandir}/sv/man8/mcetorture.8.gz +# << files tools +
