1. 17 May, 2019 1 commit
    • spiiroin's avatar
      [mce] Unify license blurbs. JB#33684 · 091d6e7e
      spiiroin authored
      MCE uses LGPL v2.1 (without "or later") license, but due to missing / use
      of different license blurbs this is not always clear enough.
      
      Replace blurbs referring to "LGPLv2" short form which could be either
      LGPL v2.0 or v2.1 without "or later" with the same blurb that is used
      in mce.c file.
      
      Similarly add blurb to source files that are missing one altogether.
      
      Add all authors that can be derived from git logs.
      
      Update Jolla Ltd. copyright statements to match git activity.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      091d6e7e
  2. 23 Nov, 2018 1 commit
    • spiiroin's avatar
      [dsme] Track thermal state from thermal manager. Fixes JB#43907 · e82c1a3f
      spiiroin authored
      MCE has functionality like PowerSaveMode that depends on device thermal
      state, however the thermal state datapipe that is supposed to carry
      thermal status information within MCE is not connected to any data source.
      
      Query current thermal status from thermal manager when the service shows
      up on D-Bus SystemBus, listen to thermal status change notifications, and
      feed the state information to thermal state datapipe.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      e82c1a3f
  3. 19 Sep, 2018 5 commits
  4. 10 Apr, 2018 1 commit
  5. 29 Mar, 2018 1 commit
  6. 16 Mar, 2018 1 commit
  7. 01 Mar, 2018 1 commit
  8. 28 Feb, 2018 1 commit
    • spiiroin's avatar
      [datapipe] Unify naming. Contributes to JB#22475 · 5fadb870
      spiiroin authored
      Use "datapipe_"  prefix for all functions:
      
       datapipe_add_filter            <- append_filter_to_datapipe
       datapipe_add_input_trigger     <- append_input_trigger_to_datapipe
       datapipe_add_output_trigger    <- append_output_trigger_to_datapipe
       datapipe_exec_filters          <- execute_datapipe_filters
       datapipe_exec_full             <- execute_datapipe
       datapipe_exec_input_triggers   <- execute_datapipe_input_triggers
       datapipe_exec_output_triggers  <- execute_datapipe_output_triggers
       datapipe_free                  <- free_datapipe
       datapipe_init                  <- setup_datapipe
       datapipe_remove_filter         <- remove_filter_from_datapipe
       datapipe_remove_input_trigger  <- remove_input_trigger_from_datapipe
       datapipe_remove_output_trigger <- remove_output_trigger_from_datapipe
      
      Datapipes that are used for solely for requesting state changes (i.e. do not
      themselves have a state) have a verb in the name:
      
       display_state_request_pipe          <- display_state_req_pipe
       led_pattern_activate_pipe           (no change)
       led_pattern_deactivate_pipe         (no change)
       tklock_request_pipe                 <- tk_lock_pipe
      
      Datapipes that are used solely process input events without having a
      persistent state have "event" in the name:
      
       heartbeat_event_pipe                <- heartbeat_pipe
       ignore_incoming_call_event_pipe     <- ignore_incoming_call_pipe
       inactivity_event_pipe               <- device_inactive_event_pipe
       keypress_event_pipe                 <- keypress_pipe
       resume_detected_event_pipe          <- device_resumed_pipe
       touchscreen_event_pipe              <- touchscreen_pipe
       user_activity_event_pipe            <- user_activity_pipe
      
      Datapipes dealing with brightness have "brightness" included in the name:
      
       display_brightness_pipe             (no change)
       key_backlight_brightness_pipe       <- key_backlight_pipe
       led_brightness_pipe                 (no change)
       lpm_brightness_pipe                 (no change)
      
      Datapipes dealing with sensors have "sensor" in name and the one holding
      unfiltered data is called "actual":
      
       lid_sensor_actual_pipe              <- lid_cover_sensor_pipe
       lid_sensor_filtered_pipe            <- lid_cover_policy_pipe
       lid_sensor_is_working_pipe          (no change)
       light_sensor_actual_pipe            <- ambient_light_sensor_pipe
       light_sensor_filtered_pipe          <- ambient_light_level_pipe
       light_sensor_poll_request_pipe      <- ambient_light_poll_pipe
       orientation_sensor_actual_pipe      <- orientation_sensor_pipe
       proximity_sensor_actual_pipe        <- proximity_sensor_pipe
      
      Datapipes that have enumerated state reflect the enumeration type in
      datapipe name:
      
       alarm_ui_state_pipe                 (no change)
       audio_route_pipe                    (no change)
       battery_status_pipe                 (no change)
       bluez_service_state_pipe            <- bluez_available_pipe
       call_state_pipe                     (no change)
       call_type_pipe                      (no change)
       camera_button_state_pipe            <- camera_button_pipe
       charger_state_pipe                  (no change)
       compositor_service_state_pipe       <- compositor_available_pipe
       devicelock_service_state_pipe       <- devicelock_available_pipe
       devicelock_state_pipe               <- device_lock_state_pipe
       display_state_curr_pipe             <- display_state_pipe
       display_state_next_pipe             (no change)
       dsme_service_state_pipe             <- dsme_available_pipe
       jack_sense_state_pipe               <- jack_sense_pipe
       keyboard_available_state_pipe       <- keyboard_available_pipe
       keyboard_slide_state_pipe           <- keyboard_slide_pipe
       lens_cover_state_pipe               <- lens_cover_pipe
       lipstick_service_state_pipe         <- lipstick_available_pipe
       lockkey_state_pipe                  <- lockkey_pipe
       ngfd_service_state_pipe             <- ngfd_available_pipe
       submode_pipe                        (no change)
       system_state_pipe                   (no change)
       thermal_state_pipe                  (no change)
       uiexception_type_pipe               <- exception_state_pipe
       usb_cable_state_pipe                <- usb_cable_pipe
       usbmoded_service_state_pipe         <- usbmoded_available_pipe
      
      Datapipes that have boolean state should answer an
      "is" question:
      
       device_inactive_pipe                <- device_inactive_state_pipe
       interaction_expected_pipe           (no change)
       keypad_grab_active_pipe             (no change)
       keypad_grab_wanted_pipe             (no change)
       master_radio_enabled_pipe           <- master_radio_pipe
       music_playback_ongoing_pipe         <- music_playback_pipe
       osupdate_running_pipe               <- update_mode_pipe
       packagekit_locked_pipe              (no change)
       power_saving_mode_active_pipe       <- power_saving_mode_pipe
       proximity_blanked_pipe              <- proximity_blank_pipe
       shutting_down_pipe                  (no change)
       touch_detected_pipe                 (no change)
       touch_grab_active_pipe              (no change)
       touch_grab_wanted_pipe              (no change)
      
      Datapipes that have integer state should answer
      and "what is" question:
      
       battery_level_pipe                  (no change)
       inactivity_delay_pipe               <- inactivity_timeout_pipe
      
      Rename datapipe related callback functions and variables similarly as what
      was done to datapipes.
      
      Define submode bitmasks as submode_t enumeration instead of using
      gint type and preprocessor constants. Change the value naming from
      MCE_xxx_SUBMODE to MCE_SUBMODE_xxx.
      
      Change call_type_t enumeration value naming from xxx_CALL to
      CALL_TYPE_xxx.
      
      Change system_state_t enumeration value naming from MCE_STATE_xxx
      to MCE_SYSTEM_STATE_xxx.
      
      Fix setting up of power_saving_mode_active_pipe, master_radio_enabled_pipe
      and lens_cover_state_pipe so that initial values of appropriate type are
      used.
      
      Switch lockkey_state_pipe value from gboolean to key_state_t type.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      5fadb870
  9. 26 Apr, 2017 1 commit
    • spiiroin's avatar
      [dsme] Avoid recursion during dsmesock disconnecting. Fixes JB#38474 · 2995b4d0
      spiiroin authored
      Using availability of dsme dbus service as an trigger for disconnecting
      also the dsmesock connection creates a shutdown time hazard where mce
      attempts to recursively deactivate process watchdog on an already closed
      connection.
      
      As dsme dropping from systembus no longer means that dsme is about to
      exit, do not trigger dsmesock disconnects when dsme service loses name
      owner on system bus.
      
      Avoid recursive process watchdog quits during disconnect by doing the
      quitting only once / connect after removal of socket io watch.
      
      Drop reconnect attempts on I/O error situations as they are unlikely
      to do any good and can lead to further recursive behavior.
      
      Do not initiate new dsmesock connections while device is shutting down.
      Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
      2995b4d0
  10. 15 Feb, 2017 1 commit
  11. 18 Jan, 2017 1 commit
  12. 10 Nov, 2015 1 commit
  13. 05 Sep, 2015 2 commits
    • spiiroin's avatar
      [dsme] Refactor mce-dsme module.Contributes to JB#28901 · f607bd7c
      spiiroin authored
      Group functions by type and use common prefix within each group.
      
      Switch indentation from 8/tabs to 4/spaces.
      
      No functional changes.
      f607bd7c
    • spiiroin's avatar
      [dsme] Move dsme signal handling to mce-dsme module. Fixes JB#28901 · a35e3f9d
      spiiroin authored
      Due to historical reasons pre-shutdown signals dsme is sending are
      handled in display plugin. This is problematic because there is a
      dependency between system and shutdown-in-progress states which now
      are handled in multiple ways in more than one place.
      
      Move signal handlers to mce-dsme module and unify handling of
      shutdown-in-progress state.
      a35e3f9d
  14. 14 Mar, 2015 1 commit
    • spiiroin's avatar
      Remove SoftOff mode · b6d161ea
      spiiroin authored
      SoftOff mode is basically manual suspend to RAM for pre N900 era maemo
      devices. The logic in MCE side does not work and also support needed by
      it has beed dropped from DSME side ages ago.
      
      Remove all remnants of SoftOff mode that still linger in mce code tree.
      
      [mce] Remove SoftOff mode. Fixes JB#27285
      b6d161ea
  15. 12 Feb, 2015 2 commits
    • spiiroin's avatar
      Identify unhandled dsme message types in human readable form · 5f4c0b51
      spiiroin authored
      Running mce in debug verbosity causes unhandled dsme messages to be
      reported. Evaluating what those are and should they be handled takes
      time as libdsme & co make the raw numeric values obscure on purpose.
      
      As the existing values are carved in stone, we can use custom lookup
      function to print human readable message type names too.
      5f4c0b51
    • spiiroin's avatar
      Do not attempt to reconnect if dsme socket connection is closed · b0074507
      spiiroin authored
      When dsme exits, mce sees the dsme specific socket getting closed
      before dsme dbus service drops from the system bus. Because the
      dbus service is still supposedly available, reconnect attempt
      is made but it only leads into spamming journal with warnings.
      
      Use dbus service tracking from mce-dbus module for dsme too.
      
      When eof or read error occurs on dsme socket, assume dsme has made
      and exit and wait for dbus service availability changes before
      attempting to reconnect.
      
      Also skip some dsme related warnings when the device is shutting
      down and not having dsme available is more or less expected.
      
      [mce] Do not attempt to reconnect if dsme socket connection is closed. Fixes JB#26373
      b0074507
  16. 09 Feb, 2015 1 commit
    • spiiroin's avatar
      Log system state changes in human readable form · 5a1b3886
      spiiroin authored
      System state changes are logged in numeric form which means that mental
      exercise is required while interpreting the logs.
      
      Add system state enum to state name helper function and use it to
      provide human readable diagnostic logging.
      5a1b3886
  17. 23 Jan, 2015 1 commit
    • spiiroin's avatar
      Fix USB cable connection related issues in display blanking policy · 4da9aaa6
      spiiroin authored
      There is logic in mce to process charging state separately from usb
      cable connect state, but since the legacy logic for detecting does
      not work charging status has been used for things that should depend
      on cable connect. This delays things like turning on display to show
      usb mode selection dialog and makes it hard to decide how long the
      display should be kept on. And turning on display when mce starts
      up while usb cable is already attached can cause problems during 1st
      boot if the display state restoration occurs close to starting up of
      the startup wizard.
      
      Use usb mode provided by usb_moded to determine usb cable state. The
      usb_moded tracking logic is derived from the implentation used in dsme.
      Both mce and dsme use LGPL v2.1 license.
      
      Use separate display on rules for charging and cable connect changes.
      
      Do not turn on the display when cable is removed / charging stops.
      
      Do not turn on the display if usb cable is already connected when
      mce is started.
      
      Fix glitches in display state handling and automatic brightness
      tuning during mce startup.
      
      [mce] Fix USB cable connection related issues in display blanking policy. Fixes JB#25788
      4da9aaa6
  18. 17 Jun, 2014 3 commits
    • spiiroin's avatar
      6217ae88
    • spiiroin's avatar
      60e6d0df
    • spiiroin's avatar
      Do not required dsme to be running when mce starts up · ecd3ebaf
      spiiroin authored
      Previously mce could not be started unless dsme was running and was
      forced to exit if dsme stopped/crashed.
      
      Now mce tracks availability of dsme by watching D-Bus name ownership
      changes of com.nokia.dsme on system bus and makes connection when
      dsme is up and running.
      
      While dsme is not available process watchdog ping-pong based heartbeat
      activities do not get triggered and shutdown requests can't be made.
      
      I/O errors during socket IPC with dsme trigger re-connect attempt.
      
      Also the mce --debug-mode command line option is removed since it is not
      needed anymore.
      
      [mce] Do not required dsme to be running when mce starts up. Fixes JB#11581
      ecd3ebaf
  19. 12 Jun, 2014 1 commit
  20. 27 May, 2014 1 commit
  21. 13 May, 2014 1 commit
    • spiiroin's avatar
      Fix white space issues in mce code base · 9cc0f544
      spiiroin authored
      No functional changes.
      
      Files where majority of lines are indented with tabulators are changed
      so that every beginning of line uses tabulators for 8 character skips.
      The rest of the files use only space characters for indentation.
      
      Remove excess empty lines from all source files.
      
      Make indentation levels uniform within each source file.
      
      [mce] Fix white space issues in mce code base. Fixes JB#18915
      9cc0f544
  22. 14 Mar, 2014 1 commit
    • spiiroin's avatar
      Handle io watch error conditions gracefully · 7a56637c
      spiiroin authored
      All calls to g_io_add_watch() request error condition reporting, and
      all related callback functions at minimum will not create a virtual
      busyloop by leaving the io watch active and ignoring the error state.
      
      The mce io monitoring subsystem is modified so that instead of using
      separate io watches for data and error handling + optional error
      recovery callback it now has one io watch that first deals with
      possible errors and then handles possible input via monitor type
      specific logic and enforces delete notification callbacks for making
      clean up at upper level logic. This should allow mce to gracefully
      handle situations like adding/removing bluetooth keyboards.
      
      [mce] Handle io watch error conditions gracefully
      7a56637c
  23. 26 Aug, 2013 1 commit
    • spiiroin's avatar
      Use single state machine for both display and suspend policy · 3a6eae2e
      spiiroin authored
      As fb suspend and wakeup are not immediate, display state requests
      must be handled separately from actual state transition processing.
      
      A new data pipe display_state_req_pipe is used for making display
      state requests and filtering them.
      
      The state machine takes data from display_state_req_pipe and
      makes changes known to existing triggers via display_state_pipe.
      
      The suspend policy is integrated to display state handling, which
      allows better control over sharing update enable/disable state
      with ui side (lipstick).
      
      [mce] Use single state machine for both display and suspend policy
      3a6eae2e
  24. 22 Aug, 2013 1 commit
  25. 25 Mar, 2013 1 commit
    • spiiroin's avatar
      Remove support for explicitly named mce ini-files · 87ede0ba
      spiiroin authored
      Since the whole mce code base is now using the combined ini-file
      data, we can
      a) remove unused functions mce_conf_read_conf_file() and
         mce_conf_free_conf_file()
      b) omit passing of NULL keyfileptr to the rest of mce_conf_xxx()
      87ede0ba
  26. 21 Dec, 2012 1 commit
  27. 11 Dec, 2012 1 commit
  28. 22 Nov, 2011 1 commit
  29. 12 May, 2011 1 commit
  30. 28 Jan, 2011 1 commit
  31. 16 Dec, 2010 1 commit